[issue4944] os.fsync() doesn't work as expect in Windows

2015-03-26 Thread Emil Styrke
Emil Styrke added the comment: eryksun, thank you for the explanation, the penny finally dropped for me. It's the *other* child processes that keep the file open, not the parent. Actually this bug started hitting me after I *stopped* doing exactly what you suggest (fdopen on the temp file),

[issue4944] os.fsync() doesn't work as expect in Windows

2015-03-26 Thread eryksun
eryksun added the comment: Emil, Your example child process opens the file with only read sharing, which fails with a sharing violation if some other process inherits the file handle with write access. The `with` block only prevents this in a single-threaded environment. When you spawn 10 chi

[issue23605] Use the new os.scandir() function in os.walk()

2015-03-26 Thread Ben Hoyt
Ben Hoyt added the comment: Victor, great work on pushing this out, especially with the "modifying the directories" fix. (And thanks Serhiy for pushing on correctness here.) Couple of comments/questions about your new os.walk() implementation. 1) The new implementation is more complex. Of cour

[issue1191964] add non-blocking read and write methods to subprocess.Popen

2015-03-26 Thread Martin Panter
Martin Panter added the comment: Yes, I think the special return value of None is only standard to the “io” module, which was added in Python 2.6 and 3. And even there it is inconsistent. For what it’s worth, don’t have strong opinions on the special non-blocking and broken pipe cases, as long

[issue13322] buffered read() and write() does not raise BlockingIOError

2015-03-26 Thread Martin Panter
Martin Panter added the comment: See also Issue 1191964, discussing inconsistencies and how to differentiate the four non-blocking special results in a new API: * read signals permanent EOF * read signals no data temporarily available * write signals a permanently broken pipe or connection * wr

[issue23529] Limit decompressed data when reading from LZMAFile and BZ2File

2015-03-26 Thread Nikolaus Rath
Nikolaus Rath added the comment: I believe Martin's patch (v8) is ready for a core committer review. At least I can't find anything to criticize anymore :-). -- ___ Python tracker _

[issue23529] Limit decompressed data when reading from LZMAFile and BZ2File

2015-03-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: Is it still work-in-progress or are you looking for a review? -- ___ Python tracker ___ ___ Python-b

[issue23611] Pickle nested names with protocols < 4

2015-03-26 Thread STINNER Victor
STINNER Victor added the comment: > It is used in multiprocessing and this is not configurable. Oh, it would be nice to switch to version 4 by default, or make it configurable. I read that the version 4 is faster. -- ___ Python tracker

[issue23290] Faster set copying

2015-03-26 Thread STINNER Victor
STINNER Victor added the comment: Is msg234811 the result of set_faster_copy_3.patch? If yes, I see no reason to not apply the patch: the patch is short and looks always fast, and sometimes *much* faster. I just leaved a small comment on the review. -- nosy: +haypo __

[issue1191964] add non-blocking read and write methods to subprocess.Popen

2015-03-26 Thread Josiah Carlson
Josiah Carlson added the comment: Non-blocking IO returning a None on "no data currently available" is new to me. It is new to me simply because I don't recall it ever happening in Python 2.x with any socket IO that I ever dealt with, and socket IO is my primary source for non-blocking IO expe

[issue23637] Warnings error with non-ascii chars.

2015-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The problem is that the warnings module works with unicode message almost all time except rare circumstances. So for sure this feature is used in many programs and it works for authors and most of users. An exception can be considered as a bug. --

[issue23611] Pickle nested names with protocols < 4

2015-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Pickle is backward compatible and Python 2 usually is able to unpickle data pickled by Python 3 with protocol < 3. The patch doesn't break compatibility. Current default protocol is 3 for compatibility with older Python 3 versions. It is used in multiprocess

[issue18828] urljoin behaves differently with custom and standard schemas

2015-03-26 Thread Martin Panter
Martin Panter added the comment: If necessary, we can add a new non_relative list, rather than changing non_hierarchical. The repository history shows that “non_hierarchical” was updated with new schemes once or twice, but has never been used since it was added to Python as “urlparse.py”. IMA

[issue23611] Pickle nested names with protocols < 4

2015-03-26 Thread STINNER Victor
STINNER Victor added the comment: Hum, I don't know well the pickle module. Is it backward compatible? Should Python 2 be able to unserialize data serialized by Python 3? If yes, can you patch break this compatibility? It is unclear to me if it makes sense to even modify protocols different th

[issue23637] Warnings error with non-ascii chars.

2015-03-26 Thread STINNER Victor
STINNER Victor added the comment: > Only thing required to make this work is add "u" in front of the message so > it is unicode. The warnings module works with non-ASCII characters if you only use bytes strings. I'm not sure that we should enhance it to support the unicode type in some fields

[issue23786] test_unaligned_buffers (test.test_hash.HashEqualityTestCase) ... Fatal Python error: Bus error

2015-03-26 Thread Christian Heimes
Christian Heimes added the comment: I'm puzzled about the segfault. I'm pretty sure that I've compiled and tested the code on big endian machines as well as a SPARC machines that doesn't allow unaligned memory access. The FNV code copies the blocks to an aligned buffer to prevent exactly this

[issue23648] PEP 475 meta issue

2015-03-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset b7c0137cccbe by Victor Stinner in branch 'default': Issue #23648: Document the PEP 475 in the "Porting to Python 3.5" section and https://hg.python.org/cpython/rev/b7c0137cccbe -- nosy: +python-dev ___ Py

[issue23676] Add support of UnicodeTranslateError in standard error handlers

2015-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: issue18814 -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue23676] Add support of UnicodeTranslateError in standard error handlers

2015-03-26 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka added the comment: > str.encode, bytes.decode and str.translate are unrelated to > UnicodeTranslateError. But str.transform could be. Can you please give an example of Python code to show your change? -- __

[issue23550] Add to unicodedata a function to query the "Quick_Check" property for a character

2015-03-26 Thread Hammerite
Hammerite added the comment: Here is a new patch. This version addresses several issues raised in review by Ezio Melotti and Berker Peksag. Where I have not (yet) addressed an issue, I have explained why not in my previous post. I attempted to preview my changes to the documentation that are n

[issue23676] Add support of UnicodeTranslateError in standard error handlers

2015-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: str.encode, bytes.decode and str.translate are unrelated to UnicodeTranslateError. But str.transform could be. -- ___ Python tracker ___

[issue23786] test_unaligned_buffers (test.test_hash.HashEqualityTestCase) ... Fatal Python error: Bus error

2015-03-26 Thread Peter
Peter added the comment: That's not a valid option on SPARC, (see https://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html ) the flag is only available on ARM it seems. -- ___ Python tracker

[issue23676] Add support of UnicodeTranslateError in standard error handlers

2015-03-26 Thread STINNER Victor
STINNER Victor added the comment: I'm sorry, I don't understand this issue. Could you please elaborate the use case? Why do you want to support more error handlers? str.translate() calls _PyUnicode_TranslateCharmap() with errors="ignore", it's not possible to choose the error handler. Many co

[issue23786] test_unaligned_buffers (test.test_hash.HashEqualityTestCase) ... Fatal Python error: Bus error

2015-03-26 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue23786] test_unaligned_buffers (test.test_hash.HashEqualityTestCase) ... Fatal Python error: Bus error

2015-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, 3.3 uses less efficient implementation. Try to compile Python with gcc option -mno-unaligned-access. -- nosy: +mark.dickinson ___ Python tracker ___

[issue23786] test_unaligned_buffers (test.test_hash.HashEqualityTestCase) ... Fatal Python error: Bus error

2015-03-26 Thread Peter
Peter added the comment: I've compiled Python 3.3.6 using the same options (./configure --prefix=/usr/local --enable-shared) and build system and that passes almost all the tests (test_uuid fails for an ignorable reason). Specifically test_hash passes fully: $ LD_LIBRARY_PATH=/usr/local/src/P

[issue21085] compile error Python3.3 on Cygwin

2015-03-26 Thread STINNER Victor
STINNER Victor added the comment: > In that case, May I edit configure script to generate the HAVE_* defines? > I'd like to add a statement to check the si_band to configure.ac. Does Cygwin use configure? If yes, go for configure. You can copy/paste my recent change for dirent.d_type field. >

[issue21085] compile error Python3.3 on Cygwin

2015-03-26 Thread Masayuki Yamamoto
Masayuki Yamamoto added the comment: Victor, In that case, May I edit configure script to generate the HAVE_* defines? I'd like to add a statement to check the si_band to configure.ac. > And please generate patches not the git format. Otherwise, Rietveld is unable > to generated the "review" l

[issue23786] test_unaligned_buffers (test.test_hash.HashEqualityTestCase) ... Fatal Python error: Bus error

2015-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Siphash24 implementation is not designed to work on platforms that require aligned access. But I'm surprised that fnv implementation crashes. I don't see anything wrong. May be gcc needs some special options to produce correct binaries on this platform? ---

[issue23786] test_unaligned_buffers (test.test_hash.HashEqualityTestCase) ... Fatal Python error: Bus error

2015-03-26 Thread Peter
Peter added the comment: I went and recompiled with: $ ./configure --prefix=/usr/local --enable-shared --with-hash-algorithm=siphash24 But this crashed as well. test_unaligned_buffers (test.test_hash.HashEqualityTestCase) ... Fatal Python error: Bus error Current thread 0x0001 (most rece

[issue23771] Timeouts on "x86 Ubuntu Shared 3.x" buildbot

2015-03-26 Thread STINNER Victor
STINNER Victor added the comment: A new failure test_subprocess.test_double_close_on_error: http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/11411/steps/test/logs/stdio --- Timeout (1:00:00)! Thread 0x55aafdc0 (most recent call first): File "/srv/buildbot/buildarea/3.

[issue21085] compile error Python3.3 on Cygwin

2015-03-26 Thread STINNER Victor
STINNER Victor added the comment: Could you please use a define like SIGINFO_HAS_SI_BAND? Something like: #if defined(HAVE_SIGINFO) && !defined(__CYGWIN__) /* Issue #21085: In Cygwin, siginfo_t does not have si_band field. */ # define SIGINFO_HAS_SI_BAND #endif And please generate patches

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-03-26 Thread R. David Murray
R. David Murray added the comment: No, I'm not going to write tests...my goal is to commit other people's patches, and I haven't even found time for that lately. And like you, I'm not convinced the fix is needed. There is one argument I can think of in favor, though: currently code that doe

[issue21085] compile error Python3.3 on Cygwin

2015-03-26 Thread Masayuki Yamamoto
Masayuki Yamamoto added the comment: I wrote improved patch to remove the 'si_band'. This patch modifies the 'n_in_sequence' to conform to the number of structure members. And I tested manually for struct_siginfo. struct_siginfo objects builds well. That's all for now. $ python3.4.exe Python

[issue18620] multiprocessing page leaves out important part of Pool example

2015-03-26 Thread Davin Potts
Changes by Davin Potts : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue23484] SemLock acquire() keyword arg 'blocking' is invalid

2015-03-26 Thread Davin Potts
Changes by Davin Potts : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue23602] Implement __format__ for Fraction

2015-03-26 Thread Stefan Krah
Stefan Krah added the comment: The zero isn't missing. :) We are following http://speleotrove.com/decimal/decarith.html, with thousands of test cases. We could decide to do something special for "g", but there are good reasons not to do that. -- _

[issue18828] urljoin behaves differently with custom and standard schemas

2015-03-26 Thread Demian Brecht
Demian Brecht added the comment: > The current behaviour when no scheme is present is fairly sensible to me and > should not be changed to do string concatenation nor raise an exception Agreed. Defaulting to relative behaviour makes sense as I imagine that'll be the general use case. > I remo

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Error message for ntpath is improved in 3.5. >>> import ntpath >>> ntpath.join([1, 2, 3]) Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/ntpath.py", line 111, in join genericpath._check_arg_types('join', path,

[issue23484] SemLock acquire() keyword arg 'blocking' is invalid

2015-03-26 Thread Davin Potts
Davin Potts added the comment: Attaching patches for 3.5/default, 3.4, and 2.7 which update the documentation on multiprocessing.Lock, RLock, Semaphore, and BoundedSemaphore to describe their actual implemented behavior, replacing the existing, misleading claim that they are clones of threadin

[issue23484] SemLock acquire() keyword arg 'blocking' is invalid

2015-03-26 Thread Davin Potts
Changes by Davin Potts : Added file: http://bugs.python.org/file38703/issue_23484_doc_locks_py27.patch ___ Python tracker ___ ___ Python-bugs-

[issue23602] Implement __format__ for Fraction

2015-03-26 Thread Wolfgang Maier
Wolfgang Maier added the comment: > Decimal formatting intentionally differs from float formatting, see #23460. I see. Thanks for the pointer. What about the missing zero in the exponent ? -- ___ Python tracker __

[issue9698] When reusing an handler, urllib(2)'s digest authentication fails after multiple regative replies

2015-03-26 Thread SpaceOne
Changes by SpaceOne : -- nosy: +spaceone ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org

[issue23602] Implement __format__ for Fraction

2015-03-26 Thread Stefan Krah
Stefan Krah added the comment: Decimal formatting intentionally differs from float formatting, see #23460. -- ___ Python tracker ___ _

[issue23602] Implement __format__ for Fraction

2015-03-26 Thread Wolfgang Maier
Wolfgang Maier added the comment: actually, I'm not sure whether formatting Decimals gives correct output under all conditions (correctly rounded yes, but maybe not formatted correctly?). compare: >>> format(float('1.481e-6'),'.3g') '1.48e-06' >>> format(Decimal('1.481e-6'),'.3g') '0.0148

[issue23784] Reloading tokenize module leads to error

2015-03-26 Thread R. David Murray
Changes by R. David Murray : -- resolution: fixed -> duplicate superseder: -> Reloading tokenize breaks tokenize.open() ___ Python tracker ___ __

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-03-26 Thread R. David Murray
R. David Murray added the comment: Python's philosophy is one of duck typing, which means that in general we just let the functions fail with whatever error they produce when the in put datatype is wrong. The error message in this case is fairly straightforward: you passed a list and it says

[issue23785] Leak in TextIOWrapper.tell()

2015-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Just reading the code that uses PyErr_Restore(). I found 3 issues and may be the fourth in sqlite (it is more complicate than other 3). -- ___ Python tracker ___

[issue23785] Leak in TextIOWrapper.tell()

2015-03-26 Thread Benjamin Peterson
Benjamin Peterson added the comment: How did you notice it, btw? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue23785] Leak in TextIOWrapper.tell()

2015-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It would be not easy to reproduce without special broken decoder. -- ___ Python tracker ___ ___ Py

[issue23785] Leak in TextIOWrapper.tell()

2015-03-26 Thread Benjamin Peterson
Benjamin Peterson added the comment: lgtm with a test -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue23786] test_unaligned_buffers (test.test_hash.HashEqualityTestCase) ... Fatal Python error: Bus error

2015-03-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +christian.heimes, jcea versions: +Python 3.5 ___ Python tracker ___ ___ Python-bugs-list maili

[issue23786] test_unaligned_buffers (test.test_hash.HashEqualityTestCase) ... Fatal Python error: Bus error

2015-03-26 Thread Peter
New submission from Peter: I compiled Python 3.4.3 on Solaris 11, and when I ran the regression test, I get a core dump when the hash() function was being used. I went through the bug database looking for something similar but couldn't find anything. Tests like: test_unaligned_buffers (test.te

[issue23783] Leak in PyObject_ClearWeakRefs

2015-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch should fix the issue. -- keywords: +patch stage: -> patch review versions: +Python 2.7, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file38700/issue23783.patch ___ Python tracker

[issue23785] Leak in TextIOWrapper.tell()

2015-03-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: +patch Added file: http://bugs.python.org/file38699/issue23785.patch ___ Python tracker ___ ___

[issue23785] Leak in TextIOWrapper.tell()

2015-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch chain original exception to the exception raised by setstate(saved_state). This matches the behavior of Python implementation. -- stage: -> patch review ___ Python tracker

[issue23785] Leak in TextIOWrapper.tell()

2015-03-26 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: If an exception was raised in TextIOWrapper.tell() and then restoring state is failed, original exception is lost and leaked. -- components: Extension Modules messages: 239327 nosy: benjamin.peterson, haypo, pitrou, serhiy.storchaka, stutzbach prior

[issue23663] Crash on failure in ctypes on Cygwin

2015-03-26 Thread David Macek
David Macek added the comment: Yeah, looks like exactly the same issue. Sorry for the duplicate. -- ___ Python tracker ___ ___ Python-

[issue23784] Reloading tokenize module leads to error

2015-03-26 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: out of date -> fixed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23663] Crash on failure in ctypes on Cygwin

2015-03-26 Thread Masayuki Yamamoto
Masayuki Yamamoto added the comment: similar issue #23338: PyErr_Format in ctypes uses invalid parameter -- nosy: +masamoto ___ Python tracker ___ ___

[issue18828] urljoin behaves differently with custom and standard schemas

2015-03-26 Thread Martin Panter
Martin Panter added the comment: The current behaviour when no scheme is present is fairly sensible to me and should not be changed to do string concatenation nor raise an exception: >>> urljoin("//netloc/old/path", "new/path") '//netloc/old/new/path' I am posting urljoin-non-hier.patch as an

[issue23784] Reloading tokenize module leads to error

2015-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Fixed in issue23615. -- nosy: +serhiy.storchaka resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker ___

[issue23784] Reloading tokenize module leads to error

2015-03-26 Thread David Marks
New submission from David Marks: On 432 in tokenize.py there is an assignment _builtin_open = open Followed in 434 with a redefinition of open def open(filename): If the module is reloaded, _builtin_open gets reassigned to the new function and subsequent calls to _builtin_open fail. ---

[issue23782] Leak in _PyTraceback_Add

2015-03-26 Thread STINNER Victor
STINNER Victor added the comment: If a new exception is raised by _PyTraceback_Add(), the original exception is lost. It's sad because _PyTraceback_Add() is supposed to enhance the current exception, not to drop it. In the draft of my PEP 490, I propose to chain the two exceptions. --

[issue23783] Leak in PyObject_ClearWeakRefs

2015-03-26 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: If restore_error == 1 in PyObject_ClearWeakRefs() (Objects/weakrefobject.c:883) and PyTuple_New() fails in Objects/weakrefobject.c:923, PyErr_Fetch is called twice and both exceptions leak. -- components: Extension Modules messages: 239320 nosy: fd

[issue23782] Leak in _PyTraceback_Add

2015-03-26 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: There is a leak of fetched exception in _PyTraceback_Add() (Python/traceback.c:146). -- messages: 239319 nosy: georg.brandl, haypo, serhiy.storchaka priority: normal severity: normal status: open title: Leak in _PyTraceback_Add type: resource usage

[issue23781] Add private _PyErr_ReplaceException() in 2.7

2015-03-26 Thread STINNER Victor
STINNER Victor added the comment: FIY I'm working on a draft of new PEP to chain exceptions at C level: PEP 490. -- ___ Python tracker ___ ___

[issue23781] Add private _PyErr_ReplaceException() in 2.7

2015-03-26 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch adds internal private function _PyErr_ReplaceException() in 2.7. This functions is like _PyErr_ChainExceptions() in 3.x, but doesn't set the context. It makes the code of 2.x simpler and more similar to 3.x and makes the backporting from 3.x

[issue18408] Fixes crashes found by pyfailmalloc

2015-03-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset b742c1c5c0bf by Victor Stinner in branch 'default': PEP 490: add issue 18408 https://hg.python.org/peps/rev/b742c1c5c0bf -- ___ Python tracker

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-03-26 Thread Boštjan Mejak
Changes by Boštjan Mejak : -- versions: +Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-03-26 Thread Pikec
Boštjan Mejak (Pikec) added the comment: Using Python 3.4.3 on Windows 7 Home Premium 64 bit, Service Pack 1: >>> import os >>> os.path.join([1, 2, 3]) Traceback (most recent call last): File "", line 1, in File "C:\Program Files\Python 3.4\lib\ntpath.py", line 108, in join result_drive

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-03-26 Thread Florian Bruhin
New submission from Florian Bruhin: I just accidentally passed a list (instead of unpacking it) to os.path.join. I was surprised when it just returned the list unmodified: >>> os.path.join([1, 2, 3]) [1, 2, 3] Looking at the source, it simply returns the first argument (path = a; ...; return

[issue22721] pprint output for sets and dicts is not stable

2015-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue2174] xml.sax.xmlreader does not support the InputSource protocol

2015-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Issue2175 has a patch that covers all three issues: issue1483, issue2174 and issue2175. I hesitate what parts of the patch are worth to be applied to maintained releases. -- nosy: +serhiy.storchaka ___ Python trac

[issue2175] Expat sax parser silently ignores the InputSource protocol

2015-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated to the tip, added whatsnew entry and fixed the documentation. What parts of this patch besides tests are worth to be applied to maintained releases? -- Added file: http://bugs.python.org/file38696/sax_character_stream_3.patch ___