[issue4741] winsound.SND_PURGE has no effect

2008-12-26 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: In any case, this is not an issue in Python as PlaySound is only a thin wrapper around the OS' function. -- nosy: +georg.brandl resolution: - wont fix status: open - closed ___ Python tracker

[issue4748] yield expression vs lambda

2008-12-26 Thread Georg Brandl
New submission from Georg Brandl ge...@python.org: With lambda, the ban on return x in generators can be evaded: x = lambda: ((yield 1), (yield 2)) list(x()) [1, 2, (None, None)] dis.dis(x) 1 0 LOAD_CONST 0 (1) 3 YIELD_VALUE 4 LOAD_CONST

[issue4718] wsgiref package totally broken

2008-12-26 Thread Graham Dumpleton
Graham Dumpleton graham.dumple...@gmail.com added the comment: If making changes in wsgireg.validate, may be worthwhile also fixing up one area where it isn't strictly correct according to WSGI PEP. As per discussion:

[issue4749] Issue with RotatingFileHandler logging handler on Windows

2008-12-26 Thread Mohammad Al
New submission from Mohammad Al mramah...@hotmail.com: It seems that RotatingFileHandler is experiencing an issue when attempting to rotate log files under Windows. The following errors are received: Traceback (most recent call last): File C:\Python25\lib\logging\handlers.py, line 73, in

[issue4718] wsgiref package totally broken

2008-12-26 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Graham Dumpleton wrote: the check for number of arguments supplied to wsgi.input.read() is wrong as it allows for an optional argument, when argument is supposed to mandatory. I think it's a good idea. I'll update the patch soon.

[issue4604] close() seems to have limited effect

2008-12-26 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Attached more generic version of the patch. -- nosy: +hdima Added file: http://bugs.python.org/file12450/io_fixes.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4604

[issue4750] tarfile keeps excessive dir structure in compressed files

2008-12-26 Thread anatoly techtonik
New submission from anatoly techtonik techto...@gmail.com: When tarfile is directed to create tar.gz compressed archive file in a path different from current, it saves full path information in .gz header where only filename is required. This causes problems with decompression utilities, such as

[issue4750] tarfile keeps excessive dir structure in compressed files

2008-12-26 Thread anatoly techtonik
Changes by anatoly techtonik techto...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file12452/tarfile.directory.fix.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4750

[issue4751] Patch for better thread support in hashlib

2008-12-26 Thread ebfe
New submission from ebfe knabberknusperh...@yahoo.de: The hashlib functions provided by _hashopenssl.c hold the GIL all the time although the underlying openssl-library is basically thread-safe. I've attached a patch (svn diff) which basically does four things: * If python is compiled with

[issue4718] wsgiref package totally broken

2008-12-26 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Added check for wsgi.input.read() argument. Added file: http://bugs.python.org/file12454/wsgiref2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4718

[issue1885] [distutils] - error when processing the --formats=tar option

2008-12-26 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: Please reopen this bug. issue#1886 is different it take a long time until it is committed. I attach patch from Giampaolo here. -- keywords: +patch nosy: +techtonik versions: +Python 2.5, Python 2.7 Added file:

[issue1886] Permit to easily use distutils --formats=tar, gztar, bztar on all systems

2008-12-26 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: I attach an improved patch1886.use.tarfile.module.diff that fixes all bugs addressed in this issue. It also removes second call to compression program leaving that privilege to tar. I notice that the archive generated by tarfile module

[issue1886] Permit to easily use distutils --formats=tar, gztar, bztar on all systems

2008-12-26 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: Oh, my mistake - the bug with extra dir component in archive is in issue4750 Second shell call to compression program is removed only for the case when tarfile or any of required compression modules are not available.

[issue1886] Permit to easily use distutils --formats=tar, gztar, bztar on all systems

2008-12-26 Thread Roumen Petrov
Roumen Petrov bugtr...@roumenpetrov.info added the comment: about patch1886.use.tarfile.module.diff - the original tar don't support -j flag. -- nosy: +rpetrov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1886

[issue1886] Permit to easily use distutils --formats=tar, gztar, bztar on all systems

2008-12-26 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: What are the systems where does this original tar still exist as a default utility? If there is no tarfile module on this systems and tar version is so old then you need a more modern system to wrap your releases or more modern tar. The

[issue4718] wsgiref package totally broken

2008-12-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Hi, The patch looks ok to me, although the tests against mutable byte-like types are probably useless. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4718

[issue4722] _winreg.QueryValue fault while reading mangled registry values

2008-12-26 Thread Gabriel Genellina
Changes by Gabriel Genellina gagsl-...@yahoo.com.ar: -- nosy: +gagenellina ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4722 ___ ___

[issue4752] Error in SocketServer UDP documentation

2008-12-26 Thread Andrey Petrov
New submission from Andrey Petrov andrey.pet...@shazow.net: In the SocketServer.UDPServer Example, the second last line: server = SocketServer.UDPServer((HOST, PORT), BaseUDPRequestHandler) Should be: server = SocketServer.UDPServer((HOST, PORT), MyUDPHandler) -- assignee:

[issue4753] Faster opcode dispatch on gcc

2008-12-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Armin, by reading the pypy-dev mailing-list it looks like you were interested in this. -- nosy: +arigo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4753

[issue4751] Patch for better thread support in hashlib

2008-12-26 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I think that you don't use Py_BEGIN_ALLOW_THREADS / Py_END_ALLOW_THREADS correctly: the GIL can be released when the hashlib lock is acquired (to run hash functions in parallel threads). So the macros should be: #define

[issue4751] Patch for better thread support in hashlib

2008-12-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Hi, Very good idea. However, you don't need to discriminate for the bytes type specifically. When a buffer is taken on the object (with PyObject_GetBuffer()), the object is internally locked until the buffer is release with PyBuffer_Release().

[issue4726] doctest gets line numbers wrong due to quotes in comments

2008-12-26 Thread Gabriel Genellina
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: I could not reproduce the behaviour you describe. Could you provide a test case? That fails with the current code and is fixed after applying your patch. (BTW, the r.e. should be a raw string literal, even the original one)

[issue4751] Patch for better thread support in hashlib

2008-12-26 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: EVP_copy() and EVP_get_digest_size() should call ENTER_HASHLIB/LEAVE_HASHLIB to protect self-ctx. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4751

[issue4738] Patch to make zlib-objects better support threads

2008-12-26 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +pitrou priority: - normal stage: - patch review versions: -Python 2.5, Python 2.6, Python 3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4738

[issue4751] Patch for better thread support in hashlib

2008-12-26 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: If view.len is negative, EVP_hash() may read invalid memory :-/ Be careful of integer overflow in this block: Py_ssize_t offset = 0, sublen = len; while (sublen) { unsigned int process = sublen MUNCH_SIZE ? MUNCH_SIZE

[issue4754] winsound documentation (about stoping sounds)

2008-12-26 Thread Hirokazu Yamamoto
New submission from Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp: This comes from Issue4741. The patch - clarify meaning of None as the parameter of *sound* to PlaySound - notify SND_PURGE is not supported by MS now -- assignee: georg.brandl components: Documentation files:

[issue4754] winsound documentation (about stoping sounds)

2008-12-26 Thread Hirokazu Yamamoto
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment: The patch is for release26-maint. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4754 ___

[issue4716] Python 3.0 halts on shutdown when settrace is set

2008-12-26 Thread Gabriel Genellina
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: Yes, this is exactly the problem. The execution never goes beyond print ('here'); if you print frame.f_lineno you'll see it blocks at io.py line 1036, waiting for a Lock for the second time. So the trace function cannot use print, not

[issue4716] Python 3.0 halts on shutdown when settrace is set

2008-12-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Thanks for the investigation! The problem has already been reported in #3618. Closing this one. -- resolution: - duplicate status: open - closed superseder: - possible deadlock in IO library (Lib/io.py)

[issue4751] Patch for better thread support in hashlib

2008-12-26 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: New version of ebfe's patch: - ENTER/LEAVE_HASHLIB: * don't touch GIL in ENTER_HASHLIB (it's useless) * add mandatory argument (explicit use of self) - EVP_hash(): * restore Py_SAFE_DOWNCAST * simplify the code: always

[issue4738] Patch to make zlib-objects better support threads

2008-12-26 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: New comments about the last patch: - GIL is not released for adler() or crc32() whereas these functions may be slow for long strings: just add Py_BEGIN_ALLOW_THREADS / Py_END_ALLOW_THREADS before / after adler(...) and crc32(...)

[issue3860] GzipFile and BZ2File should support context manager protocol

2008-12-26 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I love with ... as f: and I want it for gzip/bz2 files! Comment about the patch: (1) the IOError message is different for the two modules: I/O operation on closed GzipFile object vs I/O operation on closed file Specify the

[issue4640] optparse - dosn't distinguish between '--option' and '-option'

2008-12-26 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: -debug may be equivalent to -d -e -b -u -g (if none of these options have an argument), but no to --debug. If you like to use -d as an alias to --debug, just use: add_option(-d, --debug, ...). -- nosy: +haypo

[issue4708] os.pipe should return inheritable descriptors (Windows)

2008-12-26 Thread Gabriel Genellina
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: Patch to posixmodule.c including test case and documentation updates. Note: I've only run the tests on Windows. -- keywords: +patch Added file: http://bugs.python.org/file12460/inheritable_pipes.diff

[issue4751] Patch for better thread support in hashlib

2008-12-26 Thread ebfe
Changes by ebfe knabberknusperh...@yahoo.de: Removed file: http://bugs.python.org/file12453/hashopenssl_threads.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4751 ___

[issue4751] Patch for better thread support in hashlib

2008-12-26 Thread ebfe
ebfe knabberknusperh...@yahoo.de added the comment: Thanks for the advices. Antoine, maybe you could clarify the situation regarding buffer-locks for me. In older versions of PEP 3118 the PyBUF_LOCK flag was still present but it doesn't seem to have made it's way into the final draft. Is it

[issue4751] Patch for better thread support in hashlib

2008-12-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Is it save to assume that a buffer-view will not change until release() is called - for all types supporting the buffer protocol in py3k ?? Yes, it is! ___ Python tracker rep...@bugs.python.org

[issue3860] GzipFile and BZ2File should support context manager protocol

2008-12-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: (1) the IOError message is different for the two modules: I/O operation on closed GzipFile object vs I/O operation on closed file I've reused the same error message as used in other parts of each module. (2) For bz2module, Why don't

[issue4751] Patch for better thread support in hashlib

2008-12-26 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I've taken on haypo's patch to release the GIL only when the buffer is larger than 10kb You can factorize the code by moving Py_BEGIN_ALLOW_THREADS / Py_END_ALLOW_THREADS *into* EVP_hash ;-) 10 KB is a random value or the fast

[issue4738] Patch to make zlib-objects better support threads

2008-12-26 Thread ebfe
ebfe knabberknusperh...@yahoo.de added the comment: new svn diff attached - GIL is now released for adler32 and crc32 if the buffer is larger than 5kb (we don't want to risk burning cpu cycles by GIL-stuff) - adler32 got it's param by s# but now does s* - why s# anyway? - ENTER_ZLIB no longer

[issue4738] Patch to make zlib-objects better support threads

2008-12-26 Thread ebfe
Changes by ebfe knabberknusperh...@yahoo.de: Removed file: http://bugs.python.org/file12448/zlib_threads.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4738 ___

[issue4751] Patch for better thread support in hashlib

2008-12-26 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: New version of my md5sum.py program limited to 10 threads. New benchmark with 160 files (size in 7..10 MB): - Python unpatched: best=4.8 sec - C version (/usr/bin/md5sum): best=3.6 sec - Python patched: best=2.1 sec As everybody

[issue4751] Patch for better thread support in hashlib

2008-12-26 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file12462/md5sum.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4751 ___

[issue4751] Patch for better thread support in hashlib

2008-12-26 Thread ebfe
ebfe knabberknusperh...@yahoo.de added the comment: Here is another simple benchmarker. For me it shows almost perfect scaling (2 cores = 196% performance) if the buffer put into .update() is large enough. I deliberately did not move Py_BEGIN_ALLOW_THREADS into EVP_hash as we might call this

[issue4738] Patch to make zlib-objects better support threads

2008-12-26 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Comments on zlib_threads-2.diff: - the indentation is strange: don't mix spaces and tabs! - I prefer ; after a call to a macro: ENTER_ZLIB(self); instead of ENTER_ZLIB(self). It makes vim happy (auto indent code correctly) and it

[issue4751] Patch for better thread support in hashlib

2008-12-26 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: hashlibtest.py results on my Quad Core with 4 threads: - unpatched: best=13.0 sec - patched: best=3.25 sec Some maths: 13.0 / 4 = 3.25 \o/ ___ Python tracker rep...@bugs.python.org

[issue4738] Patch to make zlib-objects better support threads

2008-12-26 Thread ebfe
ebfe knabberknusperh...@yahoo.de added the comment: new svn diff attached the indentation in this file is not my fault, it has tabs all over it... The 5kb limits protects from the overhead of releasing the GIL. With very small buffers the overall runtime in my benchmark tends to double. I set

[issue4748] yield expression vs lambda

2008-12-26 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Attaching patch? BTW, how did you find this bug? :) -- keywords: +needs review, patch nosy: +benjamin.peterson stage: - patch review type: - behavior Added file: http://bugs.python.org/file12467/nasty_lambda_generators.patch

[issue4738] Patch to make zlib-objects better support threads

2008-12-26 Thread ebfe
Changes by ebfe knabberknusperh...@yahoo.de: Removed file: http://bugs.python.org/file12463/zlib_threads-2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4738 ___

[issue4744] asynchat documentation needs to be more precise

2008-12-26 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' billiej...@users.sourceforge.net: -- nosy: +giampaolo.rodola, josiah.carlson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4744 ___

[issue4743] intra-pkg multiple import (import local1, local2) not fixed

2008-12-26 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: r67928 makes 2to3 more tolerant about multiple imports on a line. It also warns when there is an absolute import and relative import on the same line. -- nosy: +benjamin.peterson resolution: - fixed status: open - closed

[issue4745] socket.send obscure error message

2008-12-26 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Fixed in r67929. -- nosy: +benjamin.peterson resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4745

[issue4740] pickle test for protocol 3 (HIGHEST_PROTOCOL in py3k)

2008-12-26 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Looks fine to me. This happens in the trunk already, right? -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4740

[issue4740] pickle test for protocol 3 (HIGHEST_PROTOCOL in py3k)

2008-12-26 Thread Hirokazu Yamamoto
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment: Not yet. This patch is for trunk. But HIGHEST_PROTOCOL is 2 in trunk, so no difference in behavior. (Just useful for consistency) Added file: http://bugs.python.org/file12468/trunk_use_HIGHEST_PROTOCOL.patch

[issue4740] pickle test for protocol 3 (HIGHEST_PROTOCOL in py3k)

2008-12-26 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Go ahead. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4740 ___ ___ Python-bugs-list mailing list

[issue4755] Common path prefix

2008-12-26 Thread Skip Montanaro
New submission from Skip Montanaro s...@pobox.com: os.path.commonprefix returns the common prefix of a list of paths taken character-by-character. This can return invalid paths. For example, os.path.commonprefix([/export/home/dave, /etc/passwd]) will return /e, which likely has no meaning

[issue4755] Common path prefix

2008-12-26 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: A new function sounds like a good solution to me. How about just calling it os.path.commonpath though? I agree having a path component based prefix function in os.path is highly desirable, particularly since the addition of relpath in 2.6:

[issue4740] pickle test for protocol 3 (HIGHEST_PROTOCOL in py3k)

2008-12-26 Thread Hirokazu Yamamoto
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment: Done. Fixed in r67930(trunk), r67931(py3k) -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4740

[issue4740] pickle test for protocol 3 (HIGHEST_PROTOCOL in py3k)

2008-12-26 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp: -- stage: patch review - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4740 ___

[issue4710] [PATCH] zipfile.ZipFile does not extract directories properly

2008-12-26 Thread Gabriel Genellina
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: Your usage of os.sep is incorrect, both when reading and writing directories. Zip files are (more-or-less) platform independent. The specification *requires* forward slashes in paths [1], and the zipfile module already writes them

[issue4756] zipfile.is_zipfile: added support for file-like objects

2008-12-26 Thread Gabriel Genellina
New submission from Gabriel Genellina gagsl-...@yahoo.com.ar: Patch to zipfile.is_zipfile, adding support for file and file-like objects. Includes test cases and documentation updates. This fixes issue4241 too. -- components: Library (Lib) files: is_zipfile_filelike.diff keywords:

[issue4241] zipfile.py - is_zipfile leaves file open when error

2008-12-26 Thread Gabriel Genellina
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: The patch for issue4756 fixes this too. -- nosy: +gagenellina ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4241 ___

[issue3618] possible deadlock in IO library (Lib/io.py)

2008-12-26 Thread Gabriel Genellina
Changes by Gabriel Genellina gagsl-...@yahoo.com.ar: -- nosy: +gagenellina ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3618 ___ ___