[issue12364] Deadlock in test_concurrent_futures

2011-07-05 Thread STINNER Victor
Changes by STINNER Victor : -- title: Timeout (1 hour) in test_concurrent_futures.tearDown() on sparc solaris10 gcc 3.x -> Deadlock in test_concurrent_futures ___ Python tracker <http://bugs.python.org/issu

[issue12459] time.sleep(-1.0) behaviour

2011-07-05 Thread STINNER Victor
STINNER Victor added the comment: Tim Lesher agreed to raise an exception ("That makes sense. Better to be consistent within the time API--I know the different semantics of time.clock() have confused people around here."), so I think that everybody agreed to raise an exception.

[issue12494] subprocess: check_output() doesn't close pipes on error

2011-07-05 Thread STINNER Victor
STINNER Victor added the comment: See also issue #12044 which changed the context manager to call the wait() method. -- ___ Python tracker <http://bugs.python.org/issue12

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-07-05 Thread STINNER Victor
STINNER Victor added the comment: See also issue #12494: "subprocess: check_output() doesn't close pipes on error". -- nosy: +haypo ___ Python tracker <http://bugs.pyt

[issue12493] subprocess: Popen.communicate() doesn't handle EINTR in some cases

2011-07-06 Thread STINNER Victor
STINNER Victor added the comment: > Out of curiosity, how could SIGALRM be missing on a Unix system? It is only missing on Windows. -- ___ Python tracker <http://bugs.python.org/issu

[issue12508] Codecs Anomaly

2011-07-06 Thread STINNER Victor
STINNER Victor added the comment: I confirm, there is a bug in codecs.StreamReader. -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue12

[issue12508] Codecs Anomaly

2011-07-06 Thread STINNER Victor
STINNER Victor added the comment: You should use the io module, it doesn't have the bug :) -- ___ Python tracker <http://bugs.python.org/issue12508> ___ ___

[issue9242] unicodeobject.c: use of uninitialized values

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

[issue5505] sys.stdin.read() doesn't return after first EOF on Windows

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

[issue10117] Tools/scripts/reindent.py fails on non-UTF-8 encodings

2011-07-07 Thread STINNER Victor
STINNER Victor added the comment: > Leaving open to discuss whether anything can/should be done > for the case when reindent acts as an stdin sys.stdin.buffer and sys.stdout.buffer should be used with tokenize.detect_encoding(). We may read first stdin and write it into a BytesIO obj

[issue10284] NNTP should accept bytestrings for username and password

2011-07-07 Thread STINNER Victor
Changes by STINNER Victor : -- components: +Unicode nosy: +haypo ___ Python tracker <http://bugs.python.org/issue10284> ___ ___ Python-bugs-list mailing list Unsub

[issue10945] bdist_wininst depends on MBCS codec, unavailable on non-Windows

2011-07-07 Thread STINNER Victor
STINNER Victor added the comment: Can't you only work with Unicode and avoid the MBCS encoding? -- nosy: +haypo ___ Python tracker <http://bugs.python.org/is

[issue10872] Add mode to TextIOWrapper repr

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

[issue12512] codecs: StreamWriter issue with stateful codecs after a seek

2011-07-07 Thread STINNER Victor
New submission from STINNER Victor : The following code fails with an AssertionError('###\ufeffdef'): import codecs _open = codecs.open #_open = open filename = "test" with _open(filename, 'w', encoding='utf_16') as f: f.write('abc')

[issue12512] codecs: StreamWriter issues with stateful codecs after a seek or with append mode

2011-07-07 Thread STINNER Victor
STINNER Victor added the comment: There is a similar bug for append mode: import codecs _open = codecs.open #_open = open filename = "test" with _open(filename, 'w', encoding='utf_16') as f: f.write('abc') with _open(filename, 'a', enco

[issue12513] codec.StreamReaderWriter: issues with interlaced read-write

2011-07-07 Thread STINNER Victor
New submission from STINNER Victor : The following test fails with an AssertionError('a' != 'b') on the first read. import codecs FILENAME = 'test' with open(FILENAME, 'wb') as f: f.write('abcd'.encode('utf-8')) with codecs

[issue5505] sys.stdin.read() doesn't return after first EOF on Windows

2011-07-07 Thread STINNER Victor
STINNER Victor added the comment: I am still able to reproduce the problem with Python 3.2.1RC1 (64 bits) on Windows Seven, but not on Python 3.3 (alpha) compiled myself (using Visual C++ Express 2008). I don't know if something changed in Python 3.3, or it is related to how I com

[issue5505] sys.stdin.read() doesn't return after first EOF on Windows

2011-07-07 Thread STINNER Victor
STINNER Victor added the comment: > I don't know if something changed in Python 3.3, or ... Yes, something changed in Python 3.3. I fixed this issue "by mistake" :-) The fix is the following commit: New changeset 3c7792ec4547 by Victor Stinner in branch '

[issue12517] Large file support on Windows: sizeof(off_t) is 32 bits

2011-07-07 Thread STINNER Victor
New submission from STINNER Victor : FileIO.readall() and _parse_off_t() help of the posix module use the off_t type. This type is only 32 bits long and so don't support files bigger than 4 GB (or maybe just 2 GB?). The Py_off_t type should be used instead. -- components: Wi

[issue12517] Large file support on Windows: sizeof(off_t) is 32 bits

2011-07-07 Thread STINNER Victor
STINNER Victor added the comment: fileio_py_off_t.patch: Fix for FileIO.readall(). The consequence of the integer overflow in new_buffersize() looks to be that the buffer can be too small in some cases (and so readall() can be very slow?). -- keywords: +patch Added file: http

[issue12517] Large file support on Windows: sizeof(off_t) is 32 bits

2011-07-07 Thread STINNER Victor
STINNER Victor added the comment: _parse_off_t() is used by the following functions: - lockf - pread, pwrite - sendfile - truncate, ftruncate - posix_advice, posix_fallocate Windows has none of these functions. _parse_off_t() may be surrounded by #ifndef MS_WINDOWS with a comment explaining

[issue10117] Tools/scripts/reindent.py fails on non-UTF-8 encodings

2011-07-07 Thread STINNER Victor
STINNER Victor added the comment: reindent_coding.py: patch fixing reindent.py when using pipes (stdin and stdout). -- versions: +Python 3.3 Added file: http://bugs.python.org/file22611/reindent_coding.py ___ Python tracker <http://bugs.python.

[issue10117] Tools/scripts/reindent.py fails on non-UTF-8 encodings

2011-07-07 Thread STINNER Victor
STINNER Victor added the comment: > When working as a filter, reindent should use sys.{stdin,stdout}.encoding > (defaulting to sys.getdefaultencoding()) for reading and writing, > respectively. It just doesn't work: you cannot read a ISO-8859-1 file from UTF-8 (if your locale e

[issue12016] Wrong behavior for '\xff\n'.decode('gb2312', 'ignore')

2011-07-07 Thread STINNER Victor
STINNER Victor added the comment: > Because I consider this issue as a bug, I would like > to apply this patch to 2.7, 3.2 and 3.3. It is maybe a bug but it is also an important change on Python behaviour, so finally I prefer to only change (fix) Python 3.3. Thanks for reporting the

[issue12423] signal handler doesn't handle SIGABRT from os.abort

2011-07-07 Thread STINNER Victor
STINNER Victor added the comment: > Here's my proposed patch for the documentation, against > the head of the 2.7 branch. Thanks, I applied your pach to 2.7, 3.2 and 3.3 doc. -- resolution: -> fixed status: open -> closed versions: +Python 3.2, Pytho

[issue12429] test_io.check_interrupted_write() sporadic failures on FreeBSD 6 on Python 2.7/3.2

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

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

2011-07-07 Thread STINNER Victor
STINNER Victor added the comment: @neologix: I don't understand why do you want to hurry, this issue will not be fixed in the next release (3.2.1, it's too late), and I don't think that the next release (3.3? or is it something before?) will come before few months. -- I d

[issue12181] SIGBUS error on OpenBSD (sparc64)

2011-07-07 Thread STINNER Victor
STINNER Victor added the comment: @neologix: New try. Why did you remove your patch? -- ___ Python tracker <http://bugs.python.org/issue12181> ___ ___ Python-bug

[issue1195571] simple callback system for Py_FatalError

2011-07-07 Thread STINNER Victor
STINNER Victor added the comment: > Sorry, the documentation in the patch is wrong Can you update your patch please? -- ___ Python tracker <http://bugs.python.org/issue1

[issue12486] tokenize module should have a unicode API

2011-07-09 Thread STINNER Victor
STINNER Victor added the comment: The compiler has a PyCF_SOURCE_IS_UTF8 flag: see compile() builtin. The parser has a flag to ignore the coding cookie: PyPARSE_IGNORE_COOKIE. Patch tokenize to support Unicode is simple: use PyCF_SOURCE_IS_UTF8 and/or PyPARSE_IGNORE_COOKIE flags and encode

[issue12550] regrtest: register SIGALRM signal using faulthandler

2011-07-13 Thread STINNER Victor
New submission from STINNER Victor : Sometimes, some tests are stopped because of SIGALRM. A recent example: --- [157/357] test_socketserver Alarm clock *** Error code 142 --- http://www.python.org/dev/buildbot/all/builders/x86%20FreeBSD%206.4%203.x/builds

[issue12149] Segfault in _PyObject_GenericGetAttrWithDict

2011-07-13 Thread STINNER Victor
STINNER Victor added the comment: Oooh, an interesting and complex bug with an one-liner fix! -- ___ Python tracker <http://bugs.python.org/issue12149> ___ ___

[issue12545] Incorrect handling of return codes in the posix_lseek function in posixmodule.c

2011-07-13 Thread STINNER Victor
STINNER Victor added the comment: "... A negative file offset may be valid for some devices in some implementations. The POSIX.1-1990 standard did not specifically prohibit lseek() from returning a negative offset. Therefore, an application was required to clear errno prior to the cal

[issue12545] Incorrect handling of return codes in the posix_lseek function in posixmodule.c

2011-07-13 Thread STINNER Victor
STINNER Victor added the comment: > How would it work? The C lseek() takes a signed (64-bit) offset > as argument, so we would have to call it multiple times anyway. Python does already call multiple times the same function if the input is larger than the type used by the function

[issue4376] Nested ctypes 'BigEndianStructure' fails

2011-07-13 Thread STINNER Victor
STINNER Victor added the comment: I don't like your test because it depends on system endian: +if sys.byteorder == "little": +struct.menu.spam = 0x00FF +else: +struct.menu.spam = 0xFF00 I would prefer a test creat

[issue4376] Nested ctypes 'BigEndianStructure' fails

2011-07-13 Thread STINNER Victor
STINNER Victor added the comment: > But if you set raw memory to let's say b'\0\0\0\1', > when you look at the c_int value afterwards, won't it > be different on little endian and big endian machines? A big endian structure is supposed to read and write memory in

[issue4376] Nested ctypes 'BigEndianStructure' fails

2011-07-13 Thread STINNER Victor
STINNER Victor added the comment: I commited your fix, thanks Vlad! -- ___ Python tracker <http://bugs.python.org/issue4376> ___ ___ Python-bugs-list mailin

[issue9592] Limitations in objects returned by multiprocessing Pool

2011-07-13 Thread STINNER Victor
STINNER Victor added the comment: A recent test_rapid_restart hang: [ 14/357] test_multiprocessing Timeout (1:00:00)! Thread 0xb18c4b70: File "/var/lib/buildslave/3.x.murray-gentoo-wide/build/Lib/threading.py", line 237 in wait File "/var/lib/buildslave/3.x.murray-gentoo

[issue12550] regrtest: register SIGALRM signal using faulthandler

2011-07-13 Thread STINNER Victor
STINNER Victor added the comment: My patch doesn't work: the traceback is not printed: -- $ ./python -m test -v -u network -F test_threadsignals (...) [106] test_socketserver (...) test_UnixStreamServer (test.test_socketserver.SocketServerTest) ... creating server

[issue5505] sys.stdin.read() doesn't return after first EOF on Windows

2011-07-14 Thread STINNER Victor
STINNER Victor added the comment: > I get this on Linux with ^D With which Python version? Did you try Python 3.3 (development version)? -- ___ Python tracker <http://bugs.python.org/iss

[issue12550] regrtest: register SIGALRM signal using faulthandler

2011-07-14 Thread STINNER Victor
STINNER Victor added the comment: Oops, I specified the wrong issue number if the commits: New changeset d3cebbd500aa by Victor Stinner in branch '2.7': Issue #12250: test_socketserver uses a timeout of 60 seconds instead of 20 http://hg.python.org/cpython/rev/d3cebbd500aa New

[issue12250] regrtest: make --timeout explicit

2011-07-14 Thread STINNER Victor
Changes by STINNER Victor : -- Removed message: http://bugs.python.org/msg140332 ___ Python tracker <http://bugs.python.org/issue12250> ___ ___ Python-bugs-list m

[issue12250] regrtest: make --timeout explicit

2011-07-14 Thread STINNER Victor
STINNER Victor added the comment: (I commited fixes for issue #12550 but specified issue #12250 in the changlog, I removed the related comment from python-dev from this issue) -- ___ Python tracker <http://bugs.python.org/issue12

[issue12550] regrtest: register SIGALRM signal using faulthandler

2011-07-14 Thread STINNER Victor
STINNER Victor added the comment: > Can this be closed? I think (hope) that the initial issue (test_socketserver) failure is fixed, thanks to my second commit. I'm not complelty satisfied because the traceback was not printed on a SIGALRM when i tried -m test -F test_socketserver.

[issue12567] curses implementation of Unicode is wrong in Python 3

2011-07-14 Thread STINNER Victor
New submission from STINNER Victor : curses functions accepting strings encode implicitly character strings to UTF-8. This is wrong. We should add a function to set the encoding (see issue #6745) or use the wide character C functions. I don't think that UTF-8 is the right default encodi

[issue12568] Add functions to get the width in columns of a character

2011-07-14 Thread STINNER Victor
New submission from STINNER Victor : Some characters take more than one column in a terminal, especially CJK (chinese, japanese, korean) characters. If you use such character in a terminal without taking care of the width in columns of each character, the text alignment can be broken. Issue

[issue2382] [Py3k] SyntaxError cursor shifted if multibyte character is in line.

2011-07-14 Thread STINNER Victor
STINNER Victor added the comment: I just created the issue #12568 for unicode_width.patch. -- ___ Python tracker <http://bugs.python.org/issue2382> ___ ___ Pytho

[issue6755] Patch: new method get_wch for ncurses bindings: accept wide characters (unicode)

2011-07-14 Thread STINNER Victor
STINNER Victor added the comment: > I don't really know what is still required _cursesmodule.311.get_wch.patch doesn't apply correctly on Python 3.3 and use PyInt_FromLong() function, function removed from Python 3.0. Indeed, Iñigo wrote that the patch was not tested. > wha

[issue12567] curses implementation of Unicode is wrong in Python 3

2011-07-14 Thread STINNER Victor
STINNER Victor added the comment: getkey.patch fixes window.getkey(): use get_wch() instead of getch() to handle correctly non-ASCII characters. I tested with the key é (U+00E9) with ISO-8859-1 and UTF-8 locale encoding: getkey() gives the expected result (but addstr is unable to display it

[issue6745] (curses) addstr() takes str in Python 3

2011-07-14 Thread STINNER Victor
STINNER Victor added the comment: I created issue #12567 to fix the Unicode support of the curses module in Python 3. -- ___ Python tracker <http://bugs.python.org/issue6

[issue12502] 100% cpu usage when using asyncore with UNIX socket

2011-07-15 Thread STINNER Victor
Changes by STINNER Victor : -- Removed message: http://bugs.python.org/msg140388 ___ Python tracker <http://bugs.python.org/issue12502> ___ ___ Python-bugs-list m

[issue12502] 100% cpu usage when using asyncore with UNIX socket

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: Woops, I don't know how, but I removed a neologix's message: "Patch committed, closing. Alexey, thanks for reporting this. (I'll open a separate issue to increase the tests coverage)." -- nosy: +haypo _

[issue12569] sqlite3 segfaults and bus errors when given certain unicode strings as queries

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: I already fixed this issue in Python 3.1, 3.2 and 3.3: issue #6697 (e.g. commit 7ba851d1b46e). $ ./python Python 3.3.0a0 (default:ab162f925761, Jul 15 2011, 09:36:17) >>> import sqlite3 >>> c = sqlite3.connect(":memory:") >&

[issue12569] sqlite3 segfaults and bus errors when given certain unicode strings as queries

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: > I already fixed this issue in Python 3.1, 3.2 and 3.3: > issue #6697 (e.g. commit 7ba851d1b46e). Oh, wrong: the bug was only fixed in Python 3.2 and 3.3. There was already a check after _PyUnicode_AsStringAndSize(), but the test was on the wrong va

[issue12571] Python built on Linux 3.0 doesn't include DLFCN

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: This issue is related to issue #12326. -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue12571> ___ ___ Python-bug

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

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: > Here we go, first Linux3-related bug report: > https://bugs.gentoo.org/show_bug.cgi?id=374579 (see issue #12571). Oh, some people use the DLFCN module :-) -- I'm still in favor of keeping sys.platform == 'linux3', and you? For p

[issue12569] sqlite3 segfaults and bus errors when given certain unicode strings as queries

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: > It seems that a fix was merged in the 3.1 branch, > somewhere between 3.1.2 and 3.1.3. Which fix? The code is still wrong in Mercurial (branch 3.1): 493 operation_cstr = _PyUnicode_AsStringAndSize(operation, &operation_len); 494 if

[issue1813] Codec lookup failing under turkish locale

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: The decimal module has been fixed in Python 2.7, 3.2 and 3.3 for Turkish local: issue #11830. -- ___ Python tracker <http://bugs.python.org/issue1

[issue6755] Patch: new method get_wch for ncurses bindings: accept wide characters (unicode)

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: > I see it has been moved to "committed/rejected" > status - does that mean that it might still go in, or that > it is rejected? I commited the new method, did you see my commit dec10ad41b2a? I propose to continue the discussion on issue

[issue12567] curses implementation of Unicode is wrong in Python 3

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: Oh, by the way: do all platforms have wide character functions? I don't see any failure on our Python 3.x buildbots, but test_curses is skipped on many buildbots. -- ___ Python tracker <http://bugs.py

[issue6755] Patch: new method get_wch for ncurses bindings: accept wide characters (unicode)

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: > implicit declaration of function ‘wget_wch’ Oh oh, I expected such error: it means that your ncurses library don't have the wide character API. The compiler command confirm that: "gcc ... -lncurses ...". You use libncurses and not lib

[issue12567] curses implementation of Unicode is wrong in Python 3

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: > by the way: do all platforms have wide character functions? See msg140408 and msg140409: Antoine Pitrou (OS=Mageia 1) and some buildbots don't have get_wch(). -- ___ Python tracker <http://bugs

[issue6755] Patch: new method get_wch for ncurses bindings: accept wide characters (unicode)

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: > ... I suppose that it's because readline is linked to libncurses > (and not libncursesw) => see issue #7384. See also the issue #9408. -- ___ Python tracker <http://bugs.pyt

[issue444582] Finding programs in PATH, adding shutil.which

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

[issue3177] Add shutil.open

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: > dependencies: + Finding programs in PATH, adding shutil.which Why did you add this dependency? For example, subprocess is able to locate a program if the program has no full path. We don't need a which function. -- nosy

[issue12561] Compiler workaround for wide string constants in Modules/getpath.c (patch)

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: Use >L"" CONSTANT< to decode a byte string to a character string doesn't work with non-ASCII strings. _Py_char2wchar() should be used instead: see for example this fix, commit 5b6e13b6b473. --

[issue12572] HP/UX compiler workarounds

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

[issue5999] compile error on HP-UX 11.22 ia64 - 'mbstate_t' is used as a type, but has not been defined as a type

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

[issue12572] HP/UX compiler workarounds

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: You may the number of this issue in a comment of your patch. -- ___ Python tracker <http://bugs.python.org/issue12572> ___ ___

[issue12572] HP/UX compiler workarounds

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: Oops. You may *add* the number of this issue in a comment of your patch. -- ___ Python tracker <http://bugs.python.org/issue12

[issue12572] HP/UX compiler workarounds

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: I think that getpath.patch is wrong (it's just a workaround hiding a real bug): see msg140422 of the issue #12561. -- ___ Python tracker <http://bugs.python.org/is

[issue12561] Compiler workaround for wide string constants in Modules/getpath.c (patch)

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: > Stinner - is the patch you mentioned in a released version > of Python 3.2? Yes, Python 3.2.1. (It's not part of Python 3.1.) > Also, how is it affected by the fact that the (wide char) strings > in question are constants? I don'

[issue5505] sys.stdin.read() doesn't return after first EOF on Windows

2011-07-18 Thread STINNER Victor
STINNER Victor added the comment: @pitrou: Antoine, do you think that the following commit should be backported from 3.3 to 3.2? New changeset 3c7792ec4547 by Victor Stinner in branch 'default': Issue #12175: BufferedReader.read(-1) now calls raw.readall() if available. http://hg.

[issue12133] ResourceWarning in urllib.request

2011-07-18 Thread STINNER Victor
STINNER Victor added the comment: I reopen the issue. -- resolution: fixed -> accepted status: closed -> open ___ Python tracker <http://bugs.python.org/i

[issue12133] ResourceWarning in urllib.request

2011-07-18 Thread STINNER Victor
STINNER Victor added the comment: (Oh, I missed Antoine's comment, yes, reopen a new issue) -- resolution: accepted -> fixed status: open -> closed ___ Python tracker <http://bugs.python.

[issue12576] urlib.request fails to open some sites

2011-07-18 Thread STINNER Victor
STINNER Victor added the comment: h.close() (HTTPConnection.close) in the finally block of AbstractHTTPHandler.do_open() calls indirectly r.close() (HTTPResponse.close). The problem is that the content of the response cannot be read if its close() method was called. The changelog of the fix

[issue12576] urlib.request fails to open some sites

2011-07-18 Thread STINNER Victor
STINNER Victor added the comment: ValueError('I/O operation on closed file') error comes from HTTPResponse.__enter__() which is implemented in IOBase: def __enter__(self): # That's a forward reference self._checkClosed()

[issue12576] urlib.request fails to open some sites

2011-07-18 Thread STINNER Victor
STINNER Victor added the comment: imdb.com and python.org use HTTP/1.1. imdb.com server sends a "Transfer-encoding: chunked" header whereas python.org doesn't. python.org has a "Connection: close" header, whereas imdb.com doesn't. The more revelant di

[issue5505] sys.stdin.read() doesn't return after first EOF on Windows

2011-07-18 Thread STINNER Victor
STINNER Victor added the comment: > No, I don't think so. The issue is already fixed in 3.3, so you agree to not fix it in Python 3.2? -- ___ Python tracker <http://bugs.python.or

[issue12567] curses implementation of Unicode is wrong in Python 3

2011-07-18 Thread STINNER Victor
STINNER Victor added the comment: Patch the _curses module to improve Unicode support: - add an encoding attribute to a window (only visible in C): read the locale encoding - encode a character and a character string to the window encoding if the ncursesw library is NOT used - addch

[issue12567] curses implementation of Unicode is wrong in Python 3

2011-07-18 Thread STINNER Victor
STINNER Victor added the comment: Using curses_unicode.patch: - without ncursesw: addch('é') raises an OverflowError because 'é'.encode('UTF-8') is 2 bytes and not 1 byte - with ncursesw: the charset is displayable character depends on the locale encoding (e.g

[issue12567] curses implementation of Unicode is wrong in Python 3

2011-07-18 Thread STINNER Victor
STINNER Victor added the comment: See also #6755 (curses.get_wch). -- ___ Python tracker <http://bugs.python.org/issue12567> ___ ___ Python-bugs-list mailin

[issue6755] Patch: new method get_wch for ncurses bindings: accept wide characters (unicode)

2011-07-18 Thread STINNER Victor
STINNER Victor added the comment: > implicit declaration of function ‘wget_wch’ curses_unicode.patch of issue #12567 adds a HAVE_NCURSESW define to only use wide character functions if _curses is linked to libncursesw. This define can be used to fix this bug (use wget_ch whereas it is

[issue12546] builtin __format__ methods cannot fill with \x00 char

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

[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-19 Thread STINNER Victor
STINNER Victor added the comment: What is the result of int(float('inf')) ? -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue12589> ___ ___

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

2011-07-19 Thread STINNER Victor
STINNER Victor added the comment: > Your patch looks fine to me, except for this: > -if (platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6', > -'freebsd7', 'freebsd8') > -

[issue12545] Incorrect handling of return codes in the posix_lseek function in posixmodule.c

2011-07-20 Thread STINNER Victor
STINNER Victor added the comment: > So I'd suggest forgetting about this part. If someone really wants this feature (relative seek of more than 2^63), he/she should open a new issue. This issue remembers me a mktime() issue: mktime() may return -1 even if it is not an error. tim

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

2011-07-21 Thread STINNER Victor
STINNER Victor added the comment: > It seems currently that in python 3.2 sys.platform is linux2 > even though it is running linux 3 It's maybe because you ran ./configure with Linux 2.x.y (see msg138254). Try make distclean && ./configure -

[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-21 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +mark.dickinson ___ Python tracker <http://bugs.python.org/issue12589> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-21 Thread STINNER Victor
STINNER Victor added the comment: Is HAVE_DECL_ISINF defined in pyconfig.h? PyLong_FromDouble() uses Py_IS_INFINITY(x): -- /* Py_IS_INFINITY(X) * Return 1 if float or double arg is an infinity, else 0. * Caution: *X is evaluated more than once

[issue12576] urlib.request fails to open some sites

2011-07-21 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +ezio.melotti ___ Python tracker <http://bugs.python.org/issue12576> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12556] Disable size checks in mmap.mmap()

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

[issue12556] Disable size checks in mmap.mmap()

2011-07-21 Thread STINNER Victor
STINNER Victor added the comment: > That's what I thought, it's really uncommon: in that case, I'm > reluctant to making such a change, for the reason explained above. > Ross, Victor? Why do you want a mmap? Why not using a file? -- __

[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-21 Thread STINNER Victor
STINNER Victor added the comment: You may try: $ ./python >>> import ctypes >>> import ctypes.util >>> libc = ctypes.cdll.LoadLibrary(ctypes.util.find_library('c')) >>> isinf = libc.isinf >>> isinf.argtypes = (ctypes.c_do

[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-22 Thread STINNER Victor
STINNER Victor added the comment: The problem is in PyLong_FromDouble(): if (Py_IS_INFINITY(dval)) is evaluated as false, whereas dval *is* infinity. Possible causes: - Py_IS_INFINITY is not defined as "# define Py_IS_INFINITY(X) isinf(X)" (issue with the pyconfig.h file?) - th

[issue12607] subprocess(stdout=..., stderr=sys.stdout) breaks stderr for child

2011-07-22 Thread STINNER Victor
STINNER Victor added the comment: > stdout = open("/dev/null", "w"), stderr = sys.stdout You ask to write all outputs to /dev/null. Why do you expect anything on stdout? -- ___ Python tracker <http://

[issue12607] subprocess(stdout=..., stderr=sys.stdout) breaks stderr for child

2011-07-22 Thread STINNER Victor
STINNER Victor added the comment: > stdout = open("/dev/null", "w"), stderr = sys.stdout Oh, I read subprocess.STDOUT instead of sys.stdout. -- ___ Python tracker <http://

[issue12609] SystemError: Objects/codeobject.c:64: bad argument to internal function

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

[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-22 Thread STINNER Victor
STINNER Victor added the comment: > $grep -r '#define Py_IS_INF' . > PC/pyconfig.h:#define Py_IS_INFINITY(X) (!_finite(X) && !_isnan(X)) The PC/ directory is specific to Windows. Py_IS_INFINITY should be defined in Include/pymath.h (at least, in the 3.2 branch) &g

[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-22 Thread STINNER Victor
STINNER Victor added the comment: > If gdb has an endian issue, > you may also try "print /x d" in the gdb shell. Oh, forget me: /x converts the argument to an integer... -- ___ Python tracker <http://bugs.py

<    14   15   16   17   18   19   20   21   22   23   >