[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-08 Thread STINNER Victor
STINNER Victor added the comment: Example with ANSI=cp932 (on Windows Seven): - b'abc\xffdef'.decode('mbcs', 'replace') gives 'abc\uf8f3def' - b'abc\xffdef'.decode('mbcs', 'ignore') gives 'abcdef' --

[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-08 Thread STINNER Victor
STINNER Victor added the comment: > Example with ANSI=cp932 (on Windows Seven): > - b'abc\xffdef'.decode('mbcs', 'replace') gives 'abc\uf8f3def' > - b'abc\xffdef'.decode('mbcs', 'ignore') gives 'abcdef'

[issue1195571] simple callback system for Py_FatalError

2011-06-08 Thread STINNER Victor
STINNER Victor added the comment: fatalhook-2.patch: I don't understand the documentation. It says "Cause :cfunc:`Py_FatalError` to invoke the given function instead of printing to standard error and aborting out of the process.", but if the callback does nothing, the messa

[issue12287] ossaudiodev: stack corruption with FD >= FD_SETSIZE

2011-06-08 Thread STINNER Victor
STINNER Victor added the comment: You don't check that 0 <= fd (e.g. oss.close()). The select has a specific code for Visual Studio (don't check v < FD_SETSIZE): #if defined(_MSC_VER) max = 0; /* not used for Win32 */ #else /* !_MSC_VER

[issue12187] subprocess.wait() with a timeout uses polling on POSIX

2011-06-08 Thread STINNER Victor
STINNER Victor added the comment: > To be portable, we would need to ... Antoine is right: we don't have to be portable. We can write an "optimized" implementations (without polling) for a specific OS, even for a specific version of an OS (e.g. like Linux kernel >= 2.6

[issue12289] http.server.CGIHTTPRequestHandler doesn't check if a Python script is executable

2011-06-08 Thread STINNER Victor
New submission from STINNER Victor : CGIHTTPRequestHandler.run_cgi() only checks if the script processing the request is executable if the file is not a Python script, but later it uses os.execve(scriptfile, ...) if os has a fork() function. Moreover, the executable() functions checks if

[issue12285] Unexpected behavior for 0 or negative processes in multiprocessing.pool()

2011-06-08 Thread STINNER Victor
STINNER Victor added the comment: multiprocessing_pool.patch: raise a ValueError if processes is less than 1. A test should be added. -- keywords: +patch nosy: +haypo versions: +Python 2.7, Python 3.2, Python 3.3 -Python 2.6 Added file: http://bugs.python.org/file22287

[issue12289] http.server.CGIHTTPRequestHandler doesn't check if a Python script is executable

2011-06-08 Thread STINNER Victor
STINNER Victor added the comment: cgi.patch: fix the test checking that the script file is executable. The patch removes the executable() function. This function is not documented but is public. The patch can be easily modified to keep this function if needed. -- keywords: +patch

[issue8407] expose signalfd(2) and pthread_sigmask in the signal module

2011-06-09 Thread STINNER Victor
STINNER Victor added the comment: > Oh, sigwait() doesn't accept a timeout! I would be nice to have > also sigwaitinfo().. and maybe also its friend, sigwaitinfo() Oops, I mean sigtimedwait() and sigwaitinfo(). -- ___ Python tra

[issue12187] subprocess.wait() with a timeout uses polling on POSIX

2011-06-09 Thread STINNER Victor
STINNER Victor added the comment: (I should not answer in this issue, but in #8407) > > See also issue #8407 for sigtimedwait() and signalfd() in Python. > > You didn't commit the signalfd part? Not yet because I would like to provide something to decode the data written

[issue12287] ossaudiodev: stack corruption with FD >= FD_SETSIZE

2011-06-09 Thread STINNER Victor
STINNER Victor added the comment: > So, this _PyCheckSelectable_fd ? function/macro would: > - return true (1) on Visual Studio or if > Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE is defined > - return false (0) if the file descriptor is greater than FD_SETSIZE otherwise > Do w

[issue12303] expose sigwaitinfo() and sigtimedwait() in the signal module

2011-06-09 Thread STINNER Victor
New submission from STINNER Victor : Python 3.3 adds timeout arguments to communicate() and wait() methods of subprocess.Popen, acquire() method of threading.Lock, and maybe more. I like (optional) timeouts, and so it would be nice to have sigtimedwait(). If we expose sigtimedwait(), it&#

[issue12304] expose signalfd(2) in the signal module

2011-06-09 Thread STINNER Victor
New submission from STINNER Victor : "Linux offers the signalfd syscall since 2.6.22 (with minor changes afterwards). This call allows signals to be handled as bytes read out of a file descriptor, rather than as interruptions to the flow of a program. Quite usefully, this file descr

[issue12304] expose signalfd(2) in the signal module

2011-06-09 Thread STINNER Victor
STINNER Victor added the comment: signalfd-4.patch: my more recent patch exposing signalfd(). It lacks a structure to decode the bytes read from the signalfd file descriptor. Example in ctypes (msg135438): class signalfd_siginfo(Structure): _fields_ = ( ('ssi_signo'

[issue8407] expose pthread_sigmask(), pthread_kill(), sigpending() and sigwait() in the signal module

2011-06-09 Thread STINNER Victor
STINNER Victor added the comment: > This whole thread is becoming quite confusing. You are complelty right, sorry to pollute this issue. Changes related to this issue: - expose pthread_sigmask(), pthread_kill(), sigpending(), sigwait() - wakeup fd now contains the file descriptor

[issue12304] expose signalfd(2) in the signal module

2011-06-09 Thread STINNER Victor
STINNER Victor added the comment: #8407 changed the wakeup fd: it now contains the signal number. pthread_sigmask() is now part of Python 3.3 (see also #8407). signalfd() has advantages over the wakeup fd (msg103326): - it is handled in the kernel, the process is not interrupted. For

[issue8407] expose pthread_sigmask(), pthread_kill(), sigpending() and sigwait() in the signal module

2011-06-09 Thread STINNER Victor
STINNER Victor added the comment: > I just noticed something "funny": signal_sigwait doesn't release > the GIL, which means that it's pretty much useless :-) sigwait() is not useless: the signal is not necessary send by another thread. The signal can be send by ala

[issue8407] expose pthread_sigmask(), pthread_kill(), sigpending() and sigwait() in the signal module

2011-06-10 Thread STINNER Victor
STINNER Victor added the comment: > On Linux, it works well with more than one thread. > I added a test using a thread, we will see if it works > on buildbots. The test hangs on FreeBSD 8.2: [235/356] test_signal Timeout (1:00:00)! Thread 0x000800e041c0: File "/usr

[issue12309] os.environ was modified by test_packaging

2011-06-10 Thread STINNER Victor
New submission from STINNER Victor : [ 20/356] test_packaging (...) Warning -- os.environ was modified by test_packaging Seen on x86 Tiger buildbot: http://www.python.org/dev/buildbot/all/builders/x86%20Tiger%203.x/builds/2723/steps/test/logs/stdio There is also a resource warning: .../Lib

[issue12310] Segfault in test_multiprocessing

2011-06-10 Thread STINNER Victor
New submission from STINNER Victor : test_multiprocessing segfaults in a loop. The crash occurs in _Condition.release() on waiter.release(), called from Queue._finalize_close(). Possible related changes: - a5c8b6ebe895: new sigwait() test using thread (issue #8407) - 6d6099f7fe89: add

[issue8407] expose pthread_sigmask(), pthread_kill(), sigpending() and sigwait() in the signal module

2011-06-10 Thread STINNER Victor
STINNER Victor added the comment: > The test hangs on FreeBSD 8.2: (...) See also #12310 which may be related. -- ___ Python tracker <http://bugs.python.org/iss

[issue12310] Segfault in test_multiprocessing

2011-06-10 Thread STINNER Victor
STINNER Victor added the comment: > a5c8b6ebe895: new sigwait() test using thread (issue #8407) > 6d6099f7fe89: add sentinels to multiprocessing (issue #9205) The first segfaults occured in build #2719 (cedceeb45030): http://www.python.org/dev/buildbot/all/builders/x86%20Tiger%203.x/

[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2011-06-10 Thread STINNER Victor
STINNER Victor added the comment: test_multiprocessing crashs ~700 times on Mac OS X Tiger, regression likely introduced by this issue (6d6099f7fe89): I created issue #12310 for that. -- ___ Python tracker <http://bugs.python.org/issue9

[issue12310] Segfault in test_multiprocessing

2011-06-10 Thread STINNER Victor
STINNER Victor added the comment: > Victor, how can there be hundreds of crashes? > Isn't the process supposed to terminate when a crash occurs? Yes, a process does terminate on SIGSEGV, but multiprocessing creates subprocesses: I suppose that crashes occur in child proc

[issue8407] expose pthread_sigmask(), pthread_kill(), sigpending() and sigwait() in the signal module

2011-06-10 Thread STINNER Victor
STINNER Victor added the comment: neologix> Patch attached. I wrote a different patch based on your patch. The main change is that I chose to keep signal.alarm(1) instead of sending the signal from the parent process to the child process, because I don't think that time.sleep(0

[issue12310] Segfault in test_multiprocessing

2011-06-10 Thread STINNER Victor
STINNER Victor added the comment: Le vendredi 10 juin 2011 à 09:40 +, Antoine Pitrou a écrit : > There are several crashes in test_signal Commit a17710e27ea2 should fix some (all?) test_signal crashes. -- ___ Python tracker &l

[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-10 Thread STINNER Victor
STINNER Victor added the comment: Version 2 of my patch (mbcs2.patch): - patch also the encoder: fix ignore/replace depending on the Windows version, support any error handler: encode character per character if encoding in strict mode fails - Add PyUnicode_DecodeCodePageStateful() and

[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-10 Thread STINNER Victor
STINNER Victor added the comment: Example on Windows Vista with ANSI=cp932: >>> import codecs >>> codecs.code_page_encode(1252, '\xe9') (b'\xe9', 1) >>> codecs.mbcs_encode('\xe9') ... UnicodeEncodeError: 'mbcs'

[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-10 Thread STINNER Victor
STINNER Victor added the comment: Decode examples, ANSI=cp932: >>> codecs.code_page_decode(1252, b'\x80') ('\u20ac', 1) >>> codecs.code_page_decode(932, b'\x82') ... UnicodeDecodeError: 'mbcs' codec can't decode bytes in position 0

[issue12310] Segfault in test_multiprocessing

2011-06-10 Thread STINNER Victor
STINNER Victor added the comment: It looks like the sentinel doesn't handle fatal death of the child process: test test_multiprocessing crashed -- Traceback (most recent call last): File "./Lib/test/regrtest.py", line 1043, in runtest_inner File "/Users/db3l/build

[issue12287] ossaudiodev: stack corruption with FD >= FD_SETSIZE

2011-06-10 Thread STINNER Victor
STINNER Victor added the comment: Comments on is_selectable.diff. > +#define IS_SELECTABLE(s) (_PyIsSelectable_fd((s)->sock_fd) || > s->sock_timeout <= 0.0) You may add parenthesis around the second s (even if it's unrelated to this issue and not a regression of you

[issue12316] test_signal: test_sigwait_thread failure on FreeBSD 6.4 buildbot

2011-06-10 Thread STINNER Victor
STINNER Victor added the comment: > In a multi-threaded program, we're only allowed to call async-safe > functions between fork() and exec() in the child process Oh, I don't know that. The test should be modified to create a new clean Python process using subprocess

[issue12310] Segfault in test_multiprocessing

2011-06-11 Thread STINNER Victor
STINNER Victor added the comment: > Would it be possible to try this on the buildbot to see if it fixes > the segfaults? You can fork cpython, modify the code, and run a custom buildbot on your clone. -- ___ Python tracker <http://bugs.p

[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-13 Thread STINNER Victor
STINNER Victor added the comment: Patch version 3: - add unit tests for code pages 932, 1252, CP_UTF7 and CP_UTF8 - fix encode/decode flags for CP_UTF7/CP_UTF8 - fix encode name on UnicodeDecodeError, support also "CP_UTF7" and "CP_UTF8" code page names TODO: - The

[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-13 Thread STINNER Victor
STINNER Victor added the comment: Using my patch, it is possible create a codec for any code page on demand: register a function checking if the encoding name starts with "cp" and ends with a valid code page number. Even if it is bad idea to set the OEM code page to 65001, impleme

[issue12316] test_signal: test_sigwait_thread failure on FreeBSD 6.4 buildbot

2011-06-13 Thread STINNER Victor
STINNER Victor added the comment: > Patch attached The patch looks correct, but only FreeBSD 6.4 can tell us if it "works" or not, so I commited your new version of the test. I inlined check_sigwait() because the function was only called by

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-13 Thread STINNER Victor
STINNER Victor added the comment: Why should be used instead? - sys.platform.startswith('linux') - os.uname()[0] == 'Linux' - platform.system() == 'Linux' - other? Tests like sys.platform in ('linux2', 'darwin') can be replaced by sys.pl

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-13 Thread STINNER Victor
STINNER Victor added the comment: sys.platform comes from Py_GetPlatform() which comes from PLATFORM define. On Linux, this define comes from Makefile: MACHDEP variable which comes from configure. Finally, MACHDEP is defined by: ac_sys_system=`uname -s` if test

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-13 Thread STINNER Victor
STINNER Victor added the comment: issue12084_v2.diff doesn't patch os.lstat(bytes): os.lstat(bytes) should call win32_lstat() (which is removed by this patch) instead of stat(). test_os doesn't test os.stat()/os.lstat() with byte filenames. You can for examp

[issue12316] test_signal: test_sigwait_thread failure on FreeBSD 6.4 buildbot

2011-06-13 Thread STINNER Victor
STINNER Victor added the comment: test_signal passed in build #1577 of x86 FreeBSD 6.4 3.x: I close this issue. Thanks neologix! -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-13 Thread STINNER Victor
STINNER Victor added the comment: > os.lstat(bytes) should call win32_lstat() > (which is removed by this patch) instead of stat() Short history: - 0a1baa619171: Fix #10027. st_nlink not set on Windows calls to os.stat/lstat - 730b728e5aef: Implement #1578269. Patch by Jason R.

[issue8260] When I use codecs.open(...) and f.readline() follow up by f.read() return bad result

2011-06-13 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue8260> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-13 Thread STINNER Victor
STINNER Victor added the comment: > Here's a cleaned up patch which includes the test and lstat change > Victor mentioned. The test pass on Windows Seven 64 bits. -- ___ Python tracker <http://bugs.python.

[issue10527] multiprocessing.Pipe problem: "handle out of range in select()"

2011-06-14 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo, pitrou ___ Python tracker <http://bugs.python.org/issue10527> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12336] tkinter.test.test_ttk.test_widgets.test_select() failure on FreeBSD 6.4 3.x

2011-06-14 Thread STINNER Victor
New submission from STINNER Victor : test test_ttk_guionly failed -- Traceback (most recent call last): File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/tkinter/test/test_ttk/test_widgets.py", line 674, in test_select self.assertTrue(success) AssertionError: [] i

[issue12337] Need real TextIOWrapper for stdin/stdout

2011-06-15 Thread STINNER Victor
STINNER Victor added the comment: I think that this issue is a duplicate of the issue #11272: Python 3.2.1 has been released recently and contains the fix. Can you try this version Fan? -- ___ Python tracker <http://bugs.python.org/issue12

[issue12337] Need real TextIOWrapper for stdin/stdout

2011-06-15 Thread STINNER Victor
STINNER Victor added the comment: Note: Python 3.2 has another regression related to the Windows console (issue #11395), bug fixed in 3.2.1. -- ___ Python tracker <http://bugs.python.org/issue12

[issue12342] characters with ord above 65535 fail to display in IDLE

2011-06-15 Thread STINNER Victor
STINNER Victor added the comment: U+1 is not the most common character in fonts. You should try another character in U+1-U+10 range (non-BMP characters). The new funny emoticon are in this range, but I don't know if your Ubuntu setup includes a font supporting this range.

[issue12133] ResourceWarning in urllib.request

2011-06-15 Thread STINNER Victor
STINNER Victor added the comment: Oh, I wrote a similar patch to kill the ResourceWarning of test_pypi_simple (except that I didn't patch test_urllib2). -- nosy: +haypo versions: +Python 2.7, Python 3.2 ___ Python tracker <http://bugs.py

[issue10883] urllib: socket is not closed explicitly

2011-06-15 Thread STINNER Victor
STINNER Victor added the comment: Is there still something to do in this issue? The initial report is fixed. -- versions: -Python 2.6, Python 3.1 ___ Python tracker <http://bugs.python.org/issue10

[issue12342] characters with ord above 65535 fail to display in IDLE

2011-06-15 Thread STINNER Victor
STINNER Victor added the comment: > From the discussions here, http://wiki.tcl.tk/1364, it appears that Tcl > 8.5 (and earlier) does not support Unicode code points outside > the BMP range as in this example. Extract of http://wiki.tcl.tk/1364 : "RS 2008-07-09: Unicode out of

[issue12167] test_packaging reference leak

2011-06-15 Thread STINNER Victor
STINNER Victor added the comment: test_dist and test_bdist_dumb leak because of the _path_created global variable of packaging.util, used indirectly by copy_tree(). # cache for by mkpath() -- in addition to cheapening redundant calls, # eliminates redundant "creating /foo/bar/baz" m

[issue12167] test_packaging reference leak

2011-06-15 Thread STINNER Victor
STINNER Victor added the comment: Note: #12133 has a patch to fix the ResourceWarning of test_pypi_simple. -- ___ Python tracker <http://bugs.python.org/issue12

[issue12263] punycode codec ignores the error handler argument

2011-06-15 Thread STINNER Victor
STINNER Victor added the comment: punycode_errors.patch: - raise an error if errors="replace": only accept strict and ignore - use errors to encode/decode to/from ASCII - add unit tests I don't think that the change should be documented, because punycode has no section

[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-15 Thread STINNER Victor
STINNER Victor added the comment: Patch version 4 (mbcs4.patch): - fix encode and decode flags depending on the code page and Windows version, e.g. use WC_ERR_INVALID_CHARS instead of WC_NO_BEST_FIT_CHARS for CP_UTF8 on Windows Vista and later - fix usage of the default character on

[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-15 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file22282/mbcs.patch ___ Python tracker <http://bugs.python.org/issue12281> ___ ___ Python-bugs-list m

[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-15 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file22315/mbcs2.patch ___ Python tracker <http://bugs.python.org/issue12281> ___ ___ Python-bugs-list m

[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-15 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file22340/mbcs3.patch ___ Python tracker <http://bugs.python.org/issue12281> ___ ___ Python-bugs-list m

[issue12345] Add math.tau

2011-06-16 Thread STINNER Victor
STINNER Victor added the comment: I like this issue number, but I don't think that Python needs this new constant: it's trivial to add it to your own project. We have pi and e, it's enough. If we begin to add a new constant, others will ask to add much more constants, and th

[issue12345] Add math.tau

2011-06-16 Thread STINNER Victor
STINNER Victor added the comment: > Actually, I've heard there are an infinity of them. Can you prove that? -- status: pending -> open ___ Python tracker <http://bugs.python.

[issue12343] Python 2.7.2 regression: ssl.SSLError: [Errno 2] _ssl.c:503: The operation did not complete (read)

2011-06-16 Thread STINNER Victor
STINNER Victor added the comment: It's maybe because Python 2.7.2 is faster/slower? :-) -- nosy: +haypo ___ Python tracker <http://bugs.python.org/is

[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-16 Thread STINNER Victor
STINNER Victor added the comment: Patch version 5 fixes the encode/decode flags on Windows XP. The codecs give different result on XP and Seven in some cases: Seven: - b'\x81\x00abc'.decode('cp932', 'replace') returns '\u30fb\x00abc' - &

[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-16 Thread STINNER Victor
STINNER Victor added the comment: TODO: add more tests CP_UTF8: if self.vista_or_later: tests.append(('\udc80', 'strict', None)) tests.append(('\udc80', 'ignore', b'')) tests.append((&

[issue12320] test_packaging failures

2011-06-16 Thread STINNER Victor
STINNER Victor added the comment: See also: http://www.python.org/dev/buildbot/all/builders/x86%20OpenIndiana%203.x/builds/1516 http://www.python.org/dev/buildbot/all/builders/sparc%20solaris10%20gcc%203.x/builds/3276 There are many OSError(22, 'Invalid argument: ...') error

[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-16 Thread STINNER Victor
STINNER Victor added the comment: > What is the use of these code_page_encode() functions? I wrote them to be able to write tests. We can maybe use them to implement the Python code page codecs using a custom codec register function: see msg138246. Windows codecs seem to be less relia

[issue12310] Segfault in test_multiprocessing

2011-06-17 Thread STINNER Victor
STINNER Victor added the comment: Let's try on "real" buildbots. If the commit fixes the issue on 3.x, I will port the fix to Python 2.7. -- ___ Python tracker <http://bugs.pyt

[issue12333] test_packaging failures under Solaris

2011-06-17 Thread STINNER Victor
STINNER Victor added the comment: 276530424350 fixed the failures on "x86 OpenIndiana 3.x" buildbot. -- nosy: +haypo resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.py

[issue12342] characters with ord above 65535 fail to display in IDLE

2011-06-17 Thread STINNER Victor
STINNER Victor added the comment: Instead of ValueError: unsupported character I suggest: ValueError: unsupported character (U+1): Tcl doesn't support characters outside U+-U+ range What do you think? -- ___ Python tracker

[issue12263] punycode codec ignores the error handler argument

2011-06-17 Thread STINNER Victor
STINNER Victor added the comment: @Martin: Can you review my patch? -- ___ Python tracker <http://bugs.python.org/issue12263> ___ ___ Python-bugs-list mailin

[issue12133] ResourceWarning in urllib.request

2011-06-17 Thread STINNER Victor
STINNER Victor added the comment: I tested the patch on Python 3.3: the full test suite pass on Linux. I applied your patch on Python 2.7, 3.2 and 3.3, thanks Ezio. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue12309] os.environ was modified by test_packaging

2011-06-17 Thread STINNER Victor
STINNER Victor added the comment: A patch fixing os.environ warning for test_command_build_ext.py: diff --git a/Lib/packaging/tests/test_command_build_ext.py b/Lib/packaging/tests/test_command_build_ext.py --- a/Lib/packaging/tests/test_command_build_ext.py +++ b/Lib/packaging/tests

[issue10883] urllib: socket is not closed explicitly

2011-06-17 Thread STINNER Victor
STINNER Victor added the comment: ftp_close.patch: - (in passive mode) FTP.ntransfercmd() closes explicitly the socket on error: the caller has not access to the socket on error - OtherNetworkTests of test_urllib2net clears CacheFTPHandler cache: add a CacheFTPHandler.clear_cache() for that

[issue9246] os.getcwd() hardcodes max path len

2011-06-17 Thread STINNER Victor
STINNER Victor added the comment: Simpler patch replacing 1026 constant by MAXPATHLEN. On my Linux box, MAXPATHLEN is 4096 and os.pathconf('/', 'PC_PATH_MAX') returns 4096. I am able to get a path of 4095 bytes using the patch. -- Added file: http://bugs.

[issue9246] os.getcwd() hardcodes max path len

2011-06-17 Thread STINNER Victor
STINNER Victor added the comment: You may use get_current_dir_name() which allocates the memory for us. I can adapt os_getcwd_buffer-2.patch to support Solaris/OpenBSD, but do we need a dynamic buffer? (do we need to support OS without PATH_MAX

[issue9246] os.getcwd() hardcodes max path len

2011-06-17 Thread STINNER Victor
STINNER Victor added the comment: bigpath2.py: script to check the maximum path length of os.getcwd(). -- Added file: http://bugs.python.org/file22395/bigpath2.py ___ Python tracker <http://bugs.python.org/issue9

[issue12310] Segfault in test_multiprocessing

2011-06-17 Thread STINNER Victor
STINNER Victor added the comment: test_multiprocessing pass with success on PPC Tiger 3.x (and x86 Tiger 3.x, but the segfaults only occurred on PPC), but this issue is a sporadic issue. I close the issue because I hope that it is closed, but reopen it if you still see segfaults on PPC Tiger

[issue12320] test_packaging failures

2011-06-17 Thread STINNER Victor
STINNER Victor added the comment: I fixed the issue #12333. I don't see any test_packaging failure anymore, let's close this issue. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.py

[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

2011-06-17 Thread STINNER Victor
STINNER Victor added the comment: > What about something like .decode('mbcs', errors='windows')? Yes, we can use an error handler specific to the mbcs codec, but I would prefer to not introduce special error handlers. For os.fsencode(), we can keep it unchanged, or

[issue12167] test_packaging reference leak

2011-06-18 Thread STINNER Victor
STINNER Victor added the comment: > test_build_ext builds and imports xx. I changed test test to use a subprocess: New changeset 144cea8db9a5 by Victor Stinner in branch 'default': Issue #12333: run tests on the new module in a subprocess http://hg.python.org/cpython/rev/144

[issue12363] test_signal.test_without_siginterrupt() sporadic failures on FreeBSD 6.4

2011-06-19 Thread STINNER Victor
New submission from STINNER Victor : == FAIL: test_siginterrupt_on (test.test_signal.SiginterruptTest) -- Traceback (most recent call last): File "/usr

[issue12364] Timeout (1 hour) in test_concurrent_futures.tearDown() on sparc solaris10 gcc 3.x

2011-06-19 Thread STINNER Victor
New submission from STINNER Victor : [271/356/1] test_concurrent_futures Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/multiprocessing/queues.py", line 268, in _feed send(obj) File "/home2/buildbot/slave/3.x.loewi

[issue12363] test_signal.test_without_siginterrupt() sporadic failures on FreeBSD 6.4

2011-06-19 Thread STINNER Victor
STINNER Victor added the comment: Seen also on OpenSolaris: test test_signal failed -- Traceback (most recent call last): File "/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/test/test_signal.py", line 399, in test_siginterrupt_on self.assertTrue(i) AssertionEr

[issue12367] select.error has no errno attribute

2011-06-19 Thread STINNER Victor
New submission from STINNER Victor : It would be nice to have a errno attribute for select.error. I don't know if select.errno should inherit from OSError, WindowsError or nothing. See also the PEP 3151: http://www.python.org/dev/peps/pep-3151/#common-errnos-with-select-

[issue12363] test_signal.test_without_siginterrupt() sporadic failures on FreeBSD 6.4

2011-06-19 Thread STINNER Victor
STINNER Victor added the comment: I tried to patch the test to use a semaphore, but my patch was not reliable (don't remove completly the race condition). Here is a patch using a subprocess to: - have only one thread - have a timeout on the blocking read (select cannot be used in the

[issue3067] setlocale error message is confusing

2011-06-19 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue3067> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9436] test_sysconfig failure: build a 32-bit Python a 64-bit OS

2011-06-19 Thread STINNER Victor
Changes by STINNER Victor : -- title: test_sysconfig failure -> test_sysconfig failure: build a 32-bit Python a 64-bit OS ___ Python tracker <http://bugs.python.org/iss

[issue7652] Merge C version of decimal into py3k.

2011-06-19 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue7652> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12191] Add shutil.chown to allow to use user and group name (and not only uid/gid)

2011-06-19 Thread STINNER Victor
STINNER Victor added the comment: shutil_chown-default-v3.patch: - os.chown() is only available on Unix, shutil.chown() should not be defined if os.chown() doesn't exist (require to add a @unittest.skipUnless decorator to the test) - tests: is it possible that shutil.chown() exists wh

[issue12314] regrtest checks (os.environ, sys.path, etc.) are hard to use

2011-06-19 Thread STINNER Victor
STINNER Victor added the comment: > I’d like regrtest to tell me what exactly was changed, and where. regrtests has many tests (you give some examples: os.environ, sys.path), run all tests after calling a single test function would make regrtest slower. We can add an option (e.g. --str

[issue12338] multiprocessing.util._eintr_retry doen't recalculate timeouts

2011-06-19 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo, pitrou ___ Python tracker <http://bugs.python.org/issue12338> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12338] multiprocessing.util._eintr_retry doen't recalculate timeouts

2011-06-19 Thread STINNER Victor
STINNER Victor added the comment: subprocess._communicate_with_select() retries select.select() on EINTR: it recomputes timeout before each call. while self._read_set or self._write_set: timeout = self._remaining_time(endtime) if timeout is not None and timeout < 0: ra

[issue12371] datetime.now() bug

2011-06-20 Thread STINNER Victor
STINNER Victor added the comment: str(datetime object) doesn't contain a dot if obj.microsecond equals zero. You can use obj=obj.replace(microsecond=0) to create a new datetime object using microsecond=0. Or just test that str(obj) contains a dot or not. It is not a bug in P

[issue12367] select.error has no errno attribute

2011-06-20 Thread STINNER Victor
STINNER Victor added the comment: select_errno.patch: select.error now inherits from OSError and so have an errno attribute. I only ran the unit test on Linux, it should be tested on Windows. -- keywords: +patch Added file: http://bugs.python.org/file22414/select_errno.patch

[issue12337] Need real TextIOWrapper for stdin/stdout

2011-06-20 Thread STINNER Victor
STINNER Victor added the comment: > so there really was a bug. > If fixed in 3.2.1, this issue could be closed. This issue is a duplicate of #11272: upgrade to Python 3.2.1. -- resolution: -> duplicate status: open -> closed ___ Py

[issue11873] test_regexp() of test_compileall fails occassionally

2011-06-20 Thread STINNER Victor
STINNER Victor added the comment: > What about Windows? tempfile.mkdtemp(prefix='bar') can generate > ...\tmpxxbaxx\... Or compileall does first normalize the path? @r.david.murray: You reopened the issue, but you didn't answer to this question. And, is there a bug

[issue12090] 3.2: build --without-threads fails

2011-06-20 Thread STINNER Victor
STINNER Victor added the comment: > Yes, this is fixed in 3.2. > I just left the issue open as a reminder for the release branch. The issue is still open, can it be closed? What do you mean by "release branch"? -- ___ Pytho

[issue6697] Check that _PyUnicode_AsString() result is not NULL

2011-06-20 Thread STINNER Victor
STINNER Victor added the comment: > I wrote a similar patch to add PyModule_GetNameObject() > (I am working on another huge patch, to fix #3080) Issue #3080 added the PyModule_GetNameObject() function, so it simplify your patch. I commited your issue6697-lsprof.diff patch, I just f

[issue6697] Check that _PyUnicode_AsString() result is not NULL

2011-06-20 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/issue6697> ___ ___ Python-bugs-list

[issue7732] imp.find_module crashes Python if there exists a directory named "__init__.py"

2011-06-20 Thread STINNER Victor
STINNER Victor added the comment: import_directory-py3k.patch: find_module_path_list() ignores silently directories matching requested filename pattern (like module_name + ".py"). I don't think that it is useful to emit a warning (or raise an error) here, the code checks f

[issue7732] imp.find_module crashes Python if there exists a directory named "__init__.py"

2011-06-20 Thread STINNER Victor
STINNER Victor added the comment: pyfile_fromfile_close.patch: patch based on issue7732_find_module_v2.diff, fixing this issue in Python 2.7 - PyFile_FromFile() closes the file on PyString_FromString() failure (note: unlikely failure) - call_find_module() doesn't close the file an

<    11   12   13   14   15   16   17   18   19   20   >