profile
viewpoint
Cory Benfield Lukasa Apple London, England https://lukasa.co.uk Professional open source developer with a long background in building networking tools. Creator of @python-hyper, core developer of Swift NIO. Everywhere.

grpc/grpc-swift 1151

The Swift language implementation of gRPC.

apple/swift-crypto 962

Open-source implementation of a substantial portion of the API of Apple CryptoKit suitable for use on Linux platforms.

apple/swift-nio-transport-services 179

Extensions for SwiftNIO to support Apple platforms as first-class citizens.

apple/swift-nio-ssh 160

SwiftNIO SSH is a programmatic implementation of SSH using SwiftNIO

brettcannon/sans-io 76

Network protocol implementations in Python, sans I/O

Lukasa/entweet 67

Badass encryption for Twitter

Lukasa/collectr 20

Static file management for everyone.

Lukasa/cryptopals 7

My solutions to the Matasano Crypto Challenges

issue commenttwisted/pydoctor

"\n" in default code directive "::" is interpreted and causes a new line in output

Although unexpected, I think this behavior is actually correct. Since a docstring is a Python string, a \n inside the string will be parsed as a newline character by the Python parser, before the docformat parser even sees the string. If this is not wanted, a raw string can be used instead:

r"""
Code::

    x = 'a\nb'
"""

It would be worth documenting this though, because it is not intuitive.

tristanlatr

comment created time in 2 hours

issue commenttwisted/pydoctor

private stuff should be private-er

The original ticket asked for both a public/private toggle and for a way to see what is private when everything is visible. We have the former, but not the latter. Do we want the latter as well?

For users that want to see everything, maybe we can add an argument to the URL's query? That would allow linking to the "show private definitions" version.

mwhudson

comment created time in 4 hours

pull request commentpsf/requests

bump idna has version 3.0 was released

It would be most useful if these could be merged for the next release, we're also stuck with issues due to idna dependencies.

naorlivne

comment created time in 4 hours

push eventgrpc/grpc-swift

George Barnett

commit sha b4bebe5000ff52b59c94090c3daca31c68257e4d

Support new handlers in the server codec + state machine (#1101) Motivation: We have new ways of handling RPCs on the server, the server codec and state machine should use them! Modifications: - In the state machine: try to handle an RPC using the new API, falling back to the old way - In the codec: store a mode, i.e. how we're handling the RPC. - Flushing has become the responsibility of the server codec (as opposed to the RPC-specific channel handler): now we only flush at the end of 'channelReadComplete' (if a flush is pending), or on calls to 'flush(context:)' if we aren't currently reading. Result: The server supports the new RPC handlers.

view details

push time in 4 hours

PR merged grpc/grpc-swift

Support new handlers in the server codec + state machine semver-patch •

Motivation:

We have new ways of handling RPCs on the server, the server codec and state machine should use them!

Modifications:

  • In the state machine: try to handle an RPC using the new API, falling back to the old way
  • In the codec: store a mode, i.e. how we're handling the RPC.
  • Flushing has become the responsibility of the server codec (as opposed to the RPC-specific channel handler): now we only flush at the end of 'channelReadComplete' (if a flush is pending), or on calls to 'flush(context:)' if we aren't currently reading.

Result:

The server supports the new RPC handlers.

+232 -87

0 comment

3 changed files

glbrntt

pr closed time in 4 hours

fork icing/crustls

C-to-rustls bindings

fork in 5 hours

issue commentpyca/pyopenssl

AttributeError :__Enter__ error is throwed when using pyopenssl lib 20.01 version

@alex @tiran : Thanks for your feedback. The version cffi -->1.1 is not an explicit version mentioned in requirement.txt file in my py project. However, this version is getting installed due to dependent py module installation, i guess. @alex does cffi version 1.12 is handled to fix the AttributeError: Enter ?

thiyaneshece

comment created time in 5 hours

issue closedpyca/pyopenssl

AttributeError :__Enter__ error is throwed when using pyopenssl lib 20.01 version

When creating a secure websocket connection(wss) using websocket create_connection() api call in pyopenssl - openssl/ssl.py (20.0.1), AttributeError: enter error is thrown.

Complete error flow is given below :
line 514, in create_connection
websock.connect(url, **options)
line 226, in connect
self.handshake_response = handshake(self.sock, *addrs, **options)
line 76, in handshake
send(sock, header_str)
line 157, in send
return _send()
line 139, in _send
return sock.send(data)
line 1644, in send
with _from_buffer(buf) as data:
AttributeError: enter

Websocket call flow : websocket.create_connection() -> websock.connect->handshake() -> send(sock, header_str) -> sock.send(data)

Surprisingly, when using 19.1.0 of pyopenssl version, there was no such error observed.

Between these 2 versions, send() method in SSL.py file does not have any changes. surprised to see the error when i execute the test case after the update of library.

with _from_buffer(buf) as data:             
    if len(buf) > 2147483647:                 
        raise ValueError("Cannot send more than 2**31-1 bytes at once.")
    result = _lib.SSL_write(self._ssl, data, len(data))
    self._raise_ssl_error(self._ssl, result)
    return result

closed time in 5 hours

thiyaneshece

issue commentpyca/pyopenssl

AttributeError :__Enter__ error is throwed when using pyopenssl lib 20.01 version

You'll need to update to cffi >= 0.12.

thiyaneshece

comment created time in 5 hours

issue commentpyca/pyopenssl

AttributeError :__Enter__ error is throwed when using pyopenssl lib 20.01 version

@alex cffi version installed is 1.1

That's very old. cffi 1.1.0 was released in 2015.

thiyaneshece

comment created time in 5 hours

issue commentpyca/pyopenssl

AttributeError :__Enter__ error is throwed when using pyopenssl lib 20.01 version

@alex cffi version installed is 1.1

thiyaneshece

comment created time in 5 hours

issue closedpsf/requests

Requests is using dependencies with copyleft licenses

We are using request's latest version but it uses certifi as depedency which is under MPL 2.0 license. This makes certifi a plugin with a copyleft license. Our company does not want to use any copyleft license plugin. I know that requests added certifi as separate plugin dependency after v 2.16 and onwards but I am not sure if its okay to use v2.15 because a lot of other bugs would also be fixed in latest versions. Is there a way we can exclude certifi depedency to avoid using a copyleft license plugin?

closed time in 6 hours

farooquiyasir

issue commentpsf/requests

Requests is using dependencies with copyleft licenses

The MPL-licensed code included in certifi is not modified so doesn't trigger the MPL license terms. Please search for existing closed issues before opening a new one.

farooquiyasir

comment created time in 6 hours

PR opened grpc/grpc-swift

Fix some bugs with new handlers

Motivation:

Manually wiring up the new handlers to run the rest of the test suite highlighted a few rough edges.

Modifications:

  • Make sure compression is correctly set: it must be enabled on the server, in the call context, and - if applicable - on the individaul message. Add tests for this.
  • Call the error delegate in the right place.
  • Add a 'protocol violation' error.

Result:

Fewer bugs.

+391 -112

0 comment

10 changed files

pr created time in 6 hours

PR opened grpc/grpc-swift

Reviewers
Support new handlers in the server codec + state machine semver-patch •

Motivation:

We have new ways of handling RPCs on the server, the server codec and state machine should use them!

Modifications:

  • In the state machine: try to handle an RPC using the new API, falling back to the old way
  • In the codec: store a mode, i.e. how we're handling the RPC.
  • Flushing has become the responsibility of the server codec (as opposed to the RPC-specific channel handler): now we only flush at the end of 'channelReadComplete' (if a flush is pending), or on calls to 'flush(context:)' if we aren't currently reading.

Result:

The server supports the new RPC handlers.

+232 -87

0 comment

3 changed files

pr created time in 6 hours

issue closedgrpc/grpc-swift

Project with GRPC dependencies not build from commandline

SPMs for SwiftNIO builds in wrong order

Steps to reproduce:

  1. Create new project
  2. File -> Swift packages -> add package dependency Use https://github.com/grpc/grpc-swift.git exact Swift 1.0.0-alpha.21
  3. build in XCode. Build succeeded
  4. close xcode
  5. run terminal
  6. Goto folder with project cd ~/projects/<use your path>/
  7. Run xcodebuild

Actual result: Library/Developer/Xcode/DerivedData/MultiScreen-gstsxmaaiuzazmcmkxnwlwsczybn/SourcePackages/checkouts/swift-nio-transport-services/Sources/NIOTransportServices/NIOFilterEmptyWritesHandler.swift:15:8: error: no such module 'NIO' import NIO

BUILD FAILED **

xcode 12.3

closed time in 10 hours

ibaho

issue openedpsf/requests

Requests is using dependencies with copyleft licenses

We are using request's latest version but it uses certifi as depedency which is under MPL 2.0 license. This makes certifi a plugin with a copyleft license. Our company does not want to use any copyleft license plugin. I know that requests added certifi as separate plugin dependency after v 2.16 and onwards but I am not sure if its okay to use v2.15 because a lot of other bugs would also be fixed in latest versions. Is there a way we can exclude certifi depedency to avoid using a copyleft license plugin?

created time in 11 hours

push eventgrpc/grpc-swift

George Barnett

commit sha 3d8d32359467c618de5a4a568797f129b799fa9a

Simplify some of the interaction between HTTP2 to GRPC state machine and codec (#1100) Motivation: The HTTP2ToRawGRPCStateMachine returns a somewhat generic 'Action' which the called is meant to act on. This pattern was used wholesale for every interaction with the statemachine. This is a little silly: in some cases the cases any action can be specified just fine with a `Bool`, in others a `Result` is fine. The other downside to this approach is that it makes it harder to see at the callsite what could happen as a result of interacting with the state machine. Modifications: - Specify an action to take for each different interaction with the state machine. - Update tests. Result: A handful of smallish reductions in instructions: - unary_10k_small_requests: -0.5% - embedded_server_unary_10k_small_requests: -2.6% - embedded_server_client_streaming_1_rpc_10k_small_requests: -4.0% - embedded_server_client_streaming_10k_rpcs_1_small_requests: -2.6% - embedded_server_server_streaming_1_rpc_10k_small_responses: -1.7% - embedded_server_server_streaming_10k_rpcs_1_small_response: -2.6% - embedded_server_bidi_1_rpc_10k_small_requests: -3.1% - embedded_server_bidi_10k_rpcs_1_small_request: -2.4%

view details

push time in 12 hours

PR merged grpc/grpc-swift

Simplify some of the interaction between HTTP2 to GRPC state machine … semver-patch •

…and codec

Motivation:

The HTTP2ToRawGRPCStateMachine returns a somewhat generic 'Action' which the called is meant to act on. This pattern was used wholesale for every interaction with the statemachine. This is a little silly: in some cases the cases any action can be specified just fine with a Bool, in others a Result is fine. The other downside to this approach is that it makes it harder to see at the callsite what could happen as a result of interacting with the state machine.

Modifications:

  • Specify an action to take for each different interaction with the state machine.
  • Update tests.

Result:

A handful of reductions in instructions in benchmarks:

  • unary_10k_small_requests: -0.5%
  • embedded_server_unary_10k_small_requests: -2.6%
  • embedded_server_client_streaming_1_rpc_10k_small_requests: -4.0%
  • embedded_server_client_streaming_10k_rpcs_1_small_requests: -2.6%
  • embedded_server_server_streaming_1_rpc_10k_small_responses: -1.7%
  • embedded_server_server_streaming_10k_rpcs_1_small_response: -2.6%
  • embedded_server_bidi_1_rpc_10k_small_requests: -3.1%
  • embedded_server_bidi_10k_rpcs_1_small_request: -2.4%
+337 -431

0 comment

4 changed files

glbrntt

pr closed time in 12 hours

push eventpython-hyper/priority

requires.io

commit sha d6200ab6bc2e34aba07eccc271db5822ff4d0cee

[requires.io] dependency update

view details

push time in 13 hours

push eventpython-hyper/wsproto

requires.io

commit sha ecb4593d70de7a37c245ffb973f1e36566b63ad3

[requires.io] dependency update

view details

push time in 13 hours

push eventpython-hyper/hyper-h2

requires.io

commit sha 82b9933a9ecc934d78a9a39cce44ea890685dabb

[requires.io] dependency update

view details

push time in 13 hours

push eventpython-hyper/hyperframe

requires.io

commit sha 117232030f15d587bf6bc2582ffc962b1cc690f5

[requires.io] dependency update

view details

push time in 13 hours

issue commenturllib3/urllib3

connection.py: BytesWarning: Comparison between bytes and string: if SKIP_HEADER not in values:

Breaks python ... -bb ..., until this is fixed, can be worked around by downgrading in pip:

urllib3==1.25.11
jdufresne

comment created time in 16 hours

issue closedpsf/requests

Documentation bug - missing cookies documentation

On the current latest documentation, there is a cookies link under the quickstart option.

image

We can see that this section should be displayed between Response Headers and Redirection History.

image

This section does not currently exist, and the link in the sidebar list is dead - clicking it does nothing.

Is this section missing, or should this link be removed?

closed time in 16 hours

ascopes

issue commentpsf/requests

Documentation bug - missing cookies documentation

Looks like the problem I originally reported is fixed now, and I can see it at the links you gave! Perhaps GitHub was serving an outdated cache at the time?

I am happy to close this, but will leave it for you guys to decide since it sounds like some other people might be having issues too.

Thanks for getting back to me.

ascopes

comment created time in 21 hours

pull request commenttwisted/pydoctor

Support for RST admonitions

It looks like there is a rendering error in the purple admonition... looks like raw HTML is not supported by pydoctor.

Everything looks good I don't know what you'r talking about. Here is the source code of the purple admonition patr:

.. raw:: html
    <style>
        .rst-admonition-purple {
            background-color: plum ! important;
        }
        .rst-admonition-purple p.rst-admonition-title{
            color: purple ! important;
        }
    </style>
.. admonition:: Purple
   This needs additionnal CSS for the new "rst-admonition-purple" class. 
   Include additional CSS by customizing the ``apidocs.css`` temlate file or by defining a raw block::
    .. raw:: html
    <style>
        .rst-admonition-purple {
            background-color: plum ! important;
        }
        .rst-admonition-purple p.rst-admonition-title{
            color: purple ! important;
        }
    </style>
   .. note:: The ``! important`` is required to overrride ``apidocs.css``. 
tristanlatr

comment created time in a day

created repositorytomverran/covid-vaccine-stats

App to show statistics about the COVID-19 vaccine rollout in the UK

created time in a day

pull request commenttwisted/pydoctor

Support for RST admonitions

Excellent work.

Happy to see the RST demo. We might talk forever about minor improvements in the demo, but I think that it's a great start and can be merged ...and later have separate PR to fix minor issues.

For reference, maybe add it to PR description

https://pydoctor--345.org.readthedocs.build/en/345/docformat/restructuredtext/restructuredtext_demo.html

I think that this is a great start. I would prefer to see the demo in a separate PR so that we can merge it without waiting for admonition support.

It looks like there is a rendering error in the purple admonition... looks like raw HTML is not supported by pydoctor.

Thanks for creating the demo!

tristanlatr

comment created time in a day

Pull request review commenttwisted/treq

Drop support for Python 2.7 and 3.5

 def getOutput(self, producer, with_producer=False):      def newLines(self, value): -        if isinstance(value, text_type):+        if isinstance(value, str):             return value.replace(u"\n", u"\r\n")

I guess that if you want to kill py2 for good, you can run https://github.com/PyCQA/modernize and have all the code updated in one go.

twm

comment created time in a day

more