Re: [Python-Dev] Patchs and bugs resume

2007-03-20 Thread Martin v. Löwis
>> old and had not been touched in ages. Hopefully you will be able to >> easily port this over to the new tracker once it's up (that should >> happen 2-4 weeks after 2.5.1 is released). > > You can be sure I'll port it... When you do, make sure you take a look at roundup's search facilities. Ro

Re: [Python-Dev] Patchs and bugs resume

2007-03-20 Thread Brett Cannon
On 3/20/07, Facundo Batista <[EMAIL PROTECTED]> wrote: > Brett Cannon wrote: > > > That's some interesting stuff. Took me a second to realize that the > > temporal column's total length is the time range from the opening of > > the oldest bug to the latest comment made on any bug and that the blue

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Greg Ewing
Alan Kennedy wrote: > def connect(address, **kwargs): > [snip] > if kwargs.has_key('timeout'): > sock.settimeout(kwargs['timeout']) > [snip] A problem with interfaces like this is that it makes it awkward to pass on a value that you received from higher up. An

Re: [Python-Dev] test_expat.py and unittest

2007-03-20 Thread Guido van Rossum
You could use doctest, which is an accepted testing tool that lets you compare snippets of output directly without having to check in a "golden" file. Despite what is written somewhere, it is not deprecated or discouraged. See Lib/doctest.py. You could also use some advanced testing strategy where

[Python-Dev] test_expat.py and unittest

2007-03-20 Thread Jerry Seutter
Hi, I have been working on converting some of the older test files to use unittest. test_expat.py has a section like: class Outputter: def StartElementHandler(self, name, attrs): print 'Start element:\n\t', repr(name), sortdict(attrs) def EndElementHandler(self, name): prin

[Python-Dev] 2.5.1, buildbots and my availability

2007-03-20 Thread Anthony Baxter
I'm moving house today and tomorrow, and don't expect to have internet access connected up at home til sometime next week. In the meantime, if there's urgent 2.5.1 related issues, bear with me, as I'll only be on email during the working day. cc Neal (hi Neal :) is the best bet. Also, the cygwi

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Facundo Batista
Alan Kennedy wrote: > - Explicitly check that the address passed is a tuple of (string, integer) It's more probable that a use pass a list of two values, that a host of two letters as you suggested above... > - To raise an exception explaining the parameter expectation when it is not > met

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Facundo Batista
Alan Kennedy wrote: > So is that address = host, port = 80? > > Or is it address = (host, port), timeout=80? The latter, as is in the rest of Python... See your point, you say it's less error prone to make timeout mandatory. I really don't care, so I'll take your advice... -- . Facundo . Bl

Re: [Python-Dev] Patchs and bugs resume

2007-03-20 Thread Facundo Batista
Brett Cannon wrote: > That's some interesting stuff. Took me a second to realize that the > temporal column's total length is the time range from the opening of > the oldest bug to the latest comment made on any bug and that the blue > bar is where within that time frame the bug was opened and th

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Alan Kennedy
[Josiah] > Error-wise, I agree that it would be better to pass timeout explicitly > with a keyword, but generally users will notice their mistake if they > try to do create_connection(host, port) by ValueError("tuple expected as > first argument, got str instead") Is it better than > TypeError("cre

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Josiah Carlson
Greg Ewing <[EMAIL PROTECTED]> wrote: > Alan Kennedy wrote: > > The standard mechanism in C for doing a non-blocking connect is to > > issue the connect call, and check the return value for a non-zero > > error code. If this error code is errno.EAGAIN (code 10035), then the > > call succeeded, but

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Josiah Carlson
"Alan Kennedy" <[EMAIL PROTECTED]> wrote: > > [Facundo] > > Letting "timeout" be positional or named, it's just less error prone. > > So, if I can make it this way, it's what I prefer, :) > > So, if I want a timeout of, say, 80 seconds, I issue a call like this > > new_socket = socket.create_co

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Greg Ewing
Alan Kennedy wrote: > The standard mechanism in C for doing a non-blocking connect is to > issue the connect call, and check the return value for a non-zero > error code. If this error code is errno.EAGAIN (code 10035), then the > call succeeded, but you should check back later for completion of t

Re: [Python-Dev] r54457 - python/trunk/Doc/whatsnew/whatsnew26.tex

2007-03-20 Thread Steve Holden
A.M. Kuchling wrote: > On Tue, Mar 20, 2007 at 06:08:24AM +0100, neal.norwitz wrote: >> Author: neal.norwitz >> Date: Tue Mar 20 06:08:23 2007 >> New Revision: 54457 >> >> +% Should there be a new section here for 3k migration? >> +% Or perhaps a more general section describing module changes/depre

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Alan Kennedy
[Facundo] > Letting "timeout" be positional or named, it's just less error prone. > So, if I can make it this way, it's what I prefer, :) So, if I want a timeout of, say, 80 seconds, I issue a call like this new_socket = socket.create_connection(address, 80) So is that address = host, port = 80?

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Alan Kennedy
[Josiah] > But now the result could be either an error code OR a socket. One of > the reasons to provide a timeout for the create_connection call, if I > understand correctly, is to handle cases for which you don't get a > response back in sufficient time. AFAICT, that's the only reason. It's not

Re: [Python-Dev] Patchs and bugs resume

2007-03-20 Thread Brett Cannon
On 3/20/07, Facundo Batista <[EMAIL PROTECTED]> wrote: > People: > > At the beginning of March, there was a thread in this list about patchs > and bugs that teorically weren't checked out. > > >From that discussion, I asked myself: "How can I know the temporal > location of a patch/bug?". Are there

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Josiah Carlson
"Alan Kennedy" <[EMAIL PROTECTED]> wrote: [snip] > def create_connection(address, timeout=sentinel): > [snip] > if timeout != sentinel: >new_socket.settimeout(timeout) > if new_socket.gettimeout() == 0: >result = new_socket.connect_ex(address) > else: >new_

Re: [Python-Dev] Rationale for NamedTemporaryFile?

2007-03-20 Thread Greg Ewing
Gregory P. Smith wrote: > I prefer the default of "clean up after itself" as is to avoid leaving > temporary file turds on systems caused by us lazy programmers. Maybe instead of an option there should be a separate function with a different name, such as NewUniqueFile. For the use cases I have i

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Alan Kennedy
[Facundo] > So, I have two modifications to make to the patch: > > - change the name to "create_connection" > - make timeout obligatory named I was going to suggest a third change: for orthogonality with the API for socket objects, add a blocking parameter as well, i.e. def create_connection(addr

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Facundo Batista
Josiah Carlson wrote: > restrict what the user could pass as a value to timeout. It requires > that you pass timeout explicitly, but that's a (relatively > inconsequential) API decision. This is exactly the point. It's an API decision, that you must communicate to the user, he/she must read it a

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Josiah Carlson
Facundo Batista <[EMAIL PROTECTED]> wrote: > Josiah Carlson wrote: > > sentinel = object() > > > > def connect(HOST, PORT, timeout=sentinel): > > ... > > if timeout is not sentinel: > > sock.settimeout(timeout) > > ... > > > > A keyword argument via **kwargs is also fine. I ha

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Facundo Batista
Josiah Carlson wrote: > sentinel = object() > > def connect(HOST, PORT, timeout=sentinel): > ... > if timeout is not sentinel: > sock.settimeout(timeout) > ... > > A keyword argument via **kwargs is also fine. I have no preference. I do. The way you showed here, I'm not restr

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Facundo Batista
Steven Bethard wrote: > is supposed to be a timeout. The modified version:: > > newsock = socket.create_connection(HOST, PORT, timeout=None) Warning. The correct function signature is create_connection(address[, timeout=None]) where address is a tuple (HOST, PORT). BTW, how can I indic

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Josiah Carlson
"Steven Bethard" <[EMAIL PROTECTED]> wrote: > On 3/20/07, Facundo Batista <[EMAIL PROTECTED]> wrote: > > So, I have two modifications to make to the patch: > > > > - change the name to "create_connection" > > - make timeout obligatory named > > > > Is everybody ok with this? > > FWLIW, +1. It wa

[Python-Dev] Patchs and bugs resume

2007-03-20 Thread Facundo Batista
People: At the beginning of March, there was a thread in this list about patchs and bugs that teorically weren't checked out. >From that discussion, I asked myself: "How can I know the temporal location of a patch/bug?". Are there a lot of old patchs/bugs? Those that are old, don't have any updat

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Steven Bethard
On 3/20/07, Facundo Batista <[EMAIL PROTECTED]> wrote: > So, I have two modifications to make to the patch: > > - change the name to "create_connection" > - make timeout obligatory named > > Is everybody ok with this? FWLIW, +1. It was not immediately apparent to me that the third argument in::

Re: [Python-Dev] r54457 - python/trunk/Doc/whatsnew/whatsnew26.tex

2007-03-20 Thread A.M. Kuchling
On Tue, Mar 20, 2007 at 06:08:24AM +0100, neal.norwitz wrote: > Author: neal.norwitz > Date: Tue Mar 20 06:08:23 2007 > New Revision: 54457 > > +% Should there be a new section here for 3k migration? > +% Or perhaps a more general section describing module changes/deprecation? > +% sets module depr

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Facundo Batista
Alan Kennedy wrote: > [Facundo] >> But, I recognize that maybe it's [connect] not the best name. What about >> "create_connection"? > > I have no strong feelings about it, other than to say it should not be > "connect". How about Ok. "create_connection", then. > Ah, but it's too late by the tim

Re: [Python-Dev] Proposal to revert r54204 (splitext change)

2007-03-20 Thread Phillip J. Eby
At 05:07 PM 3/20/2007 +0100, Martin v. Löwis wrote: >Ronald Oussoren schrieb: > > What I don't understand is why 'ignore_leading_dot==False' is considered > > to be a valid usecase at all, except for the fact that os.path.splitext > > did this until py2.5. I'm definitely in the camp that considers

Re: [Python-Dev] Proposal to revert r54204 (splitext change)

2007-03-20 Thread Ronald Oussoren
On 20 Mar, 2007, at 19:24, Phillip J. Eby wrote: What I don't understand is why 'ignore_leading_dot==False' is considered to be a valid usecase at all, except for the fact that os.path.splitext did this until py2.5. I'm definitely in the camp that considers '.profile' not to have an extension

Re: [Python-Dev] Amusing fan mail I got

2007-03-20 Thread Gustavo Niemeyer
> i thought about this thing. (...) +1! -- Gustavo Niemeyer http://niemeyer.net ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive

Re: [Python-Dev] Proposal to revert r54204 (splitext change)

2007-03-20 Thread Phillip J. Eby
At 04:47 PM 3/20/2007 +0100, Ronald Oussoren wrote: >On 20 Mar, 2007, at 15:54, Phillip J. Eby wrote: > >>At 09:24 AM 3/20/2007 +0100, Ronald Oussoren wrote: >>>I don't agree. "all_ext=True" is won't do the right thing in a >>>significant subset of filenames >> >>Yes, that's understood. The proble

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Alan Kennedy
[Facundo] > But, I recognize that maybe it's [connect] not the best name. What about > "create_connection"? I have no strong feelings about it, other than to say it should not be "connect". How about * connect_to_server() * open_connection() * open_client_connection() There's no need to inclu

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Facundo Batista
Alan Kennedy wrote: > Sorry, my mistake. No problem. > So, a question I would ask is: Is "connect" the right name for that function? > ... > Perhaps a better name might be "create_connected_client_socket", or > something equally descriptive? Guido proposed "connect_with_timeout". I don't like

Re: [Python-Dev] Cross Compiling Python

2007-03-20 Thread Martin v. Löwis
> I have to cross compile Python to run on Arm processor based MontaVista > Linux. > If anyone has tried this already, please let me know the procedure. Dear Kiran, The python-dev mailing list is for the development *of* Python, not for the development *with* Python; use python-list@python.org

Re: [Python-Dev] Proposal to revert r54204 (splitext change)

2007-03-20 Thread Martin v. Löwis
Ronald Oussoren schrieb: >> I don't understand. Example? > > You conveniently ignored my other arguments ;-). > > Given a splitext that ignores leading dot's the following function doesn't: > # from os.path import * > def splitext2(path): > dn = dirname(path) >

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Alan Kennedy
[Alan Kennedy] >> I see that your updated socket.connect() method takes a timeout >> parameter, which defaults to None if not present, e.g. [Facundo Batista] > I did NOT update a connect() method. I created a connect() function, in > the module socket.py (there's also a connect() method in the soc

Re: [Python-Dev] Proposal to revert r54204 (splitext change)

2007-03-20 Thread Ronald Oussoren
On 20 Mar, 2007, at 15:54, Phillip J. Eby wrote: At 09:24 AM 3/20/2007 +0100, Ronald Oussoren wrote: I don't agree. "all_ext=True" is won't do the right thing in a significant subset of filenames Yes, that's understood. The problem is that splitext() in general "won't do the right thing",

[Python-Dev] Cross Compiling Python

2007-03-20 Thread Kiran Malla
Hi All, I have to cross compile Python to run on Arm processor based MontaVista Linux. If anyone has tried this already, please let me know the procedure. Thanks in advance, Regards, Kumar ___ Python-Dev mailing list Python-Dev@python.org http://mail.

Re: [Python-Dev] Proposal to revert r54204 (splitext change)

2007-03-20 Thread Phillip J. Eby
At 09:24 AM 3/20/2007 +0100, Ronald Oussoren wrote: >I don't agree. "all_ext=True" is won't do the right thing in a >significant subset of filenames Yes, that's understood. The problem is that splitext() in general "won't do the right thing", for many definitions of "the right thing", unless yo

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Facundo Batista
Alan Kennedy wrote: > I see that your updated socket.connect() method takes a timeout > parameter, which defaults to None if not present, e.g. I did NOT update a connect() method. I created a connect() function, in the module socket.py (there's also a connect() method in the socket object, but I

Re: [Python-Dev] SoC AST generation question

2007-03-20 Thread Jay Parlar
On 3/20/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Notice that there are really two separate AST projects listed: one > is to improve usage of the AST compiler, by, say, adding more passes > to it, or allowing round-tripping from the Python representation. > The other one is to generate ast

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Alan Kennedy
[Facundo Batista] > Do you have any news about this? Re: Patch 1676823 http://sourceforge.net/tracker/index.php?func=detail&aid=1676823&group_id=5470&atid=305470 Since I've just written a lot of socket stuff for jython, I thought I'd have a look at the patch. I like the idea of adding better soc

Re: [Python-Dev] Adding timeout to socket.py and httplib.py

2007-03-20 Thread Facundo Batista
On March 15, Georg Brandl wrote: > I'll review it tomorrow. Do you have any news about this? Regards, -- . Facundo . Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/ ___ Python-Dev mailing list Python-Dev@python.org http:/

Re: [Python-Dev] Non-blocking sockets, asynchronous connects and select.select.

2007-03-20 Thread Alan Kennedy
Thanks Josiah and Neal, you were right. I am running the code on Windows, Server 2003. I should have mentioned that at the start. When I change the hostname from "" to "localhost", the code works exactly as expected. It's odd that this behaviour exists, only on Windows. The jython code that I'm

Re: [Python-Dev] Proposal to revert r54204 (splitext change)

2007-03-20 Thread Ronald Oussoren
On 16 Mar, 2007, at 23:37, Stephen Hansen wrote: > > That may actually be a genuinely useful approach: > > splitext(name, ignore_leading_dot=False, all_ext=False) > > ... that's perfect. I updated my patch to do it that way! :) I don't agree. "all_ext=True" is won't do the right thing in a si

Re: [Python-Dev] SoC AST generation question

2007-03-20 Thread Martin v. Löwis
Jay Parlar schrieb: > 1) Who would most likely mentor this project? As Brett says, it all depends on the applications we receive and those that get accepted. That said, it might be me. > 2) I've never worked in the core before (but have been using Python as > my primary language for about 6 years