[issue7610] Cannot use both read and readline method in same ZipExtFile object

2010-01-27 Thread Ezio Melotti
Ezio Melotti added the comment: > If the part which handles unconsumed data does not work when zlib is > available, then the existing tests would fail. If the existing tests end up testing that part of code too then it's probably fine. I tried to add a print inside the 'if' (at line 605) but

[issue7610] Cannot use both read and readline method in same ZipExtFile object

2010-01-27 Thread Nir Aides
Nir Aides added the comment: Unconsumed data is compressed data. If the part which handles unconsumed data does not work when zlib is available, then the existing tests would fail. In any case the unconsumed buffer is an implementation detail of zipfile. I see a point in adding a test to make

[issue7610] Cannot use both read and readline method in same ZipExtFile object

2010-01-27 Thread Ezio Melotti
Ezio Melotti added the comment: The test should just check that the part that handles unconsumed data works when zlib is available. AFAIU if zlib is not available this part (i.e. the content of the if) can be skipped so it doesn't need to be tested. (When zlib is not available 'zlib' is set t

[issue7610] Cannot use both read and readline method in same ZipExtFile object

2010-01-27 Thread Nir Aides
Nir Aides added the comment: The related scenario is a system without zlib. How do you suggest simulating this in test? -- ___ Python tracker ___ ___

[issue7797] base64 module docs should indicate that encode methods return bytes, not strings

2010-01-27 Thread Justin Lebar
New submission from Justin Lebar : It's not at all clear from the documentation that base64.base64encode() and its kin return bytes, rather than strings. Since this matters now, the docs should be clear on this point. http://docs.python.org/3.1/library/base64.html -- assignee: georg.

[issue7325] tempfile.mkdtemp() does not return absolute pathname when dir is specified

2010-01-27 Thread Thomas Holmes
Thomas Holmes added the comment: I made a new patch off of the 2.7 trunk version. I think I have handled some of the issues more cleanly. Please see Py(27)7325.diff I addressed the issue of using a relative path in the tempdir to achieve the 'guaranteed' ability to write rather than assumin

[issue7791] Python 2.6 standard library "sees also" something not in the standard library

2010-01-27 Thread Ezio Melotti
Ezio Melotti added the comment: I removed it in r77814. -- assignee: georg.brandl -> ezio.melotti nosy: +ezio.melotti resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed ___ Python tracker

[issue7610] Cannot use both read and readline method in same ZipExtFile object

2010-01-27 Thread Ezio Melotti
Ezio Melotti added the comment: Nir, could you also provide a test for the part that "handles unconsumed data" (line 601 in zipfile.py)? In r77809 (and r77810) I made a change to avoid using zlib when it's not necessary (zlib is not always available), and I was going to commit a typo that lu

[issue3367] Uninitialized value read in parsetok.c

2010-01-27 Thread Benjamin Peterson
Benjamin Peterson added the comment: Excellent! -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs

[issue7796] No way to find out if an object is an instance of a namedtuple

2010-01-27 Thread Peter Waller
Peter Waller added the comment: Hi Amaury, Thanks. I had heard of but never bothered to read about duck-typing before now; though I have used it passively before. I think it does make sense in this case. I can't imagine any case where checking for the _fields attribute would fail and isinsta

[issue4733] Add a "decode to declared encoding" version of urlopen to urllib

2010-01-27 Thread Lino Mastrodomenico
Changes by Lino Mastrodomenico : -- nosy: +mastrodomenico ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue1599329] urllib(2) should allow automatic decoding by charset

2010-01-27 Thread Lino Mastrodomenico
Changes by Lino Mastrodomenico : -- nosy: +mastrodomenico ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue7666] test_lib2to3 fails if path contains space

2010-01-27 Thread Florent Xicluna
Florent Xicluna added the comment: The fix on r77419 do not work. The patch in attachment behaves better. -- resolution: fixed -> status: closed -> open ___ Python tracker ___

[issue5362] Add configure option to disable Py3k warnings

2010-01-27 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti priority: -> normal stage: -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue6939] shadows around the io truncate() semantics

2010-01-27 Thread Pascal Chambon
Pascal Chambon added the comment: Thanks a lot B-) I'll make a patch for trunk from now to this W.E. -- ___ Python tracker ___ ___ Pyt

[issue7030] Update version{added, changed} entries in py3k unittest docs

2010-01-27 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti priority: -> normal stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-lis

[issue6939] shadows around the io truncate() semantics

2010-01-27 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file15931/patch26_largefile_tested.patch ___ Python tracker ___ ___ Python-bug

[issue6939] shadows around the io truncate() semantics

2010-01-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thank you. The patch was committed mostly unchanged in r77802 (a few cosmetic fixes). Now trunk and py3k must absolutely be patched in order to conform to the new behaviour. Can you produce a patch for trunk? -- priority: -> release blocker stage: -

[issue7610] Cannot use both read and readline method in same ZipExtFile object

2010-01-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch has been committed in r77798 (trunk) and r77800 (py3k). Thank you! I won't commit it to 2.6 and 3.1 because it's too involved to qualify as a bug fix, though. -- resolution: accepted -> fixed stage: patch review -> committed/rejected status:

[issue7765] 'unittest' documentation misprints

2010-01-27 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed in r77796 (trunk) and r77797 (py3k), thanks for the patches! -- assignee: georg.brandl -> ezio.melotti resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker

[issue7610] Cannot use both read and readline method in same ZipExtFile object

2010-01-27 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- assignee: -> pitrou resolution: -> accepted versions: +Python 2.7 ___ Python tracker ___ ___ Python-bu

[issue1225769] Proposal to implement comment rows in csv module

2010-01-27 Thread Skip Montanaro
Skip Montanaro added the comment: Antoine> Since the csv module returns you an iterator, it's easy enough Antoine> to wrap it in another iterator. I prefer to do this sort of stuff as a pre-processing step, so I generally wrap the file object input and use that iterator as the input "file"

[issue7793] regrtest fails with "RuntimeError: maximum recursion depth exceeded" in some cases

2010-01-27 Thread Florent Xicluna
Florent Xicluna added the comment: Thank you for the patch and the analysis. It fixes the recursion. -- stage: test needed -> patch review ___ Python tracker ___

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2010-01-27 Thread Marc-Andre Lemburg
Changes by Marc-Andre Lemburg : -- assignee: -> pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2010-01-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Stefan Krah wrote: > > Stefan Krah added the comment: > > (1) I can get around the configure problem by patching configure.in, > meaning that va_list is detected correctly now. Perhaps BASECFLAGS > should be used by default for the compile tests?

[issue7796] No way to find out if an object is an instance of a namedtuple

2010-01-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: It seems a perfect case for "duck typing" style of programming: All namedtuple classes: - inherit from tuple - have a "_fields" class attribute These two properties could be the "duck test" for namedtuples, regardless of the actual implementation. --

[issue7796] No way to find out if an object is an instance of a namedtuple

2010-01-27 Thread betatim
Changes by betatim : -- nosy: +thead ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mail

[issue7796] No way to find out if an object is an instance of a namedtuple

2010-01-27 Thread Peter Waller
Peter Waller added the comment: In this case, I need to have names for each object. It is also desirable to use the namedtuple because of their lightweight nature. If they were to subclass the namedtuple I would be happy to accept that, but I really do want them to pass some form of namedtupl

[issue7796] No way to find out if an object is an instance of a namedtuple

2010-01-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I need to be able to catch all named tuples, I don't know in advance > what instance of a namedtuple it might be, but I want my function to > only accept named tuples. Is this unreasonable? I don't know. Why exactly don't you want to accept something else? Pe

[issue7796] No way to find out if an object is an instance of a namedtuple

2010-01-27 Thread Peter Waller
Peter Waller added the comment: Hi Antoine and Eric, Thanks for your responses. I need to be able to catch all named tuples, I don't know in advance what instance of a namedtuple it might be, but I want my function to only accept named tuples. Is this unreasonable? (I am actually writing a

[issue7796] No way to find out if an object is an instance of a namedtuple

2010-01-27 Thread Éric Araujo
Éric Araujo added the comment: Hello namedtuple is a factory function, not a class (as hinted by the naming in lower case, see PEP 8), so there are no instances of namedtuple. You can workaround that with issubclass, or checking for special namedtuples attributes (_asdict, _replace, but this

[issue7796] No way to find out if an object is an instance of a namedtuple

2010-01-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: In this case, what is wrong with: if isinstance(obj, my_tuple): ... or do you want to catch all namedtuples? And if so, why? (I suppose it would be easy to make all namedtuples inherit from a common base class, though) -- assignee: -> rhettinger no

[issue1225769] Proposal to implement comment rows in csv module

2010-01-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Agreed with Skip, Raymond and Amaury. Since the csv module returns you an iterator, it's easy enough to wrap it in another iterator. -- nosy: +pitrou ___ Python tracker ___

[issue7796] No way to find out if an object is an instance of a namedtuple

2010-01-27 Thread Peter Waller
New submission from Peter Waller : Apologies if there is a way of doing this, but I haven't been able to find anything. I need to be able to do the following: my_tuple = namedtuple("my_tuple", "a b c") obj = my_tuple(1,2,3) if isinstance(obj, namedtuple): .. do stuff .. The best I could

[issue1225769] Proposal to implement comment rows in csv module

2010-01-27 Thread Skip Montanaro
Skip Montanaro added the comment: Amaury> Comment lines in csv data may be common in some areas, but they Amaury> are not part of any standard, and they are not the only possible Amaury> extension to csv files (for example: ignore empty lines, or a Amaury> terminal \ for line continu

[issue5689] please support lzma compression as an extension and in the tarfile module

2010-01-27 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- dependencies: +xz compressor support ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue6715] xz compressor support

2010-01-27 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- dependencies: -please support lzma compression as an extension and in the tarfile module priority: -> high ___ Python tracker ___ __

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2010-01-27 Thread Stefan Krah
Stefan Krah added the comment: (1) I can get around the configure problem by patching configure.in, meaning that va_list is detected correctly now. Perhaps BASECFLAGS should be used by default for the compile tests? (2) Now I run into the problem that distutils somehow ignores the L

[issue7795] BaseManager of multiprocessing module throws an exception if socket.setdefaulttimeout is set

2010-01-27 Thread Brian Curtin
Brian Curtin added the comment: Duplicate of #6056. -- nosy: +brian.curtin priority: -> normal resolution: -> duplicate status: open -> closed type: crash -> behavior ___ Python tracker __

[issue7753] newgil backport

2010-01-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Closing the issue since we can't backport to Python 2.7 due to the missing thread library support. The patch may still be useful for experiments by users, though, so thanks to Ross and Neil for creating it. -- resolution: -> rejected status: ope

[issue7753] newgil backport

2010-01-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > >> The arguments given in that thread sound a bit strange to me: >> just because there were no changes to a few files, doesn't really >> say anything about whether they contain working code or

[issue7784] patch for making list/insert at the top of the list avoid memmoves

2010-01-27 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: For macro benchmarking, I suggest using the Unladen Swallow benchmark suite. -- ___ Python tracker ___ ___

[issue7784] patch for making list/insert at the top of the list avoid memmoves

2010-01-27 Thread showell
showell added the comment: I will attempt to fix insert(0, pop) in the next patch I submit (using pointer vs. orphans count). Just so we are clear on the performance that I'm promising, I expect benchmarks to prove out these facts: 1) New-list will always perform comparably to old-list, pa

[issue7753] newgil backport

2010-01-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The arguments given in that thread sound a bit strange to me: > just because there were no changes to a few files, doesn't really > say anything about whether they contain working code or not. That was a heuristic. Files which do not get any maintenance for y

[issue7795] BaseManager of multiprocessing module throws an exception if socket.setdefaulttimeout is set

2010-01-27 Thread Jonas Weismüller
Jonas Weismüller added the comment: uploading missing client file, changing the socket.setdefaulttimeout shows the issue. -- Added file: http://bugs.python.org/file16026/client.py ___ Python tracker __

[issue7795] BaseManager of multiprocessing module throws an exception if socket.setdefaulttimeout is set

2010-01-27 Thread Jonas Weismüller
New submission from Jonas Weismüller : If socket.setdefaulttimeout is set to any value (except None), the BaseManager raises an exception and the execution of the remote object fails: Traceback (most recent call last): File "client.py", line 16, in m = Manager() File "client.py", line 1

[issue1225769] Proposal to implement comment rows in csv module

2010-01-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: > Shouldn't the comment char definition belong in a dialect class? The proposed patch does this correctly; then csv.reader automatically accepts the dialect parameters to override the selected dialect. I'm still -1 on the feature - not standard enough, a

[issue5498] Can SGMLParser properly handle tags?

2010-01-27 Thread Éric Araujo
Éric Araujo added the comment: Damn, the URI got fubared :/ Anyway, I just wanted to give an example of the verbose error message, but the second link will contain enough explanation. Regards -- ___ Python tracker

[issue5498] Can SGMLParser properly handle tags?

2010-01-27 Thread Éric Araujo
Éric Araujo added the comment: Hello XML of the form are an SGML hack, or more precisely the combination of two features of SGML. The forward slash closes the tag, and the following angle bracket is character data, not part of the tag. The W3C validator uses a real SGML parser for HTML doc

[issue7753] newgil backport

2010-01-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > > Le mercredi 27 janvier 2010 à 10:37 +, Marc-Andre Lemburg a écrit : >> >> I find it rather strange that Python 3.x now only supports >> NT and POSIX threads in ceval while it still suppor

[issue1225769] Proposal to implement comment rows in csv module

2010-01-27 Thread Éric Araujo
Éric Araujo added the comment: Hello Shouldn't the comment char definition belong in a dialect class? The reader would still have to be modified to skip these lines, but having this char in the dialect would not require a change to csv.reader signature. Kind regards -- nosy: +Merwok

[issue1225769] Proposal to implement comment rows in csv module

2010-01-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Comment lines in csv data may be common in some areas, but they are not part of any standard, and they are not the only possible extension to csv files (for example: ignore empty lines, or a terminal \ for line continuation...) Currently all members of

[issue7794] Document zipfile and directory execution in What's New for 2.6/3.1

2010-01-27 Thread Nick Coghlan
New submission from Nick Coghlan : As discussed recently on python-dev, issue 1739468 deserves a mention in the What's New for the relevant Python releases. -- assignee: ncoghlan components: Documentation keywords: easy messages: 98420 nosy: akuchling, ncoghlan priority: normal severity

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2010-01-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Stefan Krah wrote: > > Stefan Krah added the comment: > > The builds are almost identical, so I attach a diff of the build output. > For both builds, I used a fresh Python-3.1.1 directory. This looks > suspicious: > > -checking whether va_list is an arra

[issue7753] newgil backport

2010-01-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le mercredi 27 janvier 2010 à 10:33 +, Marc-Andre Lemburg a écrit : > > It appears to be better to use clock_gettime(CLOCK_MONOTONIC) > where available and only use gettimeofday() as fallback solution > together with times(), ftime() and time(). Thanks for

[issue7753] newgil backport

2010-01-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le mercredi 27 janvier 2010 à 10:37 +, Marc-Andre Lemburg a écrit : > > I find it rather strange that Python 3.x now only supports > NT and POSIX threads in ceval while it still supports the > whole set of other thread implementations for the _thread > modu

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2010-01-27 Thread Stefan Krah
Changes by Stefan Krah : Added file: http://bugs.python.org/file16024/basecflags-vs-patch-3.1.1-builddiff.txt ___ Python tracker ___ ___ Py

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2010-01-27 Thread Stefan Krah
Changes by Stefan Krah : Removed file: http://bugs.python.org/file16023/basecflags-vs-patch-3.1.1-builddiff.txt ___ Python tracker ___ ___

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2010-01-27 Thread Stefan Krah
Stefan Krah added the comment: The builds are almost identical, so I attach a diff of the build output. For both builds, I used a fresh Python-3.1.1 directory. This looks suspicious: -checking whether va_list is an array... yes +checking whether va_list is an array... no For completeness' sak

[issue1225769] Proposal to implement comment rows in csv module

2010-01-27 Thread Mario Fasold
Mario Fasold added the comment: Comment lines are a *very* common case in scientific and statistical data. +1 for the change. -- nosy: +Mario.Fasold ___ Python tracker ___ __

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2010-01-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Stefan Krah wrote: > > Stefan Krah added the comment: > > Marc-Andre, > > on 64-bit Ubuntu, this method ... > > BASECFLAGS=-m32 LDFLAGS=-m32 ./configure > > ... results in a gcc segfault: > > > gcc -pthread -m32 -Xlinker -export-dynamic -o python \ >

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2010-01-27 Thread Stefan Krah
Stefan Krah added the comment: Marc-Andre, on 64-bit Ubuntu, this method ... BASECFLAGS=-m32 LDFLAGS=-m32 ./configure ... results in a gcc segfault: gcc -pthread -m32 -Xlinker -export-dynamic -o python \ Modules/python.o \ libpython3.2.a -lpth

[issue7753] newgil backport

2010-01-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Ross Cohen wrote: >> By the way, the new GIL only works with POSIX and Windows NT threading APIs. >> Perhaps it can't be backported at all to 2.x, given that 2.x supports more >> threading APIs than py3k does? > > Looking at the Python/thread_*.h files, i

[issue7753] newgil backport

2010-01-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Ross Cohen wrote: > > Ross Cohen added the comment: > > On Fri, 22 Jan 2010 09:32:36 + > Marc-Andre Lemburg wrote: > >> * Please add the fallback solutions from the time module in case >> gettimeofday() is not available. You cannot assume that "al

[issue7793] regrtest fails with "RuntimeError: maximum recursion depth exceeded" in some cases

2010-01-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The module is probably reloaded, which causes code like: _ord = ord def ord(c): ... _ord(c) ... to form a recursion loop. Attached patch removes the need for a special ord(). All this should be simply removed in py3k branch: ord() and chr(

[issue5673] Add timeout option to subprocess.Popen

2010-01-27 Thread Senthil Kumaran
Changes by Senthil Kumaran : -- nosy: +orsenthil ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue7793] regrtest fails with "RuntimeError: maximum recursion depth exceeded" in some cases

2010-01-27 Thread Chris Withers
Chris Withers added the comment: Can you try and list what the cases are which cause this failure to occur? -- nosy: +cjw296 ___ Python tracker ___ __

[issue7792] Errors registering non-classes with ABCs

2010-01-27 Thread Chris Withers
Chris Withers added the comment: ...and for the second feature, Andrew may wish to look at zope.component, which provides for this already. -- nosy: +cjw296 ___ Python tracker _