[issue23717] strptime() with year-weekday pair can produce invalid data

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Actually you can got invalid data for any date. >>> time.strptime('2015 3 20', '%Y %m %d') time.struct_time(tm_year=2015, tm_mon=3, tm_mday=20, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=4, tm_yday=79, tm_isdst=-1) >>> time.strptime('2015 3 20 0', '%Y %m %d %w')

[issue23699] Add a macro to ease writing rich comparisons

2015-03-20 Thread Petr Viktorin
Petr Viktorin added the comment: Making it a function might help with the following issues: - series of comparisons and PyBool_FromLong is less efficient than switch and Py_RETURN_*. But it would add a function call. - it might be too complex for a macro Do you think that would help? As for th

[issue23720] __del__() order is broken since 3.4.0

2015-03-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Amaury is right. In your case you could keep track of the Vectors in the Device object and invalidate them when the Device is destroyed (using e.g. a WeakSet). Or Vector could delegate its destruction to Device, e.g.: class Device(object): destroy

[issue23717] strptime() with year-weekday pair can produce invalid data

2015-03-20 Thread Skip Montanaro
Skip Montanaro added the comment: I don't think this is a bug. From the 2.7.9 docs: The default values used to fill in any missing data when more accurate values cannot be inferred are (1900, 1, 1, 0, 0, 0, 0, 1, -1). -- nosy: +skip.montanaro ___ Py

[issue23720] __del__() order is broken since 3.4.0

2015-03-20 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset a90ec6b96af2 by Serhiy Storchaka in branch '3.4': Issue #23700: NamedTemporaryFile iterator closed underlied file object in https://hg.python.org/cpython/rev/a90ec6b96af2 New changeset e639750ecd92 by Serhiy Storchaka in branch 'default': Issue #237

[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > csv.reader(fileobj) returns the generator created by fileobj.__iter__, but no > reference to it is kept so the object gets destroyed right afterwards. This > closes the generator and because it uses yield from also the contained > subgenerator, which is th

[issue22181] os.urandom() should use Linux 3.17 getrandom() syscall

2015-03-20 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: > New changeset 4491bdb6527b by Victor Stinner in branch 'default': > Issue #22181: The availability of the getrandom() is now checked in configure, > https://hg.python.org/cpython/rev/4491bdb6527b You forgot to run aclocal, which resulted i

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

2015-03-20 Thread Wolfgang Maier
Wolfgang Maier added the comment: The patch has a huge block replacement in the gzip.py module starting at GzipFile.write, which makes it large and hard to identify changes. Could that be ameliorated or is it too much work right now? -- nosy: +wolma ___

[issue23699] Add a macro to ease writing rich comparisons

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > I think it should fall in the same category as Py_RETURN_TRUE or > Py_RETURN_NONE. Sure, it's easy to reimplement, but a lot of extensions > need it; why should everyone need to write the same code in a dozen > different ways? I specifically want this usable

[issue23699] Add a macro to ease writing rich comparisons

2015-03-20 Thread Petr Viktorin
Petr Viktorin added the comment: Attaching another patch: - Leave _decimal alone per maintainer's wishes - Fixes issues pointed out in the review - Use Py_RICHCOMPARE also in _tkinter - More improvements in the other affected modules -- Added file: http://bugs.python.org/file38605/0002

[issue22831] Use "with" to avoid possible fd leaks

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here are updated patches with fixed mistakes found by Martin. > While many of the changes look worthwhile, I do worry that some of them will > never be tested (at least until say Python 3.14 or something). E.g. I just > tried running Tools/scripts/dutree.py co

[issue23722] During metaclass.__init__, super() of the constructed class does not work

2015-03-20 Thread Martin Teichmann
New submission from Martin Teichmann: When a new class is initialized with __init__ in a metaclass, the __class__ cell of the class about to be initialized is not set yet, meaning that super() does not work. This is a known but fixable problem. The attached patch moves the initialization of __cl

[issue22831] Use "with" to avoid possible fd leaks

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: п'ятниця, 20-бер-2015 12:36:25 ви написали: > Martin Panter added the comment: > > There were a couple mistakes I found; see Reitveld. I was going to say to > leave the open(mode="r") parameter as it is, since an explicit "r" is more > readable, but since you

[issue23720] __del__() order is broken since 3.4.0

2015-03-20 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Actually there *is* a cycle: assert a.vector is a.vector.device.__class__.__del__.__globals__['a'].vector A workaround is to not store objects with __del__ in module globals... Or have only one (the Main instance in your case) -- nosy: +amaury.f

[issue23721] Set up a daily test coverage run

2015-03-20 Thread Brett Cannon
New submission from Brett Cannon: devinabox has instructions on how to get the best test coverage for Python possible: https://hg.python.org/devinabox/file/1eeb96fe98f1/README#l124 . It would probably be good to get a test report at least daily to help keep an eye on general test coverage and

[issue23042] ctypes module doesn't build on FreeBSD x86

2015-03-20 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I would prefer to have someone with good libffi knowledge to chime in here. It's easy to just revert the patch, but it may be even better to upgrade the included libffi lib. But probably not to 3.2.1, since this still has the same bug it seems: https://gi

[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?

2015-03-20 Thread Wolfgang Maier
Wolfgang Maier added the comment: ok, I've prepared a patch including tests based on my last suggestion, which I think is ready for getting reviewed. -- Added file: http://bugs.python.org/file38600/write_bytes_like_objects.patch ___ Python tracker <

[issue23681] Have -b warn when directly comparing ints and bytes

2015-03-20 Thread Brett Cannon
Brett Cannon added the comment: I did one final pass on the patch and only had wording comments, so tweak those and it LGTM. Assigned to Serhiy since it's obviously his patch. =) Only other thing is to either open up a separate bug or at least apply the fixes to the stdlib in Python 3.4 as wel

[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: tempfile_iter_fix.patch looks good to me, can you commit it please? -- ___ Python tracker ___ ___ Py

[issue23715] PEP 475: handle EINTR in the signal module

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset ed8c2a4a6d3d by Victor Stinner in branch 'default': Issue #23715: Fix test_script_helper https://hg.python.org/cpython/rev/ed8c2a4a6d3d -- ___ Python tracker _

[issue23720] __del__() order is broken since 3.4.0

2015-03-20 Thread Vadim Markovtsev
Vadim Markovtsev added the comment: +1 -- nosy: +Vadim Markovtsev ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue23720] __del__() order is broken since 3.4.0

2015-03-20 Thread Alexey Kazantsev
New submission from Alexey Kazantsev: Pythons prior to 3.4.0 print Vector! Device! while >=3.4.0 print Device! Vector! If we replace Main with Vector on line 21, the behavior becomes random: in 50% of all cases it prints the wrong sequence, in other 50% the right. Our team treats this as a

[issue23720] __del__() order is broken since 3.4.0

2015-03-20 Thread Alexey Kazantsev
Changes by Alexey Kazantsev : -- components: +Interpreter Core ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23696] zipimport: chain ImportError to OSError

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 022d64b503b8 by Victor Stinner in branch 'default': Issue #23696: Remove test on ZipImportError.__context__ because the context is https://hg.python.org/cpython/rev/022d64b503b8 -- ___ Python tracker

[issue23715] PEP 475: handle EINTR in the signal module

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 79aed09a9fa5 by Victor Stinner in branch 'default': Issue #23715: Fix test_eintr, skip tests on signal.sigwaitinfo() and https://hg.python.org/cpython/rev/79aed09a9fa5 -- ___ Python tracker

[issue23699] Add a macro to ease writing rich comparisons

2015-03-20 Thread Petr Viktorin
Petr Viktorin added the comment: Serhiy: Thanks for looking at this! I think it should fall in the same category as Py_RETURN_TRUE or Py_RETURN_NONE. Sure, it's easy to reimplement, but a lot of extensions need it; why should everyone need to write the same code in a dozen different ways? I spe

[issue23042] ctypes module doesn't build on FreeBSD x86

2015-03-20 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: Modules/_ctypes/libffi in branches 2.7, 3.4, default is currently a copy of libffi 3.1. Is problem reproducible with libffi 3.2.1? If not, then it might be better to update Modules/_ctypes/libffi to libffi 3.2.1. -- __

[issue23715] PEP 475: handle EINTR in the signal module

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8f9925a02fe7 by Victor Stinner in branch 'default': Issue #23715: Enhance test.script_helper to investigate test_eintr failure https://hg.python.org/cpython/rev/8f9925a02fe7 -- ___ Python tracker

[issue22831] Use "with" to avoid possible fd leaks

2015-03-20 Thread Martin Panter
Martin Panter added the comment: There were a couple mistakes I found; see Reitveld. I was going to say to leave the open(mode="r") parameter as it is, since an explicit "r" is more readable, but since you already took some out, I’m not going to complain. While many of the changes look worthwh

[issue22832] Tweak parameter names for fcntl module

2015-03-20 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: docs@python -> serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue14480] os.kill on Windows should accept zero as signal

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: > 0 has no special meaning on Windows so I'd rather not add another special > case for posix emulation. Additionally, 0 unfortunately already means two > things as it is: signal.CTRL_C_EVENT and the int 0. I agree, it's not a good idea to support os.kill(pid,

[issue23476] SSL cert verify fail for "www.verisign.com"

2015-03-20 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue23648] PEP 475 meta issue

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: New issue #23719: "port test_eintr to Windows". -- dependencies: +PEP 475: port test_eintr to Windows ___ Python tracker ___ ___

[issue23715] PEP 475: handle EINTR in the signal module

2015-03-20 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue23719] PEP 475: port test_eintr to Windows

2015-03-20 Thread STINNER Victor
New submission from STINNER Victor: Currently, test_eintr is complelty skipped on Windows. time.sleep() was also patched on Windows to retry when interrupted by a signal (issue #23646) and I was able to see a different when testing manually. test_eintr is currently implemented with signal.seti

[issue23719] PEP 475: port test_eintr to Windows

2015-03-20 Thread STINNER Victor
Changes by STINNER Victor : -- components: +Tests, Windows nosy: +steve.dower, tim.golden, zach.ware ___ Python tracker ___ ___ Python

[issue23715] PEP 475: handle EINTR in the signal module

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 33a6e2587aad by Victor Stinner in branch 'default': Issue #23715: signal.sigwaitinfo() and signal.sigtimedwait() are now retried https://hg.python.org/cpython/rev/33a6e2587aad -- nosy: +python-dev ___ Pyt

[issue23285] PEP 475 - EINTR handling

2015-03-20 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue23285] PEP 475 - EINTR handling

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: > For the record, it seems test_eintr sometimes left zombie processes in my > machine where I run reference leak tests every night. I didn't investigate > and just disabled the tests. > > (I'll add that that machine is hosted on an OpenVZ-based VPS, so perhaps

[issue12006] strptime should implement %G, %V and %u directives

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are other issues. strptime with single %Y returns a date of the first day of the year. What should return single %G? >>> time.strptime('2015', '%Y') time.struct_time(tm_year=2015, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=3, tm_yday=

[issue23718] strptime() can produce invalid date with negative year day

2015-03-20 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: strptime() can produce invalid time with negative year day when parse year-week-weekday set. Such time is rejected by strftime(), so strptime/strftime roundtrip doesn't work. >>> t = time.strptime('2015 0 0', '%Y %U %w') >>> t time.struct_time(tm_year=2014

[issue23708] PEP 475: Add _Py_read() and _Py_write() functions

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: > New changeset 07fd54208434 by Victor Stinner in branch 'default': > Issue #23708: Save/restore errno in _Py_read() and _Py_write() When I wrote _Py_read()/_Py_write(), I added assertions on errno to ensure that errno is not modified. I chose to use assertions

[issue22832] Tweak parameter names for fcntl module

2015-03-20 Thread Alex Shkop
Alex Shkop added the comment: Fixed default values for fcntl(), ioctl() and lockf() -- Added file: http://bugs.python.org/file38598/issue22832_v3.patch ___ Python tracker ___ ___

[issue23717] strptime() with year-weekday pair can produce invalid data

2015-03-20 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: strptime() with year-weekday pair can produce invalid data. >>> time.strptime('2015 0', '%Y %w') time.struct_time(tm_year=2015, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=6, tm_yday=1, tm_isdst=-1) >>> time.strptime('2015 1', '%Y %w') time.

[issue23648] PEP 475 meta issue

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: pthread_* are false positive, they cannot fail with EINTR: """ Pthreads function return values Most pthreads functions return 0 on success, and an error number of failure. Note that the pthreads functions do not set errno. For each of the pthreads fun

[issue23708] PEP 475: Add _Py_read() and _Py_write() functions

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 07fd54208434 by Victor Stinner in branch 'default': Issue #23708: Save/restore errno in _Py_read() and _Py_write() https://hg.python.org/cpython/rev/07fd54208434 -- ___ Python tracker

[issue23630] support multiple hosts in create_server/start_server

2015-03-20 Thread Yann Sionneau
Yann Sionneau added the comment: Please let me know if you need anything for this patch to be integrated. -- ___ Python tracker ___ __

[issue23708] PEP 475: Add _Py_read() and _Py_write() functions

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: Same error on "x86 Tiger 3.x" buildbot: http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/9381/steps/test/logs/stdio [345/393] test_signal Python/fileutils.c:1181: failed assertion `errno == EINTR && PyErr_Occurred()' Fatal Python error: Aborted

[issue23708] PEP 475: Add _Py_read() and _Py_write() functions

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6dd201b6bb4f by Victor Stinner in branch 'default': Issue #23708: Split assertion expression in two assertions in _Py_read() and https://hg.python.org/cpython/rev/6dd201b6bb4f -- ___ Python tracker

[issue23708] PEP 475: Add _Py_read() and _Py_write() functions

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: An assertion failed in _Py_read() while running test_signal on AMD64 Snow Leop 3.x: http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%203.x/builds/2779/steps/test/logs/stdio [321/393/1] test_signal Assertion failed: (errno == EINTR && PyErr_Occurred

[issue23681] Have -b warn when directly comparing ints and bytes

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: > This will help when someone writes something like `b'abcd'[2] == b'c'` What if someone writes line[-1] == 0 and line is a Unicode string? Should we emit a warning? I patched locally PyUnicode_RichCompare() to emit a warning. Hum, there are *many* warnings i

[issue23681] Have -b warn when directly comparing ints and bytes

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: @Brett: Yes, the patch handles `42 == b'*'` as well. @Victor: The problem in such code: x = b'Array' x[0] == b'A' Added explicit tests for bytes on the right side of the comparison and replaced b'.'[0] to ord(b'.'). -- Added file: http://bugs.pyth

[issue23001] Accept mutable bytes-like objects

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: > Thanks Victor. You're welcome, I just worked recently on ossaudiodev for _Py_read/write functions functions. But I'm not able to run ossaudiodev neither :-( I hope that the test runs on some buildbots (FreeBSD?). -- nosy: +haypo ___

[issue23685] Fix usage of PyMODINIT_FUNC

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: > builtin_modules.patch looks complex. It can be simplified by using the > Py_BUILD_CORE define. In this case, it can be done in the issue #11410. I consider that the initial issue is fixed, so I close the issue. -- resolution: -> fixed status: open

[issue23696] zipimport: chain ImportError to OSError

2015-03-20 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue23001] Accept mutable bytes-like objects

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Victor. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue23696] zipimport: chain ImportError to OSError

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 597a87099713 by Victor Stinner in branch 'default': Issue #23696: Chain ZipImportError to the OSError https://hg.python.org/cpython/rev/597a87099713 -- nosy: +python-dev ___ Python tracker

[issue23671] string.Template doesn't work with the self keyword argument

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated patch addresses Paul's and Demian's comments. Converting the format_string parameter to positional parameter can break third-party code, so this needs a deprecation period. -- Added file: http://bugs.python.org/file38590/string_formatting_sel

[issue23709] Refactor ossaudiodev: use _Py_read and _Py_write with the Py_buffer

2015-03-20 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue23709] Refactor ossaudiodev: use _Py_read and _Py_write with the Py_buffer

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset d478a2a5738a by Victor Stinner in branch 'default': Issue #23709, #23001: ossaudiodev now uses Py_ssize_t for sizes instead of int https://hg.python.org/cpython/rev/d478a2a5738a -- ___ Python tracker

[issue23001] Accept mutable bytes-like objects

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset d478a2a5738a by Victor Stinner in branch 'default': Issue #23709, #23001: ossaudiodev now uses Py_ssize_t for sizes instead of int https://hg.python.org/cpython/rev/d478a2a5738a -- ___ Python tracker

[issue23001] Accept mutable bytes-like objects

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 11548e1ac920 by Victor Stinner in branch 'default': Issue #23001: Fix typo https://hg.python.org/cpython/rev/11548e1ac920 -- ___ Python tracker ___

[issue22831] Use "with" to avoid possible fd leaks

2015-03-20 Thread Martin Panter
Martin Panter added the comment: Posting a version of Serhiy’s patch made with “hg diff -p --ignore-all-space”. It is a bit shorter, and should not include all the re-indented lines, which may help reviewing. -- Added file: http://bugs.python.org/file38589/fd_leaks.ignore-all-space.dif

[issue23681] Have -b warn when directly comparing ints and bytes

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: I didn't understand the issue. $ python2 >>> b'A'[0] == 65 False $ python3 Python 3.4.1 (default, Nov 3 2014, 14:38:10) >>> b'A'[0] == 65 True Oh ok, now I get it: Python 2 and Python 3 behaves differently when comparing a string of a single byte and an int

[issue22831] Use "with" to avoid possible fd leaks

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: fd_leaks.diff is impossible to review, even Rietveld gave up, it's too big :-p Could you please your patch into smaller patches? Split by directory for example. -- nosy: +haypo ___ Python tracker

[issue23618] PEP 475: handle EINTR in the socket module

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: I tested polling+getsockopt(SO_ERROR) with connect_test.c on Linux, it works: haypo@smithers$ gcc -D TEST_TWO=1 connect_test.c -o connect_test haypo@smithers$ ./connect_test Will try to connect to 127.0.0.1 on port 80 (connect has been interrupted and now compl

[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread Wolfgang Maier
Wolfgang Maier added the comment: @bkabrda not sure, but it may have to do with when exactly the object gets garbage collected -- ___ Python tracker ___

[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread Bohuslav "Slavek" Kabrda
Bohuslav "Slavek" Kabrda added the comment: @wolma any idea why this only happens on Windows? I can't reproduce the CSV failing test on Linux. -- ___ Python tracker ___

[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread Wolfgang Maier
Wolfgang Maier added the comment: @Serhiy in this line of code: reader = csv.DictReader(fileobj, fieldnames=next(csv.reader(fileobj))) csv.reader(fileobj) returns the generator created by fileobj.__iter__, but no reference to it is kept so the object gets destroyed right afterwards. This clo

[issue23715] PEP 475: handle EINTR in the signal module

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: signal_eintr.py: More complete patch, modify also signal.sigwaitinfo(). -- I don't think that other signal functions need to be modified to handle EINTR. POSIX manual pages: - "The pthread_sigmask() function shall not return an error code of [EINTR]." - "The p

[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Ah yes, correct: when a generator using "yield from obj" is destroyed while > yield from is not done, obj.close() is called if the method exists. But why obj.close() is called? The reference to fileobj is live, it shouldn't be closed. > This solution looks

[issue23716] test_multiprocessing_spawn hangs on x86 Ubuntu Shared 3.x

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: Oh cool, it looks like the changeset 9882cc2efd36 already fixed this issue. -- resolution: -> fixed status: open -> closed ___ Python tracker _

[issue2211] Cookie.Morsel interface needs update

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

[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: Ah yes, correct: when a generator using "yield from obj" is destroyed while yield from is not done, obj.close() is called if the method exists. So "yield from file" *is* different than "for line in file: yield file" when we don't consume the whole generator.

[issue2211] Cookie.Morsel interface needs update

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In 2.7 Morsel.set is declared as: def set(self, key, val, coded_val, LegalChars=_LegalChars, idmap=_idmap, translate=string.translate): Undocumented parameters idmap and translate were removed without deprecation. idmap was remove

[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread Wolfgang Maier
Wolfgang Maier added the comment: Actually, its scary that use of yield from can have such a subtle side-effect. Maybe PEP380 should have taken this more seriously? -- ___ Python tracker __

[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No, it doesn't help. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread Wolfgang Maier
Wolfgang Maier added the comment: I think this is a consequence of PEP380 and its decision to finalize the subgenerator when the delegating generator is closed. Consider this simple example without tempfile: def yielder (fileobj): yield from fileobj with open('some_test_file', 'w') as f:

[issue22826] Support context management protocol in bkfile

2015-03-20 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue12006] strptime should implement %G, %V and %u directives

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Addressed Berker's comments. -- Added file: http://bugs.python.org/file38587/issue12006_6.patch ___ Python tracker ___ ___

[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: Maybe we need to keep explicitly a reference to self.file in the method (file = self.file) to keep it alive in the frame? -- ___ Python tracker

[issue23342] run() - unified high-level interface for subprocess

2015-03-20 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berker.peksag stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue22826] Support context management protocol in bkfile

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset ea8c3166d1c2 by Serhiy Storchaka in branch 'default': Issue #22826: The result of open() in Tools/freeze/bkfile.py is now better https://hg.python.org/cpython/rev/ea8c3166d1c2 -- nosy: +python-dev ___ Pyt

[issue23712] Experiment: Assume that exact unicode hashes are perfect discriminators

2015-03-20 Thread Stefan Behnel
Stefan Behnel added the comment: The problem is, even if the chance is excessively small, it's not zero. Meaning, someone's data set somewhere will break somehow. And with hash randomisation, it'll mean that the problem spotted in some life system will be entirely unreproducible without knowin

[issue23001] Accept mutable bytes-like objects

2015-03-20 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue23001] Accept mutable bytes-like objects

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 17c77938c4e2 by Serhiy Storchaka in branch 'default': Issue #23001: Few functions in modules mmap, ossaudiodev, socket, ssl, and https://hg.python.org/cpython/rev/17c77938c4e2 -- nosy: +python-dev ___ Pyt

<    1   2