Re: [Python-Dev] PEP 433: Choose the default value of the new cloexec parameter

2013-01-29 Thread Victor Stinner
> Library code should not be relying on globals settings that can change. Did you try my implementation of the PEP 433 on your project? Did you review my patch implementing the PEP 433? http://hg.python.org/features/pep-433 http://bugs.python.org/issue17036 I expected more change, whereas only ve

[Python-Dev] PEP 433: second try

2013-01-29 Thread Victor Stinner
-Modified: $Date$ Author: Victor Stinner Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 10-January-2013 Python-Version: 3.4 Abstract Add a new optional *cloexec* parameter on functions creating file descriptors, add different ways to change default values of this

Re: [Python-Dev] PEP 433: second try

2013-01-30 Thread Victor Stinner
2013/1/30 Larry Hastings : > Here is a new version of my PEP 433. > [...] > * ``os.get_cloexec(fd)`` > * ``os.set_cloexec(fd, cloexec=True)`` > * ``sys.getdefaultcloexec()`` > * ``sys.setdefaultcloexec(cloexec=True)`` > > Passing no judgment on the PEP otherwise, just a single observation: the

Re: [Python-Dev] PEP 433: second try

2013-01-30 Thread Victor Stinner
> Disable inheritance by default > (...) > * It violates the principle of least surprise. Developers using the > os module may expect that Python respects the POSIX standard and so > that close-on-exec flag is not set by default. Oh, I just saw that Perl is "violating POSIX" since Perl 1: clo

Re: [Python-Dev] Fwd: I was just thinking that os.path could use some love...

2013-01-30 Thread Victor Stinner
> Thoughts on os.path? What happened to the idea of a new path object? I don't know if it's related, but there are two new interesting projects: pathlib and walkdir. http://pypi.python.org/pypi/pathlib https://pathlib.readthedocs.org/en/latest/ http://pypi.python.org/pypi/walkdir http://walkdir.

[Python-Dev] Release or not release the GIL

2013-01-31 Thread Victor Stinner
Hi, While working on the implementation of the PEP 433, I saw different places where Python asks for operating resources without releasing the GIL. In my implementation, I released the GIL in the following places. Is it correct? - os.dup() - os.dup2() - os.pipe() - socket.socketpair() os.listdi

Re: [Python-Dev] Release or not release the GIL

2013-02-01 Thread Victor Stinner
> dup2(oldfd, newfd) closes oldfd. No, it doesn't close oldfd. It may close newfd if it was already open. Victor ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/m

Re: [Python-Dev] Usage of += on strings in loops in stdlib

2013-02-13 Thread Victor Stinner
I added a _PyUnicodeWriter internal API to optimize str%args and str.format(args). It uses a buffer which is overallocated, so it's basically like CPython str += str optimization. I still don't know how efficient it is on Windows, since realloc() is slow on Windows (at least on old Windows versions

Re: [Python-Dev] Usage of += on strings in loops in stdlib

2013-02-13 Thread Victor Stinner
38.9 ms: UnicodeWriter +=; preallocate 39 ms: "".join(list) 39.1 ms: io.StringIO; lookup attr once 39.4 ms: UnicodeWriter append; lookup attr once 39.5 ms: io.StringIO 39.6 ms: UnicodeWriter += 40.1 ms: str += str 40.1 ms: UnicodeWriter append Victor 2013/2/13 Antoine Pitrou : > L

[Python-Dev] Status of the PEP 433?

2013-02-14 Thread Victor Stinner
Hi, I read again all emails related to PEP 433. There are different opposition to this change and I tried to make a summary. My question is: how can I move this PEP forward (accept, defer or reject it)? Can I accept it myself, or do we need a global agreement, or should someone else decide for th

[Python-Dev] Python code.interact() and UTF-8 locale

2005-09-10 Thread Victor STINNER
Hi, I found a bug in Python interactive command line (program python alone: looks to be code.interact() function in code.py). With UTF-8 locale, the command << u"é" >> returns << u'\xc3\xa9' >> and not << u'\xE9' >>. Remember: the french e with acute is Unicode 233 (0xE9), encoded \xC3 \xA9 in UTF

Re: [Python-Dev] Python code.interact() and UTF-8 locale

2005-09-13 Thread Victor STINNER
Le mardi 13 septembre 2005 à 17:56 +0900, Hye-Shik Chang a écrit : > On 9/11/05, Victor STINNER <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I found a bug in Python interactive command line (program python alone: > > looks to be code.interact() function in

[Python-Dev] Bug bz2.BZ2File(...).seek(0,2) + patch

2005-11-24 Thread Victor STINNER
r all your answers. Bye, Victor -- Victor Stinner - student at the UTBM (Belfort, France) http://www.haypocalc.com/wiki/Accueil signature.asc Description: This is a digitally signed message part ___ Python-Dev mailing list Python-Dev@python.org http://

[Python-Dev] Bug bz2.BZ2File(...).seek(0,2) + patch

2005-11-25 Thread Victor STINNER
r all your answers. Bye, Victor -- Victor Stinner - student at the UTBM (Belfort, France) http://www.haypocalc.com/wiki/Accueil signature.asc Description: This is a digitally signed message part ___ Python-Dev mailing list Python-Dev@python.org http://

Re: [Python-Dev] Bug bz2.BZ2File(...).seek(0,2) + patch

2005-12-08 Thread Victor Stinner
Le Vendredi 25 Novembre 2005 15:54, Aahz a écrit : > On Fri, Nov 25, 2005, Victor STINNER wrote: > > I found a bug in bz2 python module. Example: > > > > Details and *patch* at: > > http://sourceforge.net/tracker/index.php?func=detail&aid=1366000&group

<    28   29   30   31   32   33