[issue2389] Array pickling exposes internal memory representation of elements

2008-08-14 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: I'm all in for a standardized representation of array's pickles (with width and endianness preserved). However to happen, we will either need to change array's constructor to support at least the byte-order specification (like struct) or

[issue2389] Array pickling exposes internal memory representation of elements

2008-08-14 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: I think changing the array constructor is fairly easy: just pick a set of codes that are defined to be platform-neutral (i.e. for each size two codes, one for each endianness). For example, the control characters (\0..\x1F) could be used in

[issue2756] urllib2 add_header fails with existing unredirected_header

2008-08-14 Thread Senthil
Senthil [EMAIL PROTECTED] added the comment: The submitted patch has problems. It does not correctly solve this issue (which I want to confirm, if there is issue at all after understanding the logic behind unredirected_headers). My explanation of this issue and comments on the patch is here:

[issue2756] urllib2 add_header fails with existing unredirected_header

2008-08-14 Thread Senthil
Senthil [EMAIL PROTECTED] added the comment: The problem with the patch was: The attached patch modifies the add_header() and add_unredirected_header() method to remove the existing headers of the same name alternately in the headers and unredirected_hdrs. What we observe is unredirected_hdrs

[issue2065] trunk version does not compile with vs8 and vc6

2008-08-14 Thread Hirokazu Yamamoto
Hirokazu Yamamoto [EMAIL PROTECTED] added the comment: Can I close this entry? ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2065 ___ ___ Python-bugs-list

[issue2065] trunk version does not compile with vs8 and vc6

2008-08-14 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: Sure. Feel free to commit any further changes to these build files directly. -- status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2065

[issue3439] math.frexp and obtaining the bit size of a large integer

2008-08-14 Thread Mark Dickinson
Mark Dickinson [EMAIL PROTECTED] added the comment: With the patch, the following code causes a non-keyboard-interruptible interpreter hang. from sys import maxint (-maxint-1).numbits() [... interpreter hang ...] The culprit is, of course, the statement if (n 0) n = -n; in

[issue3439] math.frexp and obtaining the bit size of a large integer

2008-08-14 Thread Mark Dickinson
Mark Dickinson [EMAIL PROTECTED] added the comment: One possible fix would be to compute the absolute value of n as an unsigned long. I *think* the following is portable and avoids any undefined behaviour coming from signed arithmetic overflow. unsigned long absn; if (n 0) absn = 1 +

[issue3545] Python turning off assertions (Windows)

2008-08-14 Thread Anders Bensryd
Anders Bensryd [EMAIL PROTECTED] added the comment: We started using Python 2.5.2 recently and a few developers have complained that they do not get any assertions anymore so yes, we do use _ASSERT() and _ASSERTE(), but after a brief look it seems as if we mainly use assert(). The developer

[issue2819] Full precision summation

2008-08-14 Thread Mark Dickinson
Mark Dickinson [EMAIL PROTECTED] added the comment: Here's a patch, in final form, that replaces fsum with an lsum-based implementation. In brief, the accumulated sum-so-far is represented in the form huge_integer * 2**(smallest_possible_exponent) and the huge_integer is stored in base

[issue3551] multiprocessing.Pipe terminates with ERROR_NO_SYSTEM_RESOURCES if large data is sent (win2000)

2008-08-14 Thread Hirokazu Yamamoto
New submission from Hirokazu Yamamoto [EMAIL PROTECTED]: I noticed sometimes regrtest.py fails in test_multiprocessing.py (test_connection) on win2000. I could not reproduce error by invoking test_multiprocessing alone, but finally I could do it by incresing 'really_big_msg' to 32MB or more. I

[issue3551] multiprocessing.Pipe terminates with ERROR_NO_SYSTEM_RESOURCES if large data is sent (win2000)

2008-08-14 Thread Hirokazu Yamamoto
Hirokazu Yamamoto [EMAIL PROTECTED] added the comment: This is traceback when run reproducable.py. Traceback (most recent call last): File string, line 1, in module File e:\python-dev\trunk\lib\multiprocessing\forking.py, line 341, in main prepare(preparation_data) File

[issue2819] Full precision summation

2008-08-14 Thread Mark Dickinson
Changes by Mark Dickinson [EMAIL PROTECTED]: Removed file: http://bugs.python.org/file10988/fsum7.patch ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2819 ___

[issue2819] Full precision summation

2008-08-14 Thread Mark Dickinson
Changes by Mark Dickinson [EMAIL PROTECTED]: Removed file: http://bugs.python.org/file11008/fsum8.patch ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2819 ___

[issue2819] Full precision summation

2008-08-14 Thread Mark Dickinson
Changes by Mark Dickinson [EMAIL PROTECTED]: Removed file: http://bugs.python.org/file11014/fsum10.patch ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2819 ___

[issue3300] urllib.quote and unquote - Unicode issues

2008-08-14 Thread Matt Giuca
Matt Giuca [EMAIL PROTECTED] added the comment: Ah cheers Antoine, for the tip on using defaultdict (I was confused as to how I could access the key just by passing defaultfactory, as the manual suggests). ___ Python tracker [EMAIL PROTECTED]

[issue3550] Socket Python 3k Documentation mistake OR Unicode string is not supported with socket.send

2008-08-14 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: Thanks, fixed the docs to refer to bytes objects in r65674. -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3550

[issue3546] Missing linebreak in ext.doctest output

2008-08-14 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: Thanks, applied in r65675. -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3546 ___

[issue3300] urllib.quote and unquote - Unicode issues

2008-08-14 Thread Matt Giuca
Matt Giuca [EMAIL PROTECTED] added the comment: OK I implemented the defaultdict solution. I got curious so ran some rough speed tests, using the following code. import random, urllib.parse for i in range(0, 10): str = ''.join(chr(random.randint(0, 0x10)) for _ in range(50))

[issue3551] multiprocessing.Pipe terminates with ERROR_NO_SYSTEM_RESOURCES if large data is sent (win2000)

2008-08-14 Thread Hirokazu Yamamoto
Hirokazu Yamamoto [EMAIL PROTECTED] added the comment: After googling, ERROR_NO_SYSTEM_RESOURCES seems to happen when one I/O size is too large. And in Modules/_multiprocessing/pipe_connection.c, conn_send_string is implemented with one call WriteFile(). Maybe this should be devided into some

[issue3300] urllib.quote and unquote - Unicode issues

2008-08-14 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: Hello Matt, OK I implemented the defaultdict solution. I got curious so ran some rough speed tests, using the following code. import random, urllib.parse for i in range(0, 10): str = ''.join(chr(random.randint(0, 0x10)) for _

[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2008-08-14 Thread Ross Burton
Changes by Ross Burton [EMAIL PROTECTED]: -- title: os.path.ismount doesn't work for NTFS mounts - os.path.ismount doesn't work for mounts the user doesn't have permission to see versions: +Python 2.5 -Python 2.4 ___ Python tracker [EMAIL PROTECTED]

[issue3545] Python turning off assertions (Windows)

2008-08-14 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: I have not yet seen any examples where the are erroneous assertions. Please take a look at the code in signalmodule.c. The MS CRT asserts that the signal number is supported (i.e. among a fixed list of signal numbers), even though C 99,

[issue3545] Python turning off assertions (Windows)

2008-08-14 Thread Martin v. Löwis
Changes by Martin v. Löwis [EMAIL PROTECTED]: -- resolution: - wont fix status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3545 ___

[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2008-08-14 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: If ismount() used os.path.dirname() instead of appending .., then this wouldn't happen. But it may change the function result if the argument is a symlink to something (directory or mount point) on another filesystem. It should be verified

[issue3552] uuid - exception on uuid3/uuid5

2008-08-14 Thread Matt Giuca
New submission from Matt Giuca [EMAIL PROTECTED]: The test suite breaks on the Lib/test/test_uuid.py, as of r65661. This is because uuid3 and uuid5 now raise exceptions. TypeError: new() argument 1 must be bytes or read-only buffer, not bytearray The problem is due to the changes in the way s#

[issue3300] urllib.quote and unquote - Unicode issues

2008-08-14 Thread Matt Giuca
Matt Giuca [EMAIL PROTECTED] added the comment: New patch (patch10). Details on Rietveld review tracker (http://codereview.appspot.com/2827). Another update on the remaining outstanding issues: Resolved issues since last time: Should unquote accept a bytes/bytearray as well as a str? No. But

[issue3300] urllib.quote and unquote - Unicode issues

2008-08-14 Thread Matt Giuca
Matt Giuca [EMAIL PROTECTED] added the comment: Antoine: I think if you move the line defining str out of the loop, relative timings should change quite a bit. Chances are that the random functions are not very fast, since they are written in pure Python. Well I wanted to test throwing lots

[issue3553] 2to3 -l doesn't work when installed in /opt

2008-08-14 Thread STINNER Victor
New submission from STINNER Victor [EMAIL PROTECTED]: I just installed Python 3.0b2 in /opt/py3k and tried 2to3 tool: $ /opt/py3k/bin/2to3 -l Available transformations for the -f/--fix option: Traceback (most recent call last): File /opt/py3k/bin/2to3, line 5, in module

[issue3552] uuid - exception on uuid3/uuid5

2008-08-14 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: I couldn't reproduce the problem (and apparently, many of the buildbots can't, either). It depends on whether you have openssl available, i.e. whether hashlib can be built. I explicitly disabled use of OpenSSL on my system, and have now

[issue3553] 2to3 -l doesn't work when installed in /opt

2008-08-14 Thread STINNER Victor
Changes by STINNER Victor [EMAIL PROTECTED]: -- keywords: +patch Added file: http://bugs.python.org/file2/2to3_fixer_dir.patch ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3553 ___

[issue3139] bytearrays are not thread safe

2008-08-14 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: I'm a bit confused. In the PyBuffer_Release implementation you committed, there is no DECREF at all. Oops, I meant to make the reference own by Py_buffer, but actually forgot to implement that. Fixed in r65677, r65678. Now, when I try to

[issue3554] ctypes.wstring_at and string_at call Python API without the GIL

2008-08-14 Thread Kevin Watters
New submission from Kevin Watters [EMAIL PROTECTED]: in Lib/ctypes/__init__.py the wstring_at and string_at functions are declared with CFUNCTYPE. This means that in Modules/_ctypes/callproc.c when the functions are invoked, Py_UNBLOCK_THREADS and Py_BLOCK_THREADS surround the call. But

[issue3139] bytearrays are not thread safe

2008-08-14 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: Le jeudi 14 août 2008 à 16:13 +, Martin v. Löwis a écrit : Now, when I try to merge that into the 3k branch, test_unicode terribly leaks memory :-( It's really frustrating. If you don't have the time to work on it anymore, you can post

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

2008-08-14 Thread Andrew Trick
Andrew Trick [EMAIL PROTECTED] added the comment: Mercurial will not work for anyone in a large company without this fix. I appreciate the patch, but hope its released soon. I did try the patch with Mercurial, but now I'm getting different error. I'm not sure if its related to the same bug:

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

2008-08-14 Thread Martin Wilck
Martin Wilck [EMAIL PROTECTED] added the comment: I am not in my office. I'll be back on August 25, 2008. In urgent cases, please contact: Peter Pols [EMAIL PROTECTED] or Gerhard Wichert [EMAIL PROTECTED] Best regards Martin Wilck Added file: http://bugs.python.org/file3/unnamed

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

2008-08-14 Thread Antoine Pitrou
Changes by Antoine Pitrou [EMAIL PROTECTED]: ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1424152 ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2008-08-14 Thread Antoine Pitrou
Changes by Antoine Pitrou [EMAIL PROTECTED]: Removed file: http://bugs.python.org/file3/unnamed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1424152 ___

[issue3139] bytearrays are not thread safe

2008-08-14 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: The patch is really trivial, and attached. Added file: http://bugs.python.org/file4/refcount.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3139

[issue3139] bytearrays are not thread safe

2008-08-14 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: Le jeudi 14 août 2008 à 18:52 +, Martin v. Löwis a écrit : The patch is really trivial, and attached. Added file: http://bugs.python.org/file4/refcount.diff By the way, even without that patch, there is a memory leak: Python

[issue3555] Regression: nested exceptions crash (Cannot recover from stack overflow)

2008-08-14 Thread Daniel Diniz
New submission from Daniel Diniz [EMAIL PROTECTED]: The following code works[1] on trunk and 2.5.1, but crashes with Fatal Python error: Cannot recover from stack overflow, on py3k as of rev65676: ## # Python 3.0b2+ (py3k:65676, Aug 14 2008, 14:37:38) # [GCC 4.1.3 20070929 (prerelease)

[issue3139] bytearrays are not thread safe

2008-08-14 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: By the way, even without that patch, there is a memory leak: With the patch, this memory leak goes away. Regards, Martin ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3139

[issue3554] ctypes.wstring_at and string_at call Python API without the GIL

2008-08-14 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Good catch! Indeed, when PyString_FromString or PyUnicode_FromWideChar fail, Python crashes with Fatal Python error: PyThreadState_Get: no current thread in a debug build, and an access violation in a release build (tested on Windows). Also,

[issue3476] BufferedWriter not thread-safe

2008-08-14 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: Here is a new patch which simply wraps the current BufferedWriter methods with a lock. It has a test case, and Amaury's example works fine too. Martin, do you think it's fine? (as for BufferedReader, I don't see the use cases for

[issue3139] bytearrays are not thread safe

2008-08-14 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: Le jeudi 14 août 2008 à 19:06 +, Martin v. Löwis a écrit : Martin v. Löwis [EMAIL PROTECTED] added the comment: By the way, even without that patch, there is a memory leak: With the patch, this memory leak goes away. But now: 30

[issue3139] bytearrays are not thread safe

2008-08-14 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: Sorry, the roundup e-mail interface ate some lines of code: b = b'' sys.getrefcount(b) 30 m = memoryview(b) sys.getrefcount(b) 32 del m sys.getrefcount(b) 31 It doesn't happen with bytearrays, so I suspect it's that you only DECREF when

[issue3555] Regression: nested exceptions crash (Cannot recover from stack overflow)

2008-08-14 Thread Guido van Rossum
Changes by Guido van Rossum [EMAIL PROTECTED]: -- nosy: +gvanrossum ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3555 ___ ___ Python-bugs-list mailing

[issue1432] Strange behavior of urlparse.urljoin

2008-08-14 Thread Facundo Batista
Facundo Batista [EMAIL PROTECTED] added the comment: Commited in revs 65679 and 65680. Thank you all!! -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1432

[issue3555] Regression: nested exceptions crash (Cannot recover from stack overflow)

2008-08-14 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: I'm no expert in recursion checking inside the Python interpreter, but looking at the code for _Py_CheckRecursiveCall(), I don't think it is a bug but a feature. Here how I understand it. When the recursion level exceeds the normal recursion

[issue3476] BufferedWriter not thread-safe

2008-08-14 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: The patch looks fine (as far as it goes). I do think the same should be done to the reader: IO libraries typically provide a promise that concurrent threads can read, and will get the complete stream in an overlapped manner (i.e. each input

[issue3556] test_raiseMemError consumes an insane amount of memory

2008-08-14 Thread Martin v. Löwis
New submission from Martin v. Löwis [EMAIL PROTECTED]: It appears that test_unicode::test_raiseMemError was meant to produce a MemoryError. Unfortunately, on my machine (Linux 2.6.25, 32-bit processor, 1GiB main memory, plenty swap), allocation *succeed*, and then brings the machine to a near

[issue600362] relocate cgi.parse_qs() into urlparse

2008-08-14 Thread Senthil
Senthil [EMAIL PROTECTED] added the comment: Hi Facundo, This issue/comments somehow escaped from my noticed, initially. I have addressed your comments in the new set of patches. 1) Previous patch Docs had issues. Updated the Docs patch. 2) Included message in cgi.py about parse_qs, parse_qsl

[issue600362] relocate cgi.parse_qs() into urlparse

2008-08-14 Thread Senthil
Changes by Senthil [EMAIL PROTECTED]: Added file: http://bugs.python.org/file7/issue600362-py3k-v2.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue600362 ___

[issue600362] relocate cgi.parse_qs() into urlparse

2008-08-14 Thread Senthil
Changes by Senthil [EMAIL PROTECTED]: Removed file: http://bugs.python.org/file10771/issue600362-py26.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue600362 ___

[issue600362] relocate cgi.parse_qs() into urlparse

2008-08-14 Thread Senthil
Changes by Senthil [EMAIL PROTECTED]: Removed file: http://bugs.python.org/file10772/issue600362-py3k.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue600362 ___

[issue3139] bytearrays are not thread safe

2008-08-14 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: It doesn't happen with bytearrays, so I suspect it's that you only DECREF when releasebuffer method exists: Thanks, that was indeed the problem; this is now fixed in r65683 and r65685. My initial observation that test_unicode leaks a lot

[issue3139] bytearrays are not thread safe

2008-08-14 Thread Martin v. Löwis
Changes by Martin v. Löwis [EMAIL PROTECTED]: -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3139 ___ ___

[issue3476] BufferedWriter not thread-safe

2008-08-14 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: Both BufferedReader and BufferedWriter are now fixed in r65686. Perhaps someone wants to open a separate issue for TextIOWrapper... -- resolution: - fixed status: open - closed ___ Python tracker

[issue3555] Regression: nested exceptions crash (Cannot recover from stack overflow)

2008-08-14 Thread Daniel Diniz
Daniel Diniz [EMAIL PROTECTED] added the comment: Antoine, Thanks for your analysis. I still believe this is a regression for the case described, but take my opinion with a grain of salt :) looking at the code for _Py_CheckRecursiveCall(), I don't think it is a bug but a feature. It does

[issue3555] Regression: nested exceptions crash (Cannot recover from stack overflow)

2008-08-14 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: Except that it wasn't an infinite loop in 2.5 and isn't in trunk: it terminates on overflower's except. That's because the stated behaviour is only implemented in 3.0 and not in 2.x. I'm not sure what motivated it, but you are the first one

[issue3552] uuid - exception on uuid3/uuid5

2008-08-14 Thread Matt Giuca
Matt Giuca [EMAIL PROTECTED] added the comment: So are you saying that if I had libopenssl (or whatever the name is) installed and linked with Python, it would bypass the use of _md5 and _sha1, and call the hash functions in libopenssl instead? And all the buildbots _do_ have it linked? That

[issue3557] Segfault in sha1

2008-08-14 Thread Matt Giuca
New submission from Matt Giuca [EMAIL PROTECTED]: Continuing the discussion from Issue 3552 (http://bugs.python.org/issue3552). r65676 makes changes to Modules/md5module.c and Modules/sha1module.c, to allow them to read mutable buffers. There's a segfault in sha1module if given 0 arguments.

[issue3514] pickle segfault with infinite loop in __getattr__

2008-08-14 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: Committed fix in r65689. Thanks! -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3514 ___

[issue3385] cPickle to pickle conversion in py3k missing methods

2008-08-14 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: I ran into a few problems while trying to fix this issue. First, does someone know how to add class attributes on extension types? It sounds like I will need either some tp_dict hacking or a Pickler subclass. Second, which methods of

[issue3558] Operator precedence misdocumented

2008-08-14 Thread Terry J. Reedy
New submission from Terry J. Reedy [EMAIL PROTECTED]: Reference/Expressions/Primaries: Primaries represent the most tightly bound operations of the language. Their syntax is: primary ::= atom | attributeref | subscription | slicing | call This (along with the fact that all sections after

[issue3559] Pasted \n not same as typed \n

2008-08-14 Thread Terry J. Reedy
New submission from Terry J. Reedy [EMAIL PROTECTED]: Winxp, 3.0b2, but I suspect earlier as well, since reported on c.l.p. If I paste '1+2\n' into the command window interpreter, it responds with '3' and a new prompt. In IDLE, the pasted \n is ignored and a typed \n is required to trigger