[issue10014] sys.path[0] is incorrect if PYTHONFSENCODING is used

2010-10-07 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: See also issue #10039. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10014 ___

[issue1943] improved allocation of PyUnicode objects

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Updated patch against current py3k. -- Added file: http://bugs.python.org/file19142/unialloc6.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1943

[issue9163] test_gdb fails

2010-10-07 Thread Tom Morris
Tom Morris tfmor...@gmail.com added the comment: Sorry, I misread the 'version' field as the version the fix was committed for, not the version the bug was reported against. The fix was reportedly fixed in r82648 and v2.7 is r82500. If there's ever a 2.7.1, I guess the fix will appear, but

[issue10014] sys.path[0] is incorrect if PYTHONFSENCODING is used

2010-10-07 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: The problem is that PySys_SetArgvEx() ... Not only PySys_SetArgvEx(). There is another issue with RunMainFromImporter() which do: sys.path[0] = filename -- ___ Python tracker

[issue2571] cmd.py always uses raw_input, even when another stdin is specified

2010-10-07 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Since 'we' can reopen any closed issue, I will try to answer what I think you might be asking. I closed this because of Daniel's suggestion coupled with the Richard disclaiming further interest and neither Raghuram nor any new responder

[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I don't know if there is a point or not, but some hosts are for some reason intended to be connected to using IP address and their certificates thus contains IP addresses. I think we should support that too, and I find it a bit confusing to

[issue2142] difflib.unified_diff(...) produces invalid patches

2010-10-07 Thread Trent Mick
Changes by Trent Mick tre...@gmail.com: -- assignee: - trentm ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2142 ___ ___ Python-bugs-list mailing

[issue10028] test_concurrent_futures fails on Windows Server 2003

2010-10-07 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: I'm getting error 6 aka ERROR_INVALID_HANDLE. I'll try to figure out what's going on later this week if I can find time. I'll also run this on my Server 2008 machine to see how works. -- ___ Python

[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Here is a new patch with doc updates and the corrections mentioned above. -- Added file: http://bugs.python.org/file19141/sslcheck2.patch ___ Python tracker rep...@bugs.python.org

[issue10039] python é.py fails with UnicodeEncodeErr or if PYTHONFSENCODING is used

2010-10-07 Thread STINNER Victor
New submission from STINNER Victor victor.stin...@haypocalc.com: If a program name contains a non-ascii character in its name and/or full path and PYTHONFSENCODING is set to an encoding different than the locale encoding, Python fails to open the program. Example in the utf-8 locale: $

[issue10038] Returntype of json.loads() on strings

2010-10-07 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. fdr...@acm.org added the comment: As I understand it, the decision to return str instead of unicode values for the simplejson module was simply inherited by the standard library. As such, it still needs to be evaluated in the context of the standard library, because of the

[issue10040] GZipFile failure on large files

2010-10-07 Thread Robert Rohde
New submission from Robert Rohde ro...@robertrohde.com: I attempted to use GZipFile to process a 1.93 GB file that expands to 18.8 GB. This consistently produces the same corrupted output file that has approximately, but not exactly, the right output file size. I bypassed GZipFile by calling

[issue10041] socket.makefile(mode = 'r').readline() silently removes carriage return

2010-10-07 Thread kai zhu
New submission from kai zhu kaizhu...@gmail.com: i'm working on an independent py2to3 utility which directly imports py2x modules, by reverse compiling ast trees (code.google.com/p/asciiporn/source/browse/stable.py) while forward porting the python2x redis client, this issue came up. i kno

[issue9759] GzipFile object should raise ValueError on .read() after .close()

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Patch committed in r85291 (3.x), and backported to 3.1 (r85293) and 2.7 (r85292). Thank you! -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker

[issue8584] test_multiprocessing skips some tests

2010-10-07 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: Fixed in r85299 (py3k), r85300 (release31-maint), and r85301 (release27-maint). -- assignee: jnoller - brian.curtin resolution: - fixed stage: patch review - committed/rejected status: open - closed versions: +Python 2.7

[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-10-07 Thread Mads Kiilerich
Mads Kiilerich m...@kiilerich.com added the comment: Indeed. But, strictly speaking, there are no tests for IPs, so it shouldn't be taken for granted that it works, even for commonName. The rationale is that there isn't really any point in using an IP rather a host name. I don't know if

[issue9003] urllib.request and http.client should allow certificate checking

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: A big warning is now present (*) in the urllib and httplib documentation pages. Also, once issue1589 is fixed, we can go forward and make {http.client,urllib.request} check hostname and cert if the user gives the location of a bunch of CA

[issue2571] cmd.py always uses raw_input, even when another stdin is specified

2010-10-07 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Can we reopen this as a feature request for 3.2? -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2571 ___

[issue10042] total_ordering stack overflow

2010-10-07 Thread Francesco Ricciardi
New submission from Francesco Ricciardi francesco.riccia...@hp.com: Tested with version 3.2a2. Not tested on version 2.7. The current implementation of functools.total_ordering generates a stack overflow because it implements the new comparison functions with inline operator, which the Python

[issue10042] total_ordering stack overflow

2010-10-07 Thread Francesco Ricciardi
Francesco Ricciardi francesco.riccia...@hp.com added the comment: Attached there is a solution of the problem, by implementing each comparison only with the class __xx__ and __eq__ operators. Also in the file there is a complete test suite for it. -- Added file:

[issue10038] Returntype of json.loads() on strings

2010-10-07 Thread Nik Tautenhahn
Nik Tautenhahn n...@livinglogic.de added the comment: Well, then at least the documentation and the What's changed need to be updated. Furthermore, if such decisions are made, it would be at least nice to have some general decode-hook for json.JSONDecoder - the object_hook is only used for

[issue10038] Returntype of json.loads() on strings

2010-10-07 Thread Nik Tautenhahn
Nik Tautenhahn n...@livinglogic.de added the comment: Yep, the solution should not be maybe it's str, maybe it's unicode - I mean, if the decoder gives you a str if there are no fancy characters and unicode if it contains some, this might lead to some confusion... And yes, in my opinion, this

[issue809163] Can't add files with spaces

2010-10-07 Thread Anders Sandvig
Changes by Anders Sandvig anders.sand...@gmail.com: -- nosy: +asandvig ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue809163 ___ ___

[issue10043] UnboundLocalError with local variable set by setattr, caused by code run later

2010-10-07 Thread Steven Samuel Cole
New submission from Steven Samuel Cole steven.samuel.c...@gmail.com: inside a function, I create a local variable by using setattr with the current module as object, as in setattr(modules[__name__], 'name', 'value') if I _later_ in the code set name to None, the attribute becomes unavailable

[issue10043] UnboundLocalError with local variable set by setattr, caused by code run later

2010-10-07 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: When python sees the assignment name = None, it assumes that 'name' is a local variable. This happens before any code is executed. It then sees that you're printing 'name' before it is assigned to, which is an error. It does not take into

[issue10014] sys.path[0] is incorrect if PYTHONFSENCODING is used

2010-10-07 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: This issue depends on issue #10039. -- dependencies: +python é.py fails with UnicodeEncodeError if PYTHONFSENCODING is used ___ Python tracker rep...@bugs.python.org

[issue10014] sys.path[0] is incorrect if PYTHONFSENCODING is used

2010-10-07 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: r85302: _wrealpath() and _Py_wreadlink() support surrogates in the input path. -- realpath_fs_encoding.patch: patch _wrealpath() to encode the resulting path with the filesystem encoding (with surrogateescape) instead of the

[issue10044] small int optimization

2010-10-07 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: This is an experimental patch to optimize some operations on small ints. pystone is 5-10% faster, pybench 2-3% faster, and here are some relevant benchmarks from unladen swallow: ### nbody ### Min: 0.345136 - 0.317502: 1.09x faster Avg:

[issue9800] Fast path for small int-indexing of lists and tuples

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I think the approach in issue10044 is better. -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9800 ___

[issue10043] UnboundLocalError with local variable set by setattr, caused by code run later

2010-10-07 Thread Steven Samuel Cole
Steven Samuel Cole steven.samuel.c...@gmail.com added the comment: I'm just a developer, I don't know anything about Python internals or what Python sees or does at what stage. Looking at the sample file, code executed later has an influence on code executed earlier - and that behavior is

[issue10043] UnboundLocalError with local variable set by setattr, caused by code run later

2010-10-07 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: It's a well documented behavior. Surely you ran across this link while researching your problem? http://docs.python.org/reference/executionmodel.html#naming-and-binding The paragraph beginning The following constructs bind names ... describes

[issue10041] socket.makefile(mode = 'r').readline() silently removes carriage return

2010-10-07 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: Isn't this just the normal universal newline handling? When you open it in binary mode you see all of the characters, but in text mode (the absence of b) you get normalized newlines (that is, they're converted to \n). -- components:

[issue10043] UnboundLocalError with local variable set by setattr, caused by code run later

2010-10-07 Thread Steven Samuel Cole
Steven Samuel Cole steven.samuel.c...@gmail.com added the comment: thank you very much for the clarification. i did indeed not come across the page you've linked to, mainly because i did not really know what to google for. actually, i do not recall ever looking into the python language

[issue10044] small int optimization

2010-10-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Arithmetic with void* pointers is not allowed by the Microsoft compilers. char* should be used instead. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org

[issue10030] Patch for zip decryption speedup

2010-10-07 Thread Shashank
Shashank shashank.sunny.si...@gmail.com added the comment: I have updated the patch with a check for the availability of C impl and to use pure-py impl as a fallback. How do you suggest would the tests change? As I had mentioned before, in my understanding since there is no change in the API

[issue10042] total_ordering stack overflow

2010-10-07 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- assignee: - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10042 ___

[issue10044] small int optimization

2010-10-07 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: How does performance change if you adjust NSMALLPOSINTS and NSMALLNEGINTS, but make no other changes? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10044

[issue10030] Patch for zip decryption speedup

2010-10-07 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: It is what is normally done *now* when there is both a C and a python implementation (see, for example, test_datetime.py and test_io.py for two different approaches to that). Not all tests have been updated to this practice. Thanks

[issue10044] small int optimization

2010-10-07 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Looks like a nice idea, at first glance, though I haven't looked at the code in detail. I like the use of the macros to abstract away the long implementation details. INPLACE_SUBTRACT_end, not INPLACE_SUBSTRACT_end, please! --

[issue10044] small int optimization

2010-10-07 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: +#define _PyLong_IS_SMALL_INT(v) \ +(((PyLongObject *)(v)) = _PyLong_small_ints \ + ((PyLongObject *)(v)) _PyLong_SMALL_INTS_END) +/* These macros purposedly avoid a cast to int, since it is most of time + useless, and sometimes

[issue10029] Equivalent to code for zip is wrong in Python 3

2010-10-07 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: As Daniel pointed out, the equivalent to code in builtins section comes from 2.x itertools documentation where and equivalent generator definition is presented for each function. While these definitions are helpful when

[issue10029] Equivalent to code for zip is wrong in Python 3

2010-10-07 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: I suggest removing the equivalent to code from the zip section and replacing it with an example showing how to use zip with a for loop similar to the example illustrating enumerate. +1 --

[issue8293] HTTPSConnection.close() does not immediately close the connection.

2010-10-07 Thread PoltoS
PoltoS polto...@alsenet.com added the comment: I've the with module ssl. If I do sock.close() (sock is instance of ssl.SSLSocket), the connection is not closed: I see it as Established in netstat and nothing is sent over network: tcpdump show nothing going thru the network. Python 2.6.5

[issue10044] small int optimization

2010-10-07 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Maybe we could consider adding an extra field to a PyLong giving its 'small_int' value for small values, and some flag value for non-small longs. An extra field wouldn't actually enlarge the size of a PyLong for small values---on a 64-bit

[issue8293] HTTPSConnection.close() does not immediately close the connection.

2010-10-07 Thread PoltoS
PoltoS polto...@alsenet.com added the comment: By the way, doing a sock.shutdown(socket.SHUT_RDWR) with a subsequent sock.close() helps to really close an SSL socket. But this may raise additional errors with subsequent close() since on some OS (like OS X) shutdown may close the socket. Am I

[issue10044] small int optimization

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Maybe we could consider adding an extra field to a PyLong giving its 'small_int' value for small values, and some flag value for non-small longs. An extra field wouldn't actually enlarge the size of a PyLong for small values---on a 64-bit

[issue10044] small int optimization

2010-10-07 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: I don't think arbitrary comparisons of pointers give well-defined results, unless those pointers both happen to point into the same array. (Might be wrong; I don't have a copy of the C standard to hand.) Technically

[issue5870] subprocess.DEVNULL

2010-10-07 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5870 ___ ___

[issue10029] Equivalent to code for zip is wrong in Python 3

2010-10-07 Thread Max
Max maxmo...@gmail.com added the comment: Personally, I find it impossible in some cases to understand exactly what a function does just from reading a textual description. In those cases, I always refer to the equivalent code if it's given. In fact that's the reason I was looking going the

[issue10044] small int optimization

2010-10-07 Thread Eric Smith
Changes by Eric Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10044 ___ ___ Python-bugs-list

[issue10045] poor cStringIO.StringO seek performance

2010-10-07 Thread Patrick Strawderman
New submission from Patrick Strawderman patr...@zope.com: cStringIO.StringO's seek method has O(n) characteristics in certain, albeit pathological, cases, while the pure Python implementation and cStringIO.StringI's seek methods both execute in constant time in all cases. When the file offset

[issue10045] poor cStringIO.StringO seek performance

2010-10-07 Thread Patrick Strawderman
Changes by Patrick Strawderman patr...@zope.com: -- components: +None type: - performance ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10045 ___

[issue10045] poor cStringIO.StringO seek performance

2010-10-07 Thread Patrick Strawderman
Changes by Patrick Strawderman patr...@zope.com: -- components: -None ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10045 ___ ___

[issue10045] poor cStringIO.StringO seek performance

2010-10-07 Thread Patrick Strawderman
Patrick Strawderman patr...@zope.com added the comment: The second sentence should have said the gap is filled in with n null bytes -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10045 ___

[issue2142] difflib.unified_diff(...) produces invalid patches

2010-10-07 Thread Trent Mick
Trent Mick tre...@gmail.com added the comment: c.f. some discussion on python-dev here: http://mail.python.org/pipermail/python-dev/2010-October/104501.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2142

[issue10045] poor cStringIO.StringO seek performance

2010-10-07 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10045 ___ ___ Python-bugs-list

[issue10045] poor cStringIO.StringO seek performance

2010-10-07 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I'm changing the versions to just 2.7 (though I'm not sure this can be considered a bug fix), since StringIO is reimplemented as part of io in 3.x. -- nosy: +r.david.murray versions: -Python 2.6, Python 3.1, Python 3.2, Python

[issue10044] small int optimization

2010-10-07 Thread Aahz
Changes by Aahz a...@pythoncraft.com: -- nosy: -Aahz, aahz ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10044 ___ ___ Python-bugs-list mailing

[issue10044] small int optimization

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Technically arbitrary relational comparisons of pointers are undefined, but in practice Antoine's assumptions here are very modest. They boil down to: v = array[0] v array[array_len] I can't say anything about the standard, but p q

[issue10042] total_ordering stack overflow

2010-10-07 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Thanks, this is a good idea. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10042 ___

[issue10029] Equivalent to code for zip is wrong in Python 3

2010-10-07 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I'll update the docs with an equivalent that works and that has a comment showing when the StopIteration is raised and caught. -- ___ Python tracker rep...@bugs.python.org

[issue7285] multiprocessing module, example code error

2010-10-07 Thread Sandro Tosi
Sandro Tosi sandro.t...@gmail.com added the comment: Hello, i've verified that the problem still exists in an up-to-date py3k branch, and that the proposed patch indeed fixes the bug. Since the patch no more applies cleanly, I've refreshed it, and also added additional information about

[issue10044] small int optimization

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: How does performance change if you adjust NSMALLPOSINTS and NSMALLNEGINTS, but make no other changes? It makes a very small difference (which is understandable since it doesn't cut down on code execution a lot). --

[issue10044] small int optimization

2010-10-07 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Technically arbitrary relational comparisons of pointers are undefined, but in practice Antoine's assumptions here are very modest. I disagree: there's a very real practical danger here. Namely, optimizing compilers are free to assume

[issue10044] small int optimization

2010-10-07 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I can't say anything about the standard, but p q looks like it should be the same as (p - q) 0 Yep. which looks rather well-defined for pointers. Nope. It's only well-defined for pointers pointing into the same array (or to one past

[issue6417] multiprocessing Process examples: print and getppid

2010-10-07 Thread Sandro Tosi
Sandro Tosi sandro.t...@gmail.com added the comment: Hello, indentation problem has been fixed in r79901 and py3k syntax has been fixed in r74764. wrt os.getppid(), in the documentation it's stated that with 3.2 it added support for windows too: I'd like someone running a windows box (I don't

[issue10044] small int optimization

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Nope. It's only well-defined for pointers pointing into the same array (or to one past the end of an array). Otherwise it's undefined behaviour. How can the compiler tell whether two pointers are into the same array? That sounds like an

[issue10044] small int optimization

2010-10-07 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: How can the compiler tell whether two pointers are into the same array? That sounds like an undecidable criterion. It doesn't have to be able to tell---it's allowed to assume. :-) -- ___ Python

[issue10044] small int optimization

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: How can the compiler tell whether two pointers are into the same array? That sounds like an undecidable criterion. It doesn't have to be able to tell---it's allowed to assume. :-) That doesn't very clear or understandable. --

[issue10044] small int optimization

2010-10-07 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: In the bad old days of 386 segment:offset memory architectures this was a problem. You could have overlapping segments but pointers inside an object were always in the same segment, so the segment selectors never had to be inspected. Pointers

[issue10044] small int optimization

2010-10-07 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: See the example above: suppose that a compiler is looking at a (p = q) comparison of pointers. Suppose furthermore that in a particular case that compiler is smart enough to figure out that q is a pointer to the start of an array. Then

[issue10044] small int optimization

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: In the bad old days of 386 segment:offset memory architectures this was a problem. You could have overlapping segments but pointers inside an object were always in the same segment, so the segment selectors never had to be inspected. Pointers

[issue10046] Correction to atexit documentation

2010-10-07 Thread Jason Baker
New submission from Jason Baker amnorv...@gmail.com: There's an issue with the documentation on the atexit module[1]. It states: Note: the functions registered via this module are not called when the program is killed by a signal, when a Python fatal internal error is detected, or when

[issue10044] small int optimization

2010-10-07 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: How is the compiler supposed to know whether a and b belong to the same array when compiling ptr_compare? It doesn't need to know. So long as the compiler can guarantee that its code will produce correct results in the case that a and b

[issue10044] small int optimization

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: See the example above: suppose that a compiler is looking at a (p = q) comparison of pointers. Suppose furthermore that in a particular case that compiler is smart enough to figure out that q is a pointer to the start of an array. Which

[issue10044] small int optimization

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: In other words, when producing code for ptr_compare, the compiler is allowed to *assume* that a and b point into the same array, and act accordingly. But this assumption doesn't bring *anything*, right? That is, there is no shortcut way to

[issue10044] small int optimization

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: For the record, a Py_uintptr_t version works and has the same performance. Would you agree to it or is there still some menacing oddity from the i386 days lurking around? -- ___ Python tracker

[issue10044] small int optimization

2010-10-07 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: For the record, a Py_uintptr_t version works and has the same performance. Would you agree to it or is there still some menacing oddity from the i386 days lurking around? Technically, it's still dodgy: as the gcc manual notes in:

[issue10045] poor cStringIO.StringO seek performance

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I don't think there's much point in fixing this. 2.7 users can use io.BytesIO, which is a fast type implemented in C. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10045

[issue6825] Minor documentation bug with os.path.split

2010-10-07 Thread Sandro Tosi
Sandro Tosi sandro.t...@gmail.com added the comment: Hello, I find the proposed text change good, and so here's a patch to add that in a bit different format (sorry it's quite of a mess, but I took the occasion to wrap that paragraph to 80th column). Regards, Sandro -- keywords:

[issue10041] socket.makefile(mode = 'r').readline() silently removes carriage return

2010-10-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: As Eric said. Please see the socket.makefile doc: “Return a file object associated with the socket. The exact returned type depends on the arguments given to makefile(). These arguments are interpreted the same way as by the built-in open()

[issue10047] python-2.6.6 coredump running newspipe

2010-10-07 Thread Thomas Klausner
New submission from Thomas Klausner t...@giga.or.at: I'm running newspipe-1.1.9, an RSS reader (http://newspipe.sourceforge.net/), on NetBSD-5.99.11/amd64 using Python-2.6.6. Sometimes, it core dumps with particular feeds in the configuration (I guess depending on the feed, because when I

[issue10014] sys.path[0] is incorrect if PYTHONFSENCODING is used

2010-10-07 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I just created Python/fileutils.c: update the patch for this new file. -- Added file: http://bugs.python.org/file19153/realpath_fs_encoding-2.patch ___ Python tracker

[issue10014] sys.path[0] is incorrect if PYTHONFSENCODING is used

2010-10-07 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file19147/realpath_fs_encoding.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10014 ___

[issue6612] 'import site' fails when called from an unlinked directory

2010-10-07 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: There was a bug in copy_absolute(): if _Py_wgetcwd() failed, the result was undefined (depending of the content of path buffer). Especially, absolutize() calls copy_absolute() with a buffer allocated on the stack: the content of

[issue6612] 'import site' fails when called from an unlinked directory

2010-10-07 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: deleted_cwd.patch, patch based on labrat's patch updated to py3k: http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/python/rev/77f3ad10ba45 Procedure to test the patch: - go into Python source tree - make a directory z -

[issue4907] ast.literal_eval does not properly handled complex numbers

2010-10-07 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Fixed handling on unary minus in r85314. In so doing, it also liberalized what literal_eval() accepts (3j+4 for example). This simplified the implementation and removed an unnecessary restriction which wasn't needed for

[issue10046] Correction to atexit documentation

2010-10-07 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: It is possible this behavior changed after the docs were written. I'm adding a couple of people to nosy who might have some insight into that possibility. It could be either a change in finalization procedures or a change in signal

[issue10047] python-2.6.6 coredump running newspipe

2010-10-07 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Indeed, newspipe appears to be a pure python package, so this looks like it is probably a bug in python somewhere. You might want to report it to newspipe too, though. They are likely to be able to figure out how to reduce the problem

[issue10047] python-2.6.6 coredump running newspipe

2010-10-07 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Can you reproduce this using python2.7? Python 2.6 is in security fix only mode now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10047

[issue10046] Correction to atexit documentation

2010-10-07 Thread Adam Olsen
Adam Olsen rha...@gmail.com added the comment: Signals can directly kill a process. Try SIGTERM to see this. SIGINT is caught and handled by Python, which just happens to default to a graceful exit (unless stuck in a lib that prevents that.) Try pasting your script into an interactive

[issue6825] Minor documentation bug with os.path.split

2010-10-07 Thread Evan Driscoll
Evan Driscoll eva...@gmail.com added the comment: Hah, I totally forgot about this thing. I'd suggest a change to the proposed patch. The patched version says: In nearly all cases, ``join(head, tail)`` returns a location equivalent to *path* (the only exception being when there were

[issue4661] email.parser: impossible to read messages encoded in a different encoding

2010-10-07 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Here is an updated patch incorporating the reitveld feedback and feedback from python-dev about the API. Now we have BytesParser instead of Parser with a parsebytes method, and a message_from_binary_file helper. Generator also now

[issue10041] socket.makefile(mode = 'r').readline() silently removes carriage return

2010-10-07 Thread kai zhu
kai zhu kaizhu...@gmail.com added the comment: my bad for not rtfm, but it seems the newline argument has no effect in socket.makefile. the TextIOWrapper signatures don't seem to match. a hack to put newline parameter in 4th position or making it a keyword arg doesn't work either (scratch

[issue10041] socket.makefile(mode = 'r').readline() silently removes carriage return

2010-10-07 Thread kai zhu
kai zhu kaizhu...@gmail.com added the comment: my bad again, hacking newline parameter to the correct argument position works (its in the position where error should b). a one line patch would be: socket.py line 163 -text = io.TextIOWrapper(buffer, encoding, newline) +text =

[issue10041] socket.makefile(mode = 'r').readline() silently removes carriage return

2010-10-07 Thread kai zhu
Changes by kai zhu kaizhu...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file19156/socket.makefile.newline.kwarg.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10041

[issue1777412] Python's strftime dislikes years before 1900

2010-10-07 Thread kiorky
kiorky kio...@cryptelium.net added the comment: This patch doesnt apply anymore on py26. Joining an updated patch. -- Added file: http://bugs.python.org/file19157/strftime-pre-1900.patch ___ Python tracker rep...@bugs.python.org

[issue10040] GZipFile failure on large files

2010-10-07 Thread Ned Deily
Ned Deily n...@acm.org added the comment: Since you mention 7-zip, does that mean you are seeing the problem on a Windows platform? If so, exactly which version of Windows and what kind of system? Also, unless someone recognizes this as a duplicate of an earlier issue, there may not be much