Re: [Python-Dev] Add "e" (close and exec) mode to open()

2013-01-08 Thread Victor Stinner
Benjamin wrote: > I'm not sure it's worth cluttering the open() interface with such a > non-portable option. Zbyszek wrote: > If the best-effort fallback is included, it is quite portable. Definitely > all modern and semi-modern systems support either the atomic or the > nonatomic methods. Gregory

Re: [Python-Dev] Add "e" (close and exec) mode to open()

2013-01-08 Thread Victor Stinner
Oops, I sent my email too early by mistake (it was not finished). > The myriad cloexec > APIs between different platforms suggests to me that using this > features requires understanding its various quirks on different > platforms. Sorry, I don't understand. What do you mean by "various quirks".

[Python-Dev] make test

2013-01-08 Thread Xu Wanglin
When I run the test, i got these: ... ... testShareLocal (test.test_socket.TestSocketSharing) ... skipped 'Windows specific' testTypes (test.test_socket.TestSocketSharing) ... skipped 'Windows specific' == ERROR: test_idna (tes

Re: [Python-Dev] Point of building without threads?

2013-01-08 Thread Yury V. Zaytsev
On Mon, 2012-05-07 at 21:49 +0200, Antoine Pitrou wrote: > > I guess a long time ago, threading support in operating systems wasn't > very widespread, but these days all our supported platforms have it. > Is it still useful for production purposes to configure > --without-threads? Do people use th

Re: [Python-Dev] Point of building without threads?

2013-01-08 Thread Antoine Pitrou
Le Tue, 08 Jan 2013 10:28:25 +0100, "Yury V. Zaytsev" a écrit : > On Mon, 2012-05-07 at 21:49 +0200, Antoine Pitrou wrote: > > > > I guess a long time ago, threading support in operating systems > > wasn't very widespread, but these days all our supported platforms > > have it. Is it still usefu

Re: [Python-Dev] Add "e" (close and exec) mode to open()

2013-01-08 Thread Victor Stinner
2013/1/8 Victor Stinner : > I don't know platform without this flag. According to the following email, fcntl.FD_CLOEXEC was not available in Python 2.2 on Red Hat 7.3 (in 2003): http://communities.mentor.com/community/cs/archives/qmtest/msg00501.html I don't know if the constant was not defined i

Re: [Python-Dev] make test

2013-01-08 Thread Oleg Broytman
Hello. We are sorry but we cannot help you. This mailing list is to work on developing Python (adding new features to Python itself and fixing bugs); if you're having problems learning, understanding or using Python, please find another forum. Probably python-list/comp.lang.python mailing list/

Re: [Python-Dev] make test

2013-01-08 Thread R. David Murray
On Tue, 08 Jan 2013 16:48:41 +0400, Oleg Broytman wrote: > Hello. > >We are sorry but we cannot help you. This mailing list is to work on > developing Python (adding new features to Python itself and fixing bugs); > if you're having problems learning, understanding or using Python, please > f

Re: [Python-Dev] Point of building without threads?

2013-01-08 Thread Trent Nelson
[ Weird, I can't see your original e-mail Antoine; hijacking Yury's reply instead. ] On Tue, Jan 08, 2013 at 01:28:25AM -0800, Yury V. Zaytsev wrote: > On Mon, 2012-05-07 at 21:49 +0200, Antoine Pitrou wrote: > > > > I guess a long time ago, threading support in operating systems wasn't

Re: [Python-Dev] Point of building without threads?

2013-01-08 Thread Antoine Pitrou
Le Tue, 8 Jan 2013 09:02:00 -0500, Trent Nelson a écrit : > [ Weird, I can't see your original e-mail Antoine; hijacking > Yury's reply instead. ] The original e-mail is quite old (it was sent in May) :-) Regards Antoine. ___ Python-Dev mailing

Re: [Python-Dev] Point of building without threads?

2013-01-08 Thread Stefan Krah
Trent Nelson wrote: > All our NetBSD, OpenBSD and DragonFlyBSD slaves use --without-thread. > Without it, they all wedge in some way or another. (That should be > fixed*/investigated, but, until then, yeah, --without-threads allows > for a slightly more useful (but still broken) t

Re: [Python-Dev] More compact dictionaries with faster iteration

2013-01-08 Thread Maciej Fijalkowski
On Mon, Dec 10, 2012 at 3:44 AM, Raymond Hettinger wrote: > The current memory layout for dictionaries is > unnecessarily inefficient. It has a sparse table of > 24-byte entries containing the hash value, key pointer, > and value pointer. > > Instead, the 24-byte entries should be stored in a > d

Re: [Python-Dev] Point of building without threads?

2013-01-08 Thread Trent Nelson
On Tue, Jan 08, 2013 at 06:15:45AM -0800, Stefan Krah wrote: > Trent Nelson wrote: > > All our NetBSD, OpenBSD and DragonFlyBSD slaves use --without-thread. > > Without it, they all wedge in some way or another. (That should be > > fixed*/investigated, but, until then, yeah, --without

[Python-Dev] is this the fault of import_fresh_module or pickle?

2013-01-08 Thread Eli Bendersky
Hello, I'm still having some struggles with the interaction between pickle and import overriding with import_fresh_module. _elementtree.TreeBuilder can't be pickled at this point. When I do this: from test.support import import_fresh_module import pickle P = import_fresh_module('xml.etree.Element

Re: [Python-Dev] is this the fault of import_fresh_module or pickle?

2013-01-08 Thread Stefan Krah
Eli Bendersky wrote: > Everything works fine. However, if I add import_fresh_module for the C module: > > from test.support import import_fresh_module > import pickle > C = import_fresh_module('xml.etree.ElementTree', fresh=['_elementtree']) > P = import_fresh_module('xml.etree.ElementTree', bloc

Re: [Python-Dev] Add "e" (close and exec) mode to open()

2013-01-08 Thread Benjamin Peterson
2013/1/8 Victor Stinner : > Oops, I sent my email too early by mistake (it was not finished). > >> The myriad cloexec >> APIs between different platforms suggests to me that using this >> features requires understanding its various quirks on different >> platforms. > > Sorry, I don't understand. Wh

Re: [Python-Dev] Add "e" (close and exec) mode to open()

2013-01-08 Thread Victor Stinner
2013/1/8 Benjamin Peterson : > Okay, fair enough, but I really would like it not to ever raise > NotImplementedError. Then you would end up having different codepaths > for various oses anyway. So what do you suggest? Victor ___ Python-Dev mailing list

Re: [Python-Dev] Add "e" (close and exec) mode to open()

2013-01-08 Thread Benjamin Peterson
2013/1/8 Victor Stinner : > 2013/1/8 Benjamin Peterson : >> Okay, fair enough, but I really would like it not to ever raise >> NotImplementedError. Then you would end up having different codepaths >> for various oses anyway. > > So what do you suggest? If the only systems it doesn't work on is anc

Re: [Python-Dev] is this the fault of import_fresh_module or pickle?

2013-01-08 Thread Eli Bendersky
On Tue, Jan 8, 2013 at 8:05 AM, Stefan Krah wrote: > Eli Bendersky wrote: > > Everything works fine. However, if I add import_fresh_module for the C > module: > > > > from test.support import import_fresh_module > > import pickle > > C = import_fresh_module('xml.etree.ElementTree', fresh=['_elem

Re: [Python-Dev] is this the fault of import_fresh_module or pickle?

2013-01-08 Thread R. David Murray
On Tue, 08 Jan 2013 17:05:50 +0100, Stefan Krah wrote: > Eli Bendersky wrote: > > Everything works fine. However, if I add import_fresh_module for the C > > module: > > > > from test.support import import_fresh_module > > import pickle > > C = import_fresh_module('xml.etree.ElementTree', fresh=

Re: [Python-Dev] Add "e" (close and exec) mode to open()

2013-01-08 Thread Victor Stinner
2013/1/8 Benjamin Peterson : > 2013/1/8 Victor Stinner : >> 2013/1/8 Benjamin Peterson : >>> Okay, fair enough, but I really would like it not to ever raise >>> NotImplementedError. Then you would end up having different codepaths >>> for various oses anyway. >> >> So what do you suggest? > > If th

Re: [Python-Dev] Add "e" (close and exec) mode to open()

2013-01-08 Thread Benjamin Peterson
2013/1/8 Victor Stinner : > 2013/1/8 Benjamin Peterson : >> 2013/1/8 Victor Stinner : >>> 2013/1/8 Benjamin Peterson : Okay, fair enough, but I really would like it not to ever raise NotImplementedError. Then you would end up having different codepaths for various oses anyway. >>> >>

Re: [Python-Dev] is this the fault of import_fresh_module or pickle?

2013-01-08 Thread Stefan Krah
Eli Bendersky wrote: > On Tue, Jan 8, 2013 at 8:05 AM, Stefan Krah wrote: > > pickle always looks up sys.modules['xml.etree.ElementTree']. Perhaps we > could improve something, but this requirement is rather special; > personally > I'm okay with switching sys.modules explicitly in t

Re: [Python-Dev] is this the fault of import_fresh_module or pickle?

2013-01-08 Thread Eli Bendersky
On Tue, Jan 8, 2013 at 8:37 AM, R. David Murray wrote: > On Tue, 08 Jan 2013 17:05:50 +0100, Stefan Krah > wrote: > > Eli Bendersky wrote: > > > Everything works fine. However, if I add import_fresh_module for the C > module: > > > > > > from test.support import import_fresh_module > > > import

Re: [Python-Dev] PEP 431 Time zone support improvements - Update

2013-01-08 Thread Lennart Regebro
On Fri, Dec 28, 2012 at 10:12 PM, Ronald Oussoren wrote: > > On 28 Dec, 2012, at 21:23, Lennart Regebro wrote: > > > Happy Holidays! Here is the update of PEP 431 with the changes that > emerged after the earlier discussion. > > Why is the new timezone support added in a submodule of datetime? Ad

Re: [Python-Dev] PEP 431 Time zone support improvements - Update

2013-01-08 Thread Brett Cannon
On Tue, Jan 8, 2013 at 1:08 PM, Lennart Regebro wrote: > On Fri, Dec 28, 2012 at 10:12 PM, Ronald Oussoren > wrote: >> >> >> On 28 Dec, 2012, at 21:23, Lennart Regebro wrote: >> >> > Happy Holidays! Here is the update of PEP 431 with the changes that >> > emerged after the earlier discussion. >>

Re: [Python-Dev] Point of building without threads?

2013-01-08 Thread Victor Stinner
2013/1/8 Trent Nelson : > On Tue, Jan 08, 2013 at 06:15:45AM -0800, Stefan Krah wrote: >> Trent Nelson wrote: >> > All our NetBSD, OpenBSD and DragonFlyBSD slaves use --without-thread. >> > Without it, they all wedge in some way or another. (That should be >> > fixed*/investigated, bu

[Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted

2013-01-08 Thread Yuriy Taraday
Hello. I've read the PEP and some things raise questions in my consciousness. Here they are. 1. Series of sock_ methods can be organized into a wrapper around sock object. This wrappers can then be saved and used later in async-aware code. This way code like: sock = socket(...) # later,

Re: [Python-Dev] is this the fault of import_fresh_module or pickle?

2013-01-08 Thread Nick Coghlan
On Wed, Jan 9, 2013 at 2:58 AM, Eli Bendersky wrote: >> Handling this case is why having a context-manager form of >> import_fresh_module was suggested earlier in this meta-thread. At >> least, I think that would solve it, I haven't tried it :) > > > Would you mind extracting just this idea into

Re: [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted

2013-01-08 Thread Benjamin Peterson
2013/1/8 Yuriy Taraday : > 4. Why separate exception() from result() for Future class? It does the same > as result() but with different interface (return instead of raise). Doesn't > this violate the rule "There should be one obvious way to do it"? I expect that's a copy-and-paste error. exceptio

Re: [Python-Dev] PEP 431 Time zone support improvements - Update

2013-01-08 Thread Nick Coghlan
On Wed, Jan 9, 2013 at 5:02 AM, Brett Cannon wrote: > On Tue, Jan 8, 2013 at 1:08 PM, Lennart Regebro wrote: >> Alternative names for the timezone() function is get_timezone(), which has >> already been rejected, and zoneinfo() which makes it clear that it's only >> zoneinfo timezones that are re

Re: [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted

2013-01-08 Thread Nick Coghlan
On Wed, Jan 9, 2013 at 11:14 AM, Yuriy Taraday wrote: > 4. Why separate exception() from result() for Future class? It does the same > as result() but with different interface (return instead of raise). Doesn't > this violate the rule "There should be one obvious way to do it"? The exception() me

Re: [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted

2013-01-08 Thread Guido van Rossum
On Tue, Jan 8, 2013 at 6:07 PM, Benjamin Peterson wrote: > 2013/1/8 Yuriy Taraday : >> 4. Why separate exception() from result() for Future class? It does the same >> as result() but with different interface (return instead of raise). Doesn't >> this violate the rule "There should be one obvious w

Re: [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted

2013-01-08 Thread Benjamin Peterson
2013/1/8 Guido van Rossum : > On Tue, Jan 8, 2013 at 6:07 PM, Benjamin Peterson wrote: >> 2013/1/8 Yuriy Taraday : >>> 4. Why separate exception() from result() for Future class? It does the same >>> as result() but with different interface (return instead of raise). Doesn't >>> this violate the r

Re: [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted

2013-01-08 Thread Benjamin Peterson
2013/1/8 Benjamin Peterson : > 2013/1/8 Guido van Rossum : >> On Tue, Jan 8, 2013 at 6:07 PM, Benjamin Peterson >> wrote: >>> 2013/1/8 Yuriy Taraday : 4. Why separate exception() from result() for Future class? It does the same as result() but with different interface (return inst

Re: [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted

2013-01-08 Thread Guido van Rossum
On Tue, Jan 8, 2013 at 6:53 PM, Benjamin Peterson wrote: > 2013/1/8 Guido van Rossum : >> On Tue, Jan 8, 2013 at 6:07 PM, Benjamin Peterson >> wrote: >>> 2013/1/8 Yuriy Taraday : 4. Why separate exception() from result() for Future class? It does the same as result() but with dif

Re: [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted

2013-01-08 Thread Yuriy Taraday
On Wed, Jan 9, 2013 at 6:31 AM, Nick Coghlan wrote: > On Wed, Jan 9, 2013 at 11:14 AM, Yuriy Taraday > wrote: > > 4. Why separate exception() from result() for Future class? It does the > same > > as result() but with different interface (return instead of raise). > Doesn't > > this violate the

Re: [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted

2013-01-08 Thread Guido van Rossum
On Tue, Jan 8, 2013 at 5:14 PM, Yuriy Taraday wrote: > I've read the PEP and some things raise questions in my consciousness. Here > they are. Thanks! > 1. Series of sock_ methods can be organized into a wrapper around sock > object. This wrappers can then be saved and used later in async-aware

Re: [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted

2013-01-08 Thread Guido van Rossum
On Tue, Jan 8, 2013 at 8:31 PM, Guido van Rossum wrote: > On Tue, Jan 8, 2013 at 5:14 PM, Yuriy Taraday wrote: >> - pause() and resume() work with reading only, so they should be suffixed >> (prefixed) with read(ing), like pause_reading(), resume_reading(). > > Agreed. I think I want to take tha

Re: [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted

2013-01-08 Thread Yuriy Taraday
On Wed, Jan 9, 2013 at 8:31 AM, Guido van Rossum wrote: > On Tue, Jan 8, 2013 at 5:14 PM, Yuriy Taraday wrote: > > I've read the PEP and some things raise questions in my consciousness. > Here > > they are. > > Thanks! > > > 1. Series of sock_ methods can be organized into a wrapper around sock

Re: [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted

2013-01-08 Thread Guido van Rossum
On Tue, Jan 8, 2013 at 9:02 PM, Yuriy Taraday wrote: > On Wed, Jan 9, 2013 at 8:31 AM, Guido van Rossum wrote: >> On Tue, Jan 8, 2013 at 5:14 PM, Yuriy Taraday wrote: >> > 1. Series of sock_ methods can be organized into a wrapper around sock >> > object. This wrappers can then be saved and used

Re: [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted

2013-01-08 Thread Yuriy Taraday
On Wed, Jan 9, 2013 at 9:14 AM, Guido van Rossum wrote: > On Tue, Jan 8, 2013 at 9:02 PM, Yuriy Taraday wrote: > > Should transports be bound to event loop on creation? I wonder, what > would > > happen if someone changes current event loop between these calls. > > Yes, this is what the transpo

Re: [Python-Dev] [Python-ideas] PEP 3156 - Asynchronous IO Support Rebooted

2013-01-08 Thread Stephen J. Turnbull
Is this thread really ready to migrate to python-dev when we're still bikeshedding method names? Yuriy Taraday writes: > > But which half? A socket is two independent streams, one in each > > direction. Twisted uses half_close() for this concept but unless you > > already know what this is for

Re: [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted

2013-01-08 Thread Guido van Rossum
On Tue, Jan 8, 2013 at 9:26 PM, Yuriy Taraday wrote: > > > > On Wed, Jan 9, 2013 at 9:14 AM, Guido van Rossum wrote: >> >> On Tue, Jan 8, 2013 at 9:02 PM, Yuriy Taraday wrote: >> > Should transports be bound to event loop on creation? I wonder, what >> > would >> > happen if someone changes curr