Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tobiasah/pycapnp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: capnproto/pycapnp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 15 commits
  • 30 files changed
  • 7 contributors

Commits on Oct 23, 2023

  1. Handle exceptions from server callbacks

    In its current form, when a server callback throws an exception, it is
    completely swallowed. Only when the asyncio loop is being shut down might one
    possibly see that error. On top of that, the connection is never closed, causing
    any clients to hang, and a memory leak in the server.
    
    This is a proposed fix that reports the exception to the asyncio exception
    handler. It also makes sure that the connection is always closed, even if the
    callback doesn't close it explicitly.
    
    Note that the design of AsyncIoStream is directly based on the design of
    Python's asyncio streams: https://docs.python.org/3/library/asyncio-stream.html
    These streams appear to have exactly the same flaw. I've reported this here:
    python/cpython#110894. Since I don't really know what
    I'm doing, it might be worth seeing what kind of solution they might come up
    with and model our solution after theirs.
    LasseBlaauwbroek authored and haata committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    ca8d120 View commit details
    Browse the repository at this point in the history
  2. Disable the use of ninja for windows builds

    Aperantly github added ninja to all of there runners now. This
    causes the windows build to fail. This is expected because we
    add the architecture as a compiler arg which is not known to
    ninja. Even with this the build fails.
    
    This commit disables ninja on windows for now. Once we fixed the
    underlying issue with ninja and windows we can reenable it.
    tobiasah authored and haata committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    7a49706 View commit details
    Browse the repository at this point in the history
  3. DynamicCapabilityClient: fix crash due to wrong types

    In the last commit touching this line, a ')' was put in the wrong place, leading to errors like this one:
    
    ```
      File "capnp/lib/capnp.pyx", line 2172, in capnp.lib.capnp._DynamicCapabilityClient.__dir__
    TypeError: unsupported operand type(s) for +: 'set' and 'tuple'
    ```
    lewinb-corp authored and haata committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    c9bea05 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2023

  1. Properly join list of methods in _DynamicCapabilityClient

    This was already fixed in c9bea05, but the fix does not seem to work.
    This commit uses a set union, which should be more robust. It also adds
    a couple of assertions to verify that it indeed works.
    Fabio Rossetto authored and haata committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    42665a6 View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2023

  1. Make reraise_kj_exception available to downstream

    I'm using Pycapnp in a project, where we compile `.capnp` files directly to
    Cython instead of using the dynamic interface (for speed). For this, we need
    access to the `reraise_kj_exception` C function defined by Pycapnp. This is not
    possible, because Cython does not automatically make this function available to
    downstream users.
    
    My previous solution, in capnproto#301, was rather flawed. The  file `capabilityHelper.cpp`, where
    `reraise_kj_exception` is defined, was bundled into the distribution, so that
    this file could be included in downstream libraries. This turns out to be a
    terrible idea, because it redefines a bunch of other things like
    `ReadPromiseAdapter`. For reasons not entirely clear to me, this leads to
    segmentation faults. This PR revers capnproto#301.
    
    Instead, in this PR I've made `reraise_kj_exception` a Cython-level function,
    that can be used by downstream libraries. The C-level variant has been renamed
    to `c_reraise_kj_exception`.
    LasseBlaauwbroek authored and haata committed Nov 5, 2023
    Configuration menu
    Copy the full SHA
    aafec22 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2023

  1. Support _DynamicListReader in _setDynamicField

    See the test for an explanation.
    
    Note that I'm not sure what the purpose of `_setDynamicFieldWithField` and
    `_setDynamicFieldStatic` is. It does not appear to be used. I've kept them for
    now (they are a public API), but perhaps this can be removed.
    LasseBlaauwbroek authored and haata committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    ef5e039 View commit details
    Browse the repository at this point in the history
  2. Fix re-raising of KjException

    - The `KjException._to_python()` function neglected to check if the wrapper was
      set when attempting to convert to `AttributeError`, leading to exceptions while
      raising an exception.
    - The syntax `raise A, B, C` hasn't existed since Python 3. The only reason it
      works is because Cython supports it. Lets get rid of it.
    - There was an attempt to convert a certain kind of `KjException` to an
      `AttributeError`. However, the original exception remains in the context when
      the new exception is raised. This is confusing. We get rid of the original
      exception by doing `raise e._to_python() from None`.
    LasseBlaauwbroek authored and haata committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    49bda5c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0ec4d0b View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2023

  1. Corner case for cancelled server methods that raise exceptions

    When a server method is cancelled, but it nonetheless raises an exception (other
    than `CancelledError`), this exception cannot be reported to the caller (because
    it has cancelled that call).
    
    The only place where it can go is to the asyncio exception handler...
    LasseBlaauwbroek authored and haata committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    b6ea909 View commit details
    Browse the repository at this point in the history

Commits on Nov 25, 2023

  1. Some fixes to the magic import system

    - Stop adding the directory of every .capnp file to the import path. If a .capnp
      file wants to import a file in its own directory, it should use a relative
      import. Fixes capnproto#278
    - Stop using /usr/include/capnp as an import path. This is incorrect. It should
      only be /usr/include.
    - Stop allowing additional paths to be specified for magic imports. This leads
      to inconsistencies. More specifically, the way that a nested import like
      `ma.mb.mc_capnp` gets imported by python, is to first import `ma`, then import
      `ma.mb`, and finally `ma.mb.mc_capnp`. Pycapnp's magic importing is only
      involved in the last step. So any additional paths specified don't work for
      nested imports. It is very confusing to only have this for non-nested imports.
      Users with folder layouts that don't follow pythons import paths can still use
      `capnp.load(.., .., imports=[blah])`.
    LasseBlaauwbroek authored and haata committed Nov 25, 2023
    Configuration menu
    Copy the full SHA
    3aade70 View commit details
    Browse the repository at this point in the history
  2. Prepare for v2.0.0b2 release

    - Update CHANGELOG.md
    haata committed Nov 25, 2023
    Configuration menu
    Copy the full SHA
    84830d6 View commit details
    Browse the repository at this point in the history
  3. Update README.md

    Cap'n'proto has transitioned to GitHub Mailing Lists
    haata authored Nov 25, 2023
    Configuration menu
    Copy the full SHA
    1f2349a View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2024

  1. Prepare for v2.0.0 release

    - Update CHANGELOG.md
    haata committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    1fb1687 View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2024

  1. address flake8 format check

    yianchenhpe authored and haata committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    78dd54e View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2024

  1. Include _custom_build in sdist

    This fixes build issues for installations that cannot use wheels
    published on PyPI. Issue capnproto#364 would be fixed by this.
    
    Python build tools like `python -m build` first build a source
    distribuiton (sdist) and then use it (and only it) to build a binary
    wheel from. This doesn't work if one of the build scripts isn't in the
    sdist however, which was the case prior to this patch.
    kvelicka authored and haata committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    59a639f View commit details
    Browse the repository at this point in the history
Loading