[issue1537721] csv module: add header row to DictWriter

2009-04-18 Thread Matthew Iversen
Matthew Iversen added the comment: Skip, you were arguing in another csv issue on a NamedTupleReader that the Reader and Writer should work in concert together. Certainly, making this default functionality for DictWriter would definitely make it work more in concert with DictReader. A sample p

[issue5790] itertools.izip python code has a typo

2009-04-18 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: georg.brandl -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list ma

[issue5790] itertools.izip python code has a typo

2009-04-18 Thread Steven D'Aprano
New submission from Steven D'Aprano : In the documentation for itertools, the Python equivalent to izip has a typo: yield yield tuple(map(next, iterables)) Obviously should only have a single yield. http://docs.python.org/library/itertools.html#itertools.izip -- assignee: georg.brand

[issue5789] powerset recipe listed twice in itertools docs

2009-04-18 Thread Steven D'Aprano
New submission from Steven D'Aprano : In the itertools recipes section of the docs, powerset() is listed twice. http://docs.python.org/library/itertools.html#recipes -- assignee: georg.brandl components: Documentation messages: 86155 nosy: georg.brandl, stevenjd severity: normal status

[issue5787] object.__getattribute__(super, '__bases__') crashes the interpreter.

2009-04-18 Thread Benjamin Peterson
Benjamin Peterson added the comment: Fixed the ones applicable to 2.7/2.6 in r71738. These fixes won't be backported to 2.4/2.5. -- status: open -> closed ___ Python tracker ___

[issue5786] len(reversed([1,2,3])) does not work anymore in 2.6.2

2009-04-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: It's up to you guys. I had thought to change it only for Py2.7 but Guido probably considers it to be a bug, so possibly the backport was justified. -- assignee: rhettinger -> status: closed -> open ___ Python tr

[issue5787] object.__getattribute__(super, '__bases__') crashes the interpreter.

2009-04-18 Thread Aleksi Torhamo
Aleksi Torhamo added the comment: Stumbled upon a few more. python2.4/2.5: socket.SSLType re._pattern_type weakref.ProxyType weakref.CallableProxyType python2.6/2.7: weakref.ProxyType weakref.CallableProxyType python3.0: weakref.ProxyType weakref.CallableProxyType _abcoll.dict_proxy I'll also

[issue5734] Fix BufferedRWPair

2009-04-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Committed in r71736. -- resolution: accepted -> fixed status: open -> closed ___ Python tracker ___

[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-04-18 Thread Elliot Murphy
Changes by Elliot Murphy : -- nosy: +statik ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue5734] Fix BufferedRWPair

2009-04-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch looks ok, thanks. -- resolution: -> accepted stage: patch review -> commit review ___ Python tracker ___

[issue1580] Use shorter float repr when possible

2009-04-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: The advantage is accuracy. No double rounding. This will also help the math.fsum() function that is also susceptible to double rounding. -- ___ Python tracker

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Sorry for the last comment about unit tests, they are here actually :-) -- ___ Python tracker ___ __

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- priority: -> normal stage: -> patch review type: -> feature request ___ Python tracker ___ ___ Python

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: The addition looks quite legitimate to me. The only thing is that it may be better as a method (total_seconds()) rather than an attribute, given the other APIs in the datetime module. Also, the patch lacks some unit tests. -- nosy: +pitrou versions: +Py

[issue1580] Use shorter float repr when possible

2009-04-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Is there a way to use SSE when available and x86 when it's not. Probably, but I don't think there is any point doing so. The main benefit of SSE2 is to get higher performance on floating point intensive code, which no pure Python code could be regarded as (th

[issue5786] len(reversed([1,2,3])) does not work anymore in 2.6.2

2009-04-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Uh, perhaps the behaviour wasn't optimal but breaking compatibility between two bugfix releases isn't developer-friendly either. While we could keep it in trunk, it sounds like the change should be reverted in 2.6. The backport to 2.6 was done by Georg in r6756

[issue1580] Use shorter float repr when possible

2009-04-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: Is there a way to use SSE when available and x86 when it's not. IIRC, floating point used to work that way (using a C lib as a fallback on systems w/o coprocessor support). -- ___ Python tracker

[issue5786] len(reversed([1,2,3])) does not work anymore in 2.6.2

2009-04-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: Guido decided that iterators should not support len() because he wanted bool(it) to always be True. -- resolution: -> invalid status: open -> closed ___ Python tracker

[issue5787] object.__getattribute__(super, '__bases__') crashes the interpreter.

2009-04-18 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue5787] object.__getattribute__(super, '__bases__') crashes the interpreter.

2009-04-18 Thread Benjamin Peterson
Benjamin Peterson added the comment: The rest should be fixed in r71734. -- ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue1580] Use shorter float repr when possible

2009-04-18 Thread Mark Dickinson
Mark Dickinson added the comment: SSE2 detection and flags removed in r71723. We'll see how the buildbots fare... -- ___ Python tracker ___

[issue5787] object.__getattribute__(super, '__bases__') crashes the interpreter.

2009-04-18 Thread Aleksi Torhamo
Aleksi Torhamo added the comment: Just verified that r71722 fixes all the builtins, however i just noticed that some types under module types cause segfaults too. Under python2.7 those are: CodeType BuiltinMethodType DictProxyType GeneratorType GetSetDescriptorType EllipsisType FrameType Instan

[issue5787] object.__getattribute__(super, '__bases__') crashes the interpreter.

2009-04-18 Thread Aarni Koskela
Aarni Koskela added the comment: The r71722 patch has several typos (replace initalize with initialize). -- nosy: +akx ___ Python tracker ___

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Brian Quinlan
Brian Quinlan added the comment: OK, a bit on motivation: 1. datetime.timedelta instances are a convenient way of representing durations 2. datetime.timedelta instances cannot be conveniently used in many calculations e.g. calculating distance based on velocity and time 3. datetime.timedel

[issue5787] object.__getattribute__(super, '__bases__') crashes the interpreter.

2009-04-18 Thread Benjamin Peterson
Benjamin Peterson added the comment: Should be fixed in r71722. -- nosy: +benjamin.peterson resolution: -> fixed status: open -> closed ___ Python tracker ___ __

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Georg Brandl
Georg Brandl added the comment: I saw the patch description as well, but usually you put that description, and perhaps a motivation as well, in the comment. That way it's easier for people to directly see what an issue is about. -- ___ Python tracker

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Brian Quinlan
Brian Quinlan added the comment: I did add a patch description: "Adds a datetime.total_seconds attribute" - is that unclear? The idea is that you should be able to extract the total number of seconds in the duration i.e. >>> dt = datetime.timedelta(seconds=1234567.89) >>> dt.total_seconds 12345

[issue5771] SA bugs with unittest...@r71263

2009-04-18 Thread Benjamin Peterson
Benjamin Peterson added the comment: Fixed in r71721. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Pytho

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Georg Brandl
Georg Brandl added the comment: Please include a proper description of your problem, and a patch description when you post a patch. -- nosy: +georg.brandl ___ Python tracker ___

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Brian Quinlan
Changes by Brian Quinlan : -- keywords: +patch Added file: http://bugs.python.org/file13719/totalseconds.diff ___ Python tracker ___ __

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Brian Quinlan
New submission from Brian Quinlan : ...in seconds-based library functions (e.g. time.sleep) and calculations (e.g. distance = velocity * ?). -- components: Library (Lib) messages: 86132 nosy: bquinlan severity: normal status: open title: datetime.timedelta is inconvenient to use... versi

[issue1580] Use shorter float repr when possible

2009-04-18 Thread Mark Dickinson
Mark Dickinson added the comment: Perhaps better to drop the SSE2 bits completely. Anybody who actually wants SSE2 instructions in their binary can do a CC="gcc -msse2 -mfpmath=sse" configure && ... Unless there are objections, I'll drop everything involving SSE2 from the configure script.

[issue5786] len(reversed([1,2,3])) does not work anymore in 2.6.2

2009-04-18 Thread Georg Brandl
Georg Brandl added the comment: Raymond, this was your change in r67478 (backported to trunk in r67498). -- nosy: +georg.brandl ___ Python tracker ___ ___

[issue5786] len(reversed([1,2,3])) does not work anymore in 2.6.2

2009-04-18 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue1580] Use shorter float repr when possible

2009-04-18 Thread Mark Dickinson
Mark Dickinson added the comment: Yes, I think you're right. Perhaps the SSE2 support should be turned into an --enable-sse2 configure option, that's disabled by default? One problem with this is that I don't know how to enable SSE2 instructions for compilers other than gcc, so the option w

[issue3633] float.fromhex discrepancy under Solaris

2009-04-18 Thread Mark Dickinson
Mark Dickinson added the comment: A postscript: looking back at this from afar, the original error was almost certainly due to a missing Py_CHARMASK around the arguments to isdigit and isxdigit, and nothing to do with Unicode fullwidth digits at all. -- _

[issue1580] Use shorter float repr when possible

2009-04-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Hello folks, IIUC, autoconf tries to enable SSE2 by default without asking. Isn't it a problem for people distributing Python binaries (e.g. Linux vendors) and expecting these binaries to work on legacy systems even though the system on which the binaries were

[issue5787] object.__getattribute__(super, '__bases__') crashes the interpreter.

2009-04-18 Thread Aleksi Torhamo
New submission from Aleksi Torhamo : object.__getattribute__(super, '__bases__') crashes the interpreter. It seems to happen at Objects/typeobject.c in type_get_bases(), when tp_bases is NULL. Crashing types in __builtins__ per version would seem to be: python2.4: slice frozenset super staticme

[issue5410] msvcrt bytes cleanup

2009-04-18 Thread STINNER Victor
STINNER Victor added the comment: > MSDN says _ungetwch returns WEOF instead of EOF when error occurs. Ok, I updated my patch (to use WEOF). -- Added file: http://bugs.python.org/file13718/msvcrt_wchar-2.patch ___ Python tracker

[issue5410] msvcrt bytes cleanup

2009-04-18 Thread STINNER Victor
STINNER Victor added the comment: > I cannot see any remarks about masking behavior. :-( I asked on a french Windows developer channel. The answer is that the Windows terminal uses "ANSI" charset even if it's possible to use unicode. So it's a bug in Microsoft msvcrt library (directly in the

[issue5786] len(reversed([1,2,3])) does not work anymore in 2.6.2

2009-04-18 Thread Martin v. Löwis
Changes by Martin v. Löwis : -- components: -Windows ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue2531] float compared to decimal is silently incorrect.

2009-04-18 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: marketdickinson -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue2531] float compared to decimal is silently incorrect.

2009-04-18 Thread Mark Dickinson
Mark Dickinson added the comment: Unassigning myself. Does anyone beside Raymond and me have strong opinions about how/whether this problem should be fixed? -- ___ Python tracker _

[issue5786] len(reversed([1,2,3])) does not work anymore in 2.6.2

2009-04-18 Thread seesee
New submission from seesee : It seems python 2.6.2 (at least under Windows, I have not tested other platforms) does break the len function on the reversed iterator: Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "licen

[issue1944] Documentation for PyUnicode_AsString (et al.) missing.

2009-04-18 Thread Lorenz Quack
Lorenz Quack added the comment: Ok, here is my shot at a patch for at least some of the undocumented functions. Namely the following functions are being documented in the patch: PyUnicode_FromFormat PyUnicode_FromFormatV PyUnicode_FromString PyUnicode_FromStringAndSize PyUnicode_Parti

[issue1538691] Patch cElementTree to export CurrentLineNumber

2009-04-18 Thread Robin Bryce
Robin Bryce added the comment: > In the upstream 1.0.6, the ParseError exception has a position attribute > that contains a (line, column) tuple. That's fine for errors in the xml domain. Its not enough if I'm reporting errors in the application domain - where I wont have a handy exception to i

[issue1869] Builtin round function is sometimes inaccurate for floats

2009-04-18 Thread Mark Dickinson
Mark Dickinson added the comment: The two problems mentioned above have now been fixed in r71715. There are (at least) two remaining problems with the round function in 2.x that I'm not going to fix, because the added complication doesn't seem worth it. (1) round(x, n) doesn't give correct re

[issue5785] Condition.wait() does not respect its timeout

2009-04-18 Thread Stéphane
New submission from Stéphane : I have an issue with the wait() method of Condition which doesn't seem to respect the timeout it is given: I couldn't create a simple example to reproduce the bug, because if I try to do something small and simple everything works as expected, but in the actual c

[issue1869] Builtin round function is sometimes inaccurate for floats

2009-04-18 Thread Mark Dickinson
Mark Dickinson added the comment: I take that back. The 2.7 round still has some problems. Here's one example: >>> x = 5e15 + 1 # exactly representable as an IEEE 754 double >>> x 5001.0 >>> round(x) 5002.0 Another nit: >>> round(-0.0, 0) # should retain the sign of

[issue1944] Documentation for PyUnicode_AsString (et al.) missing.

2009-04-18 Thread Lorenz Quack
Lorenz Quack added the comment: In addition to the above mentioned functions I found these to be undocumented: PyUnicode_DecodeUTF7 PyUnicode_DecodeUTF7Stateful PyUnicode_EncodeDecimal PyUnicode_EncodeUTF7 PyUnicode_FromFormat PyUnicode_FromString PyUnicode_FromStringAndSize PyU

[issue1869] Builtin round function is sometimes inaccurate for floats

2009-04-18 Thread Mark Dickinson
Mark Dickinson added the comment: Closing this. I think 2.7 is fine as it is. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue1869] Builtin round function is sometimes inaccurate for floats

2009-04-18 Thread Mark Dickinson
Mark Dickinson added the comment: Fixed in py3k in r71701. Some of this fix can be backported to 2.7. -- versions: -Python 3.1 ___ Python tracker ___ __

[issue5739] Language reference is ambiguous regarding next() method lookup

2009-04-18 Thread Nick Coghlan
Nick Coghlan added the comment: Guido didn't actually say whether or not this was originally just an implementation accident or a deliberate design choice - he just indicated that this was a case where caching the bound method should be disallowed because it could change the semantics of existin

[issue5781] Legacy float repr is used unnecessarily on some platforms

2009-04-18 Thread Mark Dickinson
Mark Dickinson added the comment: Fixed in r71698. -- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed ___ Python tracker ___ ___

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-04-18 Thread Trundle
Trundle added the comment: The problem is that `type_setattro()` sets the new "__new__" attribute in the type's dict (through `PyObject_GenericSetAttr()`), but the corresponding slot will never be updated if the new "__new__" is a PyCFunction. The affected code in `update_one_slot()` was added

[issue5760] __getitem__ error message hard to understand

2009-04-18 Thread Georg Brandl
Georg Brandl added the comment: I concur. I changed "unsubscriptable" to "not subscriptable" in r71696. -- nosy: +georg.brandl resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue3102] ctypes defines global symbols

2009-04-18 Thread Thomas Heller
Thomas Heller added the comment: Correction: The patch has 3000 lines, not 300. And I think that the 'My_Unicode_...' functions can be removed because they are not used anywhere. I have to check this. -- ___ Python tracker

[issue5777] unable to search in python V3 documentation

2009-04-18 Thread Georg Brandl
Georg Brandl added the comment: Thanks for the report, searching for dotted identifiers is implemented now in the trunk version of Sphinx. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue5734] Fix BufferedRWPair

2009-04-18 Thread Brian Quinlan
Brian Quinlan added the comment: http://codereview.appspot.com/40126/diff/1/2 File Lib/_pyio.py (left): http://codereview.appspot.com/40126/diff/1/2#oldcode370 Line 370: def _checkReadable(self, msg=None): On 2009/04/17 21:11:15, Antoine Pitrou wrote: > Not sure why you're removing it. Currentl

[issue5734] Fix BufferedRWPair

2009-04-18 Thread Brian Quinlan
Changes by Brian Quinlan : Added file: http://bugs.python.org/file13716/rwpair2.diff ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue5777] unable to search in python V3 documentation

2009-04-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: You should have searched for "sys argv" since "sys.argv" is not 'a word'. However, that would not have worked since multiple word searching seems to be broken, at least sometimes. In particular, searching for 'argv' gives several hits, including the one you wa

[issue5760] __getitem__ error message hard to understand

2009-04-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: As I said on the python-ideas discussion, which definitely did *not* come to consensus, I disagree with this suggestion. To repeat and expand on what I said there: 1. 'unsubscriptable' could instead be changed to 'not subscriptable'. 2. 'subscription' *is* th