[issue18109] os.uname() crashes if hostname contains non-ascii characters

2013-06-01 Thread Charles-François Natali
Charles-François Natali added the comment: To reproduce the issue, try this: # echo > /proc/sys/kernel/hostname > the locale encoding + surrogateescape error handler Sounds reasonable. -- nosy: +neologix ___ Python tracker <http://bugs.p

[issue17683] socket.getsockname() inconsistent return type with AF_UNIX

2013-06-01 Thread Charles-François Natali
Changes by Charles-François Natali : -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue17683> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18124] Broken build on target machine with incorrect hostname (non-ascii)

2013-06-03 Thread Charles-François Natali
Charles-François Natali added the comment: Why open this issue, since it's obviously a duplicate of #18109? -- nosy: +neologix ___ Python tracker <http://bugs.python.org/is

[issue18078] threading.Condition to allow notify on a specific waiter

2013-06-04 Thread Charles-François Natali
Charles-François Natali added the comment: I'm not convinced it's really useful. Furthermore, the complexity is rather bad: if T is the average number of waiting threads, an C the number of conditions being waited on, the wait is O(C) (appending to C wait queues) and wakeup is O(CT)

[issue18078] threading.Condition to allow notify on a specific waiter

2013-06-04 Thread Charles-François Natali
Charles-François Natali added the comment: > Which just means that waiting on C conditions is C times more expensive than > waiting on 1 currently is. That seems reasonable enough to me, and anyway, > I would expect C to be fairly small. Waking up a single thread (through not

[issue1611154] os.path.exists("file/") failure on Solaris 9

2013-06-14 Thread Charles-François Natali
Charles-François Natali added the comment: I don't like the idea of adding such a kludge to workaround an OS bug - especially since Solaris 9 won't be supported for too long. -- nosy: +neologix ___ Python tracker <http://bu

[issue11016] Re-implementation of the stat module in C

2013-06-20 Thread Charles-François Natali
Charles-François Natali added the comment: I still fail to understand why you just don't ditch the Python implementation. -- ___ Python tracker <http://bugs.python.org/is

[issue17914] add os.cpu_count()

2013-06-28 Thread Charles-François Natali
Changes by Charles-François Natali : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

[issue18328] Use after free in pystate.c

2013-06-30 Thread Charles-François Natali
Charles-François Natali added the comment: Well, tstate is freed, but is not used afterwards, it's just comparing the pointer against the TLS. -- nosy: +neologix ___ Python tracker <http://bugs.python.org/is

[issue18328] Use after free in pystate.c

2013-06-30 Thread Charles-François Natali
Charles-François Natali added the comment: > I think it's unsafe. The address of a pointer should not be used once the > pointer has been freed. Dereferencing a freed pointer is unsafe. A pointer is just an address, there's nothing inherently unsafe with comparing a pointer w

[issue11185] test_wait4 error on AIX

2013-07-04 Thread Charles-François Natali
Changes by Charles-François Natali : -- assignee: -> neologix ___ Python tracker <http://bugs.python.org/issue11185> ___ ___ Python-bugs-list mailing list Un

[issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures)

2013-07-06 Thread Charles-François Natali
Charles-François Natali added the comment: > I think the safest solution is not to compare scope_id when comparing > addresses. Agreed. However, it might be simpler to special-case the IPv6 addresses comparison by overriding it in the IPv6 sendmsg base test. Could you try the patch at

[issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures)

2013-07-09 Thread Charles-François Natali
Charles-François Natali added the comment: Fixed, thanks! -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

[issue18418] Thread.isAlive() sometimes True after fork

2013-07-12 Thread Charles-François Natali
Charles-François Natali added the comment: This is just a special-case of the more general problem of forking() in a multi-threaded program (see #16500 and #6721). Since fork() can occur at any time, even though your data structures are protected by locks, they can end up in an inconsistent

[issue18418] Thread.isAlive() sometimes True after fork

2013-07-15 Thread Charles-François Natali
Charles-François Natali added the comment: > If you want a consistent reproducible test case for this I believe you will > need to replace the Thread object's __started with a test wrapper who's set() > method blocks waiting for for the fork to have happened before doin

[issue18408] Fixes crashes found by pyfailmalloc

2013-07-17 Thread Charles-François Natali
Charles-François Natali added the comment: Victor, how about adding pyfailmalloc to the main repo (maybe under Tools), with a script making it easy to run the tests suite with it enabled? This way, it'll make it easier to run it from time to time (one could eve imagine making it part o

[issue18418] Thread.isAlive() sometimes True after fork

2013-07-25 Thread Charles-François Natali
Charles-François Natali added the comment: > Bump. Did you see my review at http://bugs.python.org/review/18418/#ps8668 ? -- ___ Python tracker <http://bugs.python.org/issu

[issue18596] enable usage of AddressSanitizer in CPython [PATCH]

2013-07-30 Thread Charles-François Natali
Charles-François Natali added the comment: The warning is due to the Py_ADDRESS_IN_RANGE() macro: it's a know limitation, we have the same problem with valgrind. This would be a nice neature. It would IMO be even nicer to have an ASAN-enabled buildbot. -- nosy: +neo

[issue10496] Python startup should not require passwd entry

2013-07-31 Thread Charles-François Natali
Charles-François Natali added the comment: Is there a hope to get this fixed? It can be needed to e.g. run python as nobody user (used for example for CGI scripts, etc). -- ___ Python tracker <http://bugs.python.org/issue10

[issue16945] rewrite CGIHTTPRequestHandler to always use subprocess

2013-08-01 Thread Charles-François Natali
Charles-François Natali added the comment: Marking #10496 as a dependency (since it could prevent Python from running with low level privileges). -- dependencies: +Python startup should not require passwd entry ___ Python tracker <h

[issue18418] Thread.isAlive() sometimes True after fork

2013-08-02 Thread Charles-François Natali
Charles-François Natali added the comment: I've posted another review (not sure you receive notifications). -- ___ Python tracker <http://bugs.python.org/is

[issue10496] Python startup should not require passwd entry

2013-08-02 Thread Charles-François Natali
Changes by Charles-François Natali : -- keywords: +needs review ___ Python tracker <http://bugs.python.org/issue10496> ___ ___ Python-bugs-list mailing list Unsub

[issue1611154] os.path.exists("file/") failure on Solaris 9

2013-08-02 Thread Charles-François Natali
Changes by Charles-François Natali : -- status: open -> pending ___ Python tracker <http://bugs.python.org/issue1611154> ___ ___ Python-bugs-list mai

[issue17070] PEP 433: Use the new cloexec to improve security and avoid bugs

2013-08-02 Thread Charles-François Natali
Charles-François Natali added the comment: Time to close this one, since the PEP has been superseeded by PEP 446? -- ___ Python tracker <http://bugs.python.org/issue17

[issue11757] test_subprocess.test_communicate_timeout_large_ouput failure on select(): negative timeout?

2013-08-02 Thread Charles-François Natali
Changes by Charles-François Natali : -- status: pending -> closed ___ Python tracker <http://bugs.python.org/issue11757> ___ ___ Python-bugs-list mai

[issue12999] _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED usage on Solaris

2013-08-02 Thread Charles-François Natali
Charles-François Natali added the comment: OK, let's close then. We can still re-open if this pops up again. -- status: pending -> closed ___ Python tracker <http://bugs.python.org

[issue10897] UNIX mmap unnecessarily dup() file descriptor

2013-08-02 Thread Charles-François Natali
Charles-François Natali added the comment: I changed my mind, and think we should keep the current behavior: it guarantees resize() won't break, and doesn't cost much. One extra FD per mmap is not a huge hit. If that's a problem, then the user can raise th

[issue12588] test_capi.test_subinterps() failed on OpenBSD (powerpc)

2013-08-02 Thread Charles-François Natali
Changes by Charles-François Natali : -- status: open -> pending ___ Python tracker <http://bugs.python.org/issue12588> ___ ___ Python-bugs-list mailing list Un

[issue16038] ftplib: unlimited readline() from connection

2013-08-02 Thread Charles-François Natali
Charles-François Natali added the comment: So, what now? -- ___ Python tracker <http://bugs.python.org/issue16038> ___ ___ Python-bugs-list mailing list Unsub

[issue18325] test_kqueue fails in OpenBSD

2013-08-02 Thread Charles-François Natali
Charles-François Natali added the comment: Should be fixed now. Thanks for the report, and sorry for the delay! -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

[issue16635] Interpreter not closing stdout/stderr on exit

2013-08-02 Thread Charles-François Natali
Changes by Charles-François Natali : -- resolution: -> rejected stage: -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

[issue16853] add a Selector to the select module

2013-08-02 Thread Charles-François Natali
Charles-François Natali added the comment: Here's a patch, based on the version in tulip's repo. I've added doc update and tests. I also made the following changes: - BaseSelector is an abstract base class (so one could imagine user code implementing its own select

[issue16853] add a Selector to the select module

2013-08-02 Thread Charles-François Natali
Charles-François Natali added the comment: Version addressing Antoine and Christian's comments. -- Added file: http://bugs.python.org/file31133/selector-12.diff ___ Python tracker <http://bugs.python.org/is

[issue16853] add a Selector to the select module

2013-08-03 Thread Charles-François Natali
Charles-François Natali added the comment: > Guido van Rossum added the comment: > Can you try again with the failing assert replaced with this? > > self.assertTrue(0.018 <= t2-t0 <= 0.028, t2-t0) > > That should be a better way to check that code works. I'm

[issue10897] UNIX mmap unnecessarily dup() file descriptor

2013-08-03 Thread Charles-François Natali
Charles-François Natali added the comment: > This can only be raised (above the hard limit) by a privileged > process, so I would be out of luck there, as I could not convince > my sysadmins to raise this further. We all know that feeling :-) > Meanwhile, I will just use my own mod

[issue16463] testConnectTimeout of test_timeout TCPTimeoutTestCasefailures fails intermittently

2013-08-03 Thread Charles-François Natali
Charles-François Natali added the comment: The problem is that the test passes a DNS address to connect(), which means that it has to perform a name resolution first. And since there's not timeout on gethostbyname()/getaddrinfo() you can end up well above the timeout. The hostnames shou

[issue16463] testConnectTimeout of test_timeout TCPTimeoutTestCasefailures fails intermittently

2013-08-03 Thread Charles-François Natali
Charles-François Natali added the comment: And here's a patch. -- keywords: +patch Added file: http://bugs.python.org/file31137/connect_timeout.diff ___ Python tracker <http://bugs.python.org/issue16463>

[issue18643] implement socketpair() on Windows

2013-08-03 Thread Charles-François Natali
New submission from Charles-François Natali: socketpair() is quite useful, notably for tests. Currently, it's not defined on Windows. Since it's rather easy to implement, it would be nice to have it, if not in the stdlib, at least in test.support. -- components: Library (Lib

[issue15233] atexit: guarantee order of execution of registered functions?

2013-08-03 Thread Charles-François Natali
Charles-François Natali added the comment: Unless anyone objects, I'll backport it soonish. -- stage: -> commit review ___ Python tracker <http://bugs.python.org

[issue12015] possible characters in temporary file name is too few

2013-08-03 Thread Charles-François Natali
Changes by Charles-François Natali : -- keywords: +easy, needs review stage: -> patch review type: -> enhancement versions: +Python 3.4 -Python 3.3 ___ Python tracker <http://bugs.python.org/i

[issue18296] test_os.test_trailers() is failing on AMD64 FreeBSD 9.0 dtrace 3.x

2013-08-03 Thread Charles-François Natali
Charles-François Natali added the comment: The test shouldn't pass 4096 as nbytes: apparently, recent FreeBSD kernels zero-fill. -- nosy: +neologix ___ Python tracker <http://bugs.python.org/is

[issue17684] Skip tests in test_socket like testFDPassSeparate on OS X

2013-08-04 Thread Charles-François Natali
Charles-François Natali added the comment: > Charles-Francois: why did you commit this to default only, and not > to 3.3? I overlooked it (apparently, the issue was tagged 3.4 only, and I didn't double-check that the code was present in 3.3 as well). Should be better now!

[issue18078] threading.Condition to allow notify on a specific waiter

2013-08-04 Thread Charles-François Natali
Charles-François Natali added the comment: > FWIW, I don't support adding this functionality. I don't see precedents for > Condition Variables behaving this way in other languages. Also, I don't > think it is worth the added complexity, learning curve, and maintena

[issue18720] Switch suitable constants in the socket module to IntEnum

2013-08-16 Thread Charles-François Natali
Charles-François Natali added the comment: I've just had a quick look at the patch, but from what I can see, socket.getaddrinfo() will return a raw integer for the family, and not an AddressFamily instance. That's unfortunate. -- ___ Pyth

[issue18643] implement socketpair() on Windows

2013-08-16 Thread Charles-François Natali
Charles-François Natali added the comment: I was thinking about dropping the C wrapper from socketmodule.c, and replacing it with a pure Python implementation (e.g. the one posted by Richard on python-dev). What do you think? -- ___ Python tracker

[issue16463] testConnectTimeout of test_timeout TCPTimeoutTestCasefailures fails intermittently

2013-08-16 Thread Charles-François Natali
Charles-François Natali added the comment: Here's an updated patch using the lru_cache decorator. -- Added file: http://bugs.python.org/file31312/connect_timeout-1.diff ___ Python tracker <http://bugs.python.org/is

[issue18748] libgcc_s.so.1 must be installed for pthread_cancel to work

2013-08-16 Thread Charles-François Natali
Charles-François Natali added the comment: Unfortunately, there's not much we can do about it: if dlsym() fails - which is the case here either because read() fails with EBADF, or because the file descriptor now points to another stream (i.e. not libgcc), the libc aborts (here

[issue18748] libgcc_s.so.1 must be installed for pthread_cancel to work

2013-08-16 Thread Charles-François Natali
Charles-François Natali added the comment: > Perhaps the only thing we could do would be try to "preload" libgcc by > calling one of those APIs at startup? Yeah, I was thinking about doing this in PyThread_init_thread() but... > But I'm not sure it's a good

[issue18756] os.urandom() fails under high load

2013-08-16 Thread Charles-François Natali
Charles-François Natali added the comment: >> If os.urandom() doesn't fail, something else will fail soon after. > > the random pool can be exhausted, but this is not "soon after" I think. In > Linux and Mac OS X, ulimit -n defaults to 512 and 256. I don't

[issue18756] os.urandom() fails under high load

2013-08-16 Thread Charles-François Natali
Charles-François Natali added the comment: 2013/8/16, Tarek Ziadé : > I use greenlets. But, I don't know - are you suggesting os.urandom() should > be marked in the documentation as "DOES NOT SCALE" and I should use another > API ? Which one ? Well, even with greenlets,

[issue18756] os.urandom() fails under high load

2013-08-16 Thread Charles-François Natali
Charles-François Natali added the comment: > I do many calls on urandom() so that's the FD bottleneck. > >> So os.urandom() isn't your biggest problem here. > > Of course it is. But it looks like you know better without having looked at > the code. :) So please

[issue18756] os.urandom() fails under high load

2013-08-16 Thread Charles-François Natali
Charles-François Natali added the comment: >> Why locking? /dev/urandom is a pseudo char device. You can have multiple >> readers on the same fd without any locking. > > You must put a lock around the open() call, though, to avoid calling it > several times and losing an fd.

[issue18756] os.urandom() fails under high load

2013-08-16 Thread Charles-François Natali
Charles-François Natali added the comment: > In the light of the recent Android issue with PRNGs [1] I don't think > that Python should roll out its own CPRNG. I'd rather use the operation > system's CPRNG or OpenSSL's CPRNG. After all we aren't crypto expert

[issue18756] os.urandom() fails under high load

2013-08-16 Thread Charles-François Natali
Charles-François Natali added the comment: > Attaching a patch to make error reporting better. Why didn't you include ENODEV? Apparently it can be reported in some corner cases, e.g. in this patch: http://lfs-matrix.net/patches/downloads/linux/linux-2.6.14.2-pseudo_random-1.patch O

[issue16463] testConnectTimeout of test_timeout TCPTimeoutTestCasefailures fails intermittently

2013-08-16 Thread Charles-François Natali
Changes by Charles-François Natali : Added file: http://bugs.python.org/file31320/connect_timeout-2.diff ___ Python tracker <http://bugs.python.org/issue16463> ___ ___

[issue18756] os.urandom() fails under high load

2013-08-16 Thread Charles-François Natali
Charles-François Natali added the comment: > Updated error handling patch testing for ENODEV. LGTM, you can apply to 2.7 and 3.x (I just hope all those errnos are available on every POSIX platform ;-). -- ___ Python tracker <http://bugs.pyth

[issue18720] Switch suitable constants in the socket module to IntEnum

2013-08-16 Thread Charles-François Natali
Charles-François Natali added the comment: > The attached patch fixes it in a similar vein to what was done for the > family accessor: getaddrinfo is overridden in Python and does the necessary > conversion. Am I the only one thinking that wrapping every C function with a Python count

[issue18763] subprocess: file descriptors should be closed after preexec_fn is called

2013-08-16 Thread Charles-François Natali
New submission from Charles-François Natali: Currently, when passed close_fds=True, the subprocess module closes FDs before calling preexec_fn (if provided). This can be an issue if preexec_fn opens some file descriptors, which would then be inherited in the child process. Here's a patch

[issue16463] testConnectTimeout of test_timeout TCPTimeoutTestCasefailures fails intermittently

2013-08-16 Thread Charles-François Natali
Charles-François Natali added the comment: Should be fixed now! -- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

[issue18747] Re-seed OpenSSL's PRNG after fork

2013-08-17 Thread Charles-François Natali
Charles-François Natali added the comment: 2013/8/17 Christian Heimes : > Here is a patch that is based on Apache's mod_ssl code. mod_ssl perturbs the > PRNG state more often but I think that's overkill for Python. > > The new patch only affects the PRNG state of th

[issue18763] subprocess: file descriptors should be closed after preexec_fn is called

2013-08-17 Thread Charles-François Natali
Charles-François Natali added the comment: With patch :) -- Added file: http://bugs.python.org/file31342/subprocess_close.diff ___ Python tracker <http://bugs.python.org/issue18763> ___diff -r 5d4fe1da2c

[issue18748] libgcc_s.so.1 must be installed for pthread_cancel to work

2013-08-18 Thread Charles-François Natali
Charles-François Natali added the comment: > On Linux, you can try to set the LD_PRELOAD environment variable as a > workaround. > > LD_PRELOAD=libgcc_s.so.1 python bug.py > > You may need to specify the full path. I don't think that'll work. Despite its name, usi

[issue18418] Thread.isAlive() sometimes True after fork

2013-08-18 Thread Charles-François Natali
Changes by Charles-François Natali : -- stage: -> patch review ___ Python tracker <http://bugs.python.org/issue18418> ___ ___ Python-bugs-list mailing list Un

[issue18794] select.devpoll objects have no close() method

2013-08-21 Thread Charles-François Natali
Charles-François Natali added the comment: Just to be explicit (there are typos in Victor's original messages): it's about select.devpoll, for Solaris-derivatives with /dev/poll, and not for select.poll, based on poll() syscall. --

[issue16853] add a Selector to the select module

2013-08-21 Thread Charles-François Natali
Charles-François Natali added the comment: > I've lost track -- who is waiting for whom? I reviewed the patch > selector-12.diff and received zero response AFAICT. (Maybe the email from > Rietveld didn't make it?) I was on vacation, and then had to cope with many emails

[issue18792] test_ftplib timeouts

2013-08-21 Thread Charles-François Natali
Charles-François Natali added the comment: > Some ftplib tests sometimes time out. Seem they seem to try to connect to > "localhost" (rather than "127.0.0.1"), I was wondering if this could be a DNS > issue and if we should resolve "localhost" in advanc

[issue18792] test_ftplib timeouts

2013-08-21 Thread Charles-François Natali
Charles-François Natali added the comment: Changing support.HOST from 'localhost' to '127.0.0.1' means that on dual-stack hosts (I don't think the test suite would run on IPv6-only hosts anyway), the tests will now always use IPv4, whereas they are currently using eith

[issue18792] test_ftplib timeouts

2013-08-21 Thread Charles-François Natali
Charles-François Natali added the comment: > That would only be true if the server we are contacting happens to > listen on both IPv6 and IPv4, right? I don't think we have such a > situation in the test suite. Ah, I thought some code was using getaddrinfo() to select an

[issue18747] Re-seed OpenSSL's PRNG after fork

2013-08-21 Thread Charles-François Natali
Charles-François Natali added the comment: > Christian Heimes added the comment: > > I have taken care of Antoine's and Victor's reviews. The fix has landed in > Python 2.7, 3.3 and 3.4. What about 2.6, 3.1 and 3.2? After all it's a > security fix (although I

[issue18747] Re-seed OpenSSL's PRNG after fork

2013-08-21 Thread Charles-François Natali
Charles-François Natali added the comment: > Which part of the function is not async-signal safe? It doesn't interact > with any file descriptors nor does it use any syscalls except for > getpid() and time(). gettimeofday() and RAND_add() The functions which are guaranteed to b

[issue18747] Re-seed OpenSSL's PRNG after fork

2013-08-21 Thread Charles-François Natali
Charles-François Natali added the comment: 2013/8/21 Antoine Pitrou : > Instead of reseeding in the child, you can perturb the state in the parent > after fork. > As far as I understand, only the "child" callback in pthread_atfork() needs > to be async-signal-safe: That

[issue18747] Re-seed OpenSSL's PRNG after fork

2013-08-21 Thread Charles-François Natali
Charles-François Natali added the comment: >> Another, probably cleaner way would be to finally add the atfork() >> module (issue #16500), and register this reseed hook (which could then >> be implemented in ssl.py). > > Wouldn't that still suffer from the doub

[issue15233] atexit: guarantee order of execution of registered functions?

2013-08-21 Thread Charles-François Natali
Charles-François Natali added the comment: Backported to 2.7. -- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed versions: -Python 3.2 ___ Python tracker <http://bugs.python.or

[issue18792] test_ftplib timeouts

2013-08-21 Thread Charles-François Natali
Charles-François Natali added the comment: LGTM -- ___ Python tracker <http://bugs.python.org/issue18792> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18763] subprocess: file descriptors should be closed after preexec_fn is called

2013-08-21 Thread Charles-François Natali
Changes by Charles-François Natali : -- nosy: +sbt ___ Python tracker <http://bugs.python.org/issue18763> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue6923] Need pthread_atfork-like functionality in CPython

2013-08-21 Thread Charles-François Natali
Changes by Charles-François Natali : -- resolution: -> duplicate stage: needs patch -> committed/rejected status: open -> closed superseder: -> Add an 'atfork' module ___ Python tracker <http://

[issue12641] Remove -mno-cygwin from distutils

2013-08-21 Thread Charles-François Natali
Changes by Charles-François Natali : -- title: Test -> Remove -mno-cygwin from distutils ___ Python tracker <http://bugs.python.org/issue12641> ___ ___ Python-

[issue18806] socketmodule: fix/improve setipaddr() numeric addresses handling

2013-08-21 Thread Charles-François Natali
New submission from Charles-François Natali: Currently, setipaddr() has this code to special-case numeric IPv4 addresses and avoid a name resolution: """ if (sscanf(name, "%d.%d.%d.%d%c", &d1, &d2, &d3, &d4, &ch) == 4 && 0 &l

[issue18806] socketmodule: fix/improve setipaddr() numeric addresses handling

2013-08-22 Thread Charles-François Natali
Charles-François Natali added the comment: Hum... Apparently, before this bug was fixed, glibc's getaddrinfo() would retrieve the list of interfaces at every call, even if AI_ADDRCONFIG was not set: http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=fa3fc0fe5f452d0aa7e435d8f32e9929586

[issue18806] socketmodule: fix/improve setipaddr() numeric addresses handling

2013-08-22 Thread Charles-François Natali
Charles-François Natali added the comment: > So it might be better to just use inet_pton() instead. But then it won't set the scope ID if the user doesn't provide it... -- ___ Python tracker <http://bugs.pytho

[issue18747] Re-seed OpenSSL's PRNG after fork

2013-08-22 Thread Charles-François Natali
Charles-François Natali added the comment: > STINNER Victor added the comment: > > PySSL_RAND_atfork_parent() still uses getpid(). This number is not > very random in the *parent* process :-) :-) IMO this patch has been rushed in and should be reverted for now. It's still not

[issue18747] Re-seed OpenSSL's PRNG after fork

2013-08-22 Thread Charles-François Natali
Charles-François Natali added the comment: >> PySSL_RAND_atfork_parent() still uses getpid(). This number is not >> very random in the *parent* process :-) > > That's fine and doesn't diminish the properties of the PRNG. In fact the > patch could use a hard coded

[issue18811] add ssl-based generator to random module

2013-08-22 Thread Charles-François Natali
New submission from Charles-François Natali: Now that the ssl module exposes RAND_bytes() (issue #12049), it might be interesting to implement a SSLRandom generator to the random module, to have a cryptographically strong generator without the os.urandom() overhead. Thoughts

[issue18811] add ssl-based generator to random module

2013-08-22 Thread Charles-François Natali
Charles-François Natali added the comment: > It doesn't look like OpenSSL's PRNG is much faster than /dev/urandom if > Python keeps a persistent fd: > > $ python3.3 prng.py > loops: 100 > bytes: 16 > /dev/urandom (fd)1.2181 > os.urandom()

[issue18763] subprocess: file descriptors should be closed after preexec_fn is called

2013-08-22 Thread Charles-François Natali
Charles-François Natali added the comment: > Using self.assertLessEqual() would provide better message on error. Done. > You don't want to fix Python 2.7 and 3.3? It is a bug in my opinion. Patch for 2.7 attached (without test though, because 2.7 lacks a fd_status.py helper, which

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-08-22 Thread Charles-François Natali
Charles-François Natali added the comment: Could you post your patch without the '--git' option? Apparently it doesn't work well with the code review tool. > It would be nice if there was a more explicit way to test the > creation of core files, however. One possibility

[issue18816] "mmap.flush()" is always synchronous, hurting performance

2013-08-23 Thread Charles-François Natali
Charles-François Natali added the comment: > I propose to add an optional keyword parameter with default value "SYNC" > (compatibility) but that can be "ASYNC", "INVALIDATE" (can be > "SYNC|INVALIDATE" and "ASYNC|INVALIDATE" too). AF

[issue18811] add ssl-based generator to random module

2013-08-23 Thread Charles-François Natali
Charles-François Natali added the comment: > How about we generalize SystemRandom so users can implement > a custom RNG class wby providing a method rng(amount) -> bytes? The random module already makes it easy: """ Class Random can also be subclassed if you want

[issue18763] subprocess: file descriptors should be closed after preexec_fn is called

2013-08-23 Thread Charles-François Natali
Charles-François Natali added the comment: Here's a patch with a more robust test: the previous test worked, but assume that only stdin, stdout and stderr FDs would be open in the child process. This might not hold anymore in a near future (/dev/urandom persistent FD). The new test is

[issue18763] subprocess: file descriptors should be closed after preexec_fn is called

2013-08-23 Thread Charles-François Natali
Charles-François Natali added the comment: > I don't understand why os.dup2() is more reliable than os.pipe() for a unit > test? I use dup2() because it allows me to specify a target FD, so the parent can know precisely which FD was opened by the preexec hook, and check it's clo

[issue18763] subprocess: file descriptors should be closed after preexec_fn is called

2013-08-23 Thread Charles-François Natali
Charles-François Natali added the comment: > You might also add a check: > > self.assertLessEqual(remaining_fds, {0, 1, 2}) Well no, because the interpreter might have other FDs open than stdin, stdout and stderr. -- ___ Pytho

[issue18763] subprocess: file descriptors should be closed after preexec_fn is called

2013-08-23 Thread Charles-François Natali
Charles-François Natali added the comment: > Close_fds is not supposed to close them? Yes, but some new fds might be open in the child process, e.g. for /dev/urandom. That's why it's better to check that this precise FD is closed. Of course, if the /dev/urandom FD gets assigned t

[issue18643] implement socketpair() on Windows

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: Here's a patch. Note that I'm still not sure whether it belong to the socket module or test.support. -- keywords: +needs review, patch stage: needs patch -> patch review versions: +Python 3.4 Added file: http://bugs.python.

[issue18643] implement socketpair() on Windows

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: > On Linux, many tests of test_socket are failing with the pure Python > implementation. The only failing tests I see are due to the fact that the Python implementation uses AF_INET instead of AF_UNIX, which is normal since Windows doesn't h

[issue16853] add a Selector to the select module

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: Alright, I've updated the patch to have a distinct selectors module, and with Guido's comments. Before I post it for final review, I have three more questions: 1) In the documentation, I don't know how to best refer to files object regis

[issue18756] os.urandom() fails under high load

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: > New changeset fe949918616c by Antoine Pitrou in branch 'default': > Issue #18756: Improve error reporting in os.urandom() when the failure is due > to something else than /dev/urandom not existing. > http://hg.python.org/cp

[issue18756] os.urandom() fails under high load

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: Or more precisely, just run the test in a subprocess. That should fix the OS X failure if we don't restore the RLIMIT_NOFILE limits, and will make the test more robust (but you can't reuse the new test, since it won't work wi

[issue16853] add a Selector to the select module

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: > Didn't you forget to upload it? I wanted to have answer to my questions first :-): > Before I post it for final review, I have three more questions: -- ___ Python tracker <http://b

[issue18643] implement socketpair() on Windows

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: > self.assertEqual(sock.family, socket.AF_UNIX) > AssertionError: 2 != 1 This is normal. == > FAIL: test_sendall_interrupted (test.test_socket.GeneralMo

[issue18709] SSL module fails to handle NULL bytes inside subjectAltNames general names (CVE-2013-4238)

2013-08-25 Thread Charles-François Natali
Charles-François Natali added the comment: The test is failing on Tiger buildbots: """ == FAIL: test_parse_cert_CVE_2013_4238 (test.test_ssl.B

<    8   9   10   11   12   13   14   15   16   17   >