[issue16487] Allow ssl certificates to be specified from memory rather than files.

2017-11-30 Thread Martin Richard
Martin Richard added the comment: FWIW, PyOpenSSL allows to load certificates and keys from a memory buffer and much more. It's also fairly easy to switch from ssl to PyOpenSSL. It's probably a viable alternative in many cases. --

[issue28287] Refactor subprocess.Popen to let a subclass handle IO asynchronously

2017-08-25 Thread Martin Richard
Martin Richard added the comment: Yes, the goal is to isolate the blocking IO in __init__ into other methods so Popen can be subclassed in asyncio. The end goal is to ensure that when asyncio calls Popen(), it doesn't block the process. In the context of asyncio, there's no need to

[issue28782] SEGFAULT when running a given coroutine

2016-11-25 Thread Martin Richard
Martin Richard added the comment: Thank you all for fixing this so quickly, it's been done amazingly fast! -- ___ Python tracker <http://bugs.python.org/is

[issue28782] SEGFAULT when running a given coroutine

2016-11-23 Thread Martin Richard
New submission from Martin Richard: Hi, I stumbled upon a SEGFAULT while trying Python 3.6.0 on a project using asyncio. I can't really figure out what's happening, so I reduced the original code triggering the bug down to a reproducible case (which looks a bit clunky, sorry). The cas

[issue28287] Refactor subprocess.Popen to let a subclass handle IO asynchronously

2016-09-27 Thread Martin Richard
New submission from Martin Richard: Hi, Currently, subprocess.Popen performs blocking IO in its constructor (at least on Unix): it reads on a pipe in order to detect outcome of the pre-exec and exec phase in the new child. There is no way yet to modify this behavior as this blocking call is

[issue24763] asyncio.BaseSubprocessTransport triggers an unavoidable ResourceWarning if process doesn't start

2015-07-31 Thread Martin Richard
New submission from Martin Richard: An exception can be raised in SubprocessTransport.__init__() from SubprocessTransport._start() - for instance because an exception is raised in the preexec_fn callback. In this case, the calling function never gets a reference to the transport object, and

[issue16487] Allow ssl certificates to be specified from memory rather than files.

2015-07-10 Thread Martin Richard
Martin Richard added the comment: I'm not sure I know how to do this correctly: I lack of experience both with openssl C API and writing python modules in C. It may be more flexible, but unless the key is protected/crypted somehow, one would need a string or bytes buffer to hold the key

[issue16487] Allow ssl certificates to be specified from memory rather than files.

2015-07-09 Thread Martin Richard
Martin Richard added the comment: You are right. And if certfile and keyfile (args of load_cert_chain()) accept file-like objects, we agree that cafile (load_verify_location()) should accept them too? -- ___ Python tracker <http://bugs.python.

[issue16487] Allow ssl certificates to be specified from memory rather than files.

2015-07-09 Thread Martin Richard
Martin Richard added the comment: Hi, I would like to update this patch so it can finally land in cpython, hopefully 3.6. tl;dr of the thread: In a nutshell, the latest patch from Kristján Valur Jónsson updates SSLContext.load_cert_chain(certfile, keyfile=None, password=None) and

[issue21998] asyncio: support fork

2015-05-26 Thread Martin Richard
Martin Richard added the comment: 015-05-26 20:40 GMT+02:00 Yury Selivanov : > > Yury Selivanov added the comment: > The only solution to safely fork a process is to fix loop.close() to > check if it's called from a forked process and to close the loop in > a safe way (t

[issue21998] asyncio: support fork

2015-05-26 Thread Martin Richard
Martin Richard added the comment: Hi, My patch was a variation of haypo's patch. The goal was to duplicate the loop and its internal objects (loop and self pipes) without changing much to its state from the outside (keeping callbacks and active tasks). I wanted to be conservative with

[issue23540] Proposal for asyncio: SubprocessTransport.detach() to detach a process from a transport

2015-02-27 Thread Martin Richard
New submission from Martin Richard: I would like to add a detach() method to base_suprocess.BaseSuprocessTransport, which would release the underlying Popen object to the user, pretty much like socket.detach() detaches a socket object and returns the fd. The rationale is the following: the

[issue23537] BaseSubprocessTransport includes two unused methods

2015-02-27 Thread Martin Richard
New submission from Martin Richard: base_subprocess.BaseSuprocessTransport implements _make_write_subprocess_pipe_proto and _make_read_subprocess_pipe_proto. Both are private and both raise NotImplementedError. However, when I grep in tulip sources for those methods, they are never called nor

[issue21998] asyncio: support fork

2015-02-17 Thread Martin Richard
Martin Richard added the comment: The goal of the patch is to create a duplicate selector (a new epoll() structure with the same watched fds as the original epoll). It allows to remove fds watched in the child's loop without impacting the parent process. Actually, it's true tha

[issue21998] asyncio: support fork

2015-02-17 Thread Martin Richard
Martin Richard added the comment: In that case, I suggest a small addition to your patch that would do the trick: in unix_events.py: +def _at_fork(self): +super()._at_fork() +self._selector._at_fork() +self._close_self_pipe() +self._make_self_pipe

[issue21998] asyncio: support fork

2015-02-17 Thread Martin Richard
Martin Richard added the comment: I read the patch, it looks good to me for python 3.5. It will (obviously) not work with python 3.4 since self._selector won't have an _at_fork() method. I ran the tests on my project with python 3.5a1 and the patch, it seems to work as expected: ie. w

[issue17911] traceback: add a new thin class storing a traceback without storing local variables

2015-01-26 Thread Martin Richard
Changes by Martin Richard : -- nosy: +martius ___ Python tracker <http://bugs.python.org/issue17911> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23209] asyncio: break some cycles

2015-01-12 Thread Martin Richard
Martin Richard added the comment: I updated the selector patch so BaseSelector.get_key() raises KeyError if the mapping is None. All the (non skipped) tests in test_selectors.py passed. Anyway, if there is an other problem with freeing the mapping object (I don't know, maybe "re

[issue23209] asyncio: break some cycles

2015-01-09 Thread Martin Richard
Changes by Martin Richard : -- components: +asyncio nosy: +gvanrossum, haypo, yselivanov type: -> performance versions: +Python 3.4 ___ Python tracker <http://bugs.python.org/issu

[issue23209] asyncio: break some cycles

2015-01-09 Thread Martin Richard
New submission from Martin Richard: Hi, I would like to submit 3 trivial modifications which break a cycle each. It is not much, but those three cycles caused a lot of objects to be garbage collected. They can now be freed using the reference counting mechanism, and therefore, reduce the

[issue21998] asyncio: a new self-pipe should be created in the child process after fork

2014-12-08 Thread Martin Richard
Martin Richard added the comment: Currently, this is what I do in the child after the fork: >>> selector = loop._selector >>> parent_class = selector.__class__.__bases__[0] >>> selector.unregister = lambda fd: parent_class.unregister(selector, fd)

[issue21998] asyncio: a new self-pipe should be created in the child process after fork

2014-12-01 Thread Martin Richard
Martin Richard added the comment: I said something wrong in my previous comment: removing and re-adding the reader callback right after the fork() is obviously subject to a race condition. I'll go for the monkey patching. -- ___ Python tr

[issue21998] asyncio: a new self-pipe should be created in the child process after fork

2014-12-01 Thread Martin Richard
Martin Richard added the comment: Guido, Currently in my program, I manually remove and then re-adds the reader to the loop in the parent process right after the fork(). I also considered a dirty monkey-patching of remove_reader() and remove_writer() which would act as the original versions

[issue21998] asyncio: a new self-pipe should be created in the child process after fork

2014-11-28 Thread Martin Richard
Martin Richard added the comment: Hi, Actually, closing and creating a new loop in the child doesn't work either, at least on Linux. When, in the child, we call loop.close(), it performs: self.remove_reader(self._ssock) (in selector_events.py, _close_self_pipe() around line 85) Bot

[issue22638] ssl module: the SSLv3 protocol is vulnerable ("POODLE" attack)

2014-10-15 Thread Martin Richard
Changes by Martin Richard : -- nosy: +martius ___ Python tracker <http://bugs.python.org/issue22638> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22348] Documentation of asyncio.StreamWriter.drain()

2014-09-12 Thread Martin Richard
Martin Richard added the comment: Here is an other patch which mentions high and low water limits. I think it's better to talk about it, since it tells extactly what a "full buffer" and "partially drained" means. On the other hand, StreamWriter wraps the transport but

[issue22348] Documentation of asyncio.StreamWriter.drain()

2014-09-06 Thread Martin Richard
Changes by Martin Richard : -- hgrepos: -273 ___ Python tracker <http://bugs.python.org/issue22348> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22348] Documentation of asyncio.StreamWriter.drain()

2014-09-06 Thread Martin Richard
New submission from Martin Richard: Hi, Following the discussion on the python-tulip group, I'd like to propose a patch for the documentation of StreamWriter.drain(). This patch aims to give a better description of what drain() is intended to do, and when to use it. In particula