[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator
Serhiy Storchaka added the comment: Following patch fixes the issue, but I don't understand why. -- Added file: http://bugs.python.org/file38586/tempfile_iter_fix.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23700 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23001] Accept mutable bytes-like objects
Serhiy Storchaka added the comment: Thank you for your review Martin. Yes, the problem with fcntl() is not so easy and I'll left it for the separate issue. I noticed there is no test for “ossaudiodev”. Would that be too hard, or is it just an oversight? It is hard because test_ossaudiodev is not designed to just apply the test with different type of data, and this test doesn't work on my computer at all (no /dev/dsp). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23001 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12006] strptime should implement %G, %V and %u directives
Serhiy Storchaka added the comment: Addressed Berker's comments. -- Added file: http://bugs.python.org/file38587/issue12006_6.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12006 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22826] Support context management protocol in bkfile
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22826 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23712] Experiment: Assume that exact unicode hashes are perfect discriminators
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 knowing the exact hash seed value that triggered it (i.e. not at all in a debug setup, definitely not in a test suite). Unequal keys accidentally comparing equal in a dict is something that wouldn't necessarily crash loudly. It may just lead to very subtly incorrect results, e.g. one lost item in an intermediate step of a process, and half a cent up or down in the final result. Don't get me wrong, I think this is a very interesting idea and worth exploring. But I'd be very reluctant to introduce it into the core language general purpose data types. As for Python implementation dicts, the keys in there will normally be interned, so the lookup will not compare the strings but only their pointers. Nothing to win on that front, really. -- nosy: +scoder ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23712 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23001] Accept mutable bytes-like objects
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23001 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22826] Support context management protocol in bkfile
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22826 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator
Serhiy Storchaka added the comment: No, it doesn't help. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23700 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator
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: f.write('line one\nline two\nline three') with open('some_test_file', 'r') as f: line = next(yielder(f)) nline = next(f) == Traceback (most recent call last): File pyshell#11, line 3, in module nline = next(f) ValueError: I/O operation on closed file. I think test_csv does the file-closing operation on lines 626/627 when it creates the temporary csv.reader(fileobj). def test_read_dict_fieldnames_from_file(self): with TemporaryFile(w+) as fileobj: fileobj.write(f1,f2,f3\r\n1,2,abc\r\n) fileobj.seek(0) reader = csv.DictReader(fileobj, fieldnames=next(csv.reader(fileobj))) self.assertEqual(reader.fieldnames, [f1, f2, f3]) self.assertEqual(next(reader), {f1: '1', f2: '2', f3: 'abc'}) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23700 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23001] Accept mutable bytes-like objects
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23001 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator
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 rep...@bugs.python.org http://bugs.python.org/issue23700 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23342] run() - unified high-level interface for subprocess
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23342 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator
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 rep...@bugs.python.org http://bugs.python.org/issue23700 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2211] Cookie.Morsel interface needs update
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 removed in 14b65de9b798, translate was removed in 99027c2b3fd2 when their became unnecessary. Now LegalChars is unnecessary. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2211 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22831] Use with to avoid possible fd leaks
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 rep...@bugs.python.org http://bugs.python.org/issue22831 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22831] Use with to avoid possible fd leaks
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.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22831 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23001] Accept mutable bytes-like objects
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 rep...@bugs.python.org http://bugs.python.org/issue23001 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23709] Refactor ossaudiodev: use _Py_read and _Py_write with the Py_buffer
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 rep...@bugs.python.org http://bugs.python.org/issue23709 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23001] Accept mutable bytes-like objects
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 rep...@bugs.python.org http://bugs.python.org/issue23001 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23001] Accept mutable bytes-like objects
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23001 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23681] Have -b warn when directly comparing ints and bytes
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 in argparse, http.client, and many other modules. I don't think that it's a good idea. It looks common to use a string for a sentinel (ex: state = UNKNOWN) and then store an int (ex: state = 0). So comparison need to check the type (ex: isinstance(state, str) and state == UNKNOWN) which is verbose and annoying. So no, we should not emit a warning :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23681 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23708] PEP 475: Add _Py_read() and _Py_write() functions
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()), function _Py_read, file Python/fileutils.c, line 1181. Fatal Python error: Aborted Current thread 0x7fff71296cc0 (most recent call first): File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/subprocess.py, line 1407 in _execute_child File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/subprocess.py, line 855 in __init__ File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test_signal.py, line 126 in run_test File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test_signal.py, line 180 in test_main File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/case.py, line 577 in run File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/case.py, line 625 in __call__ File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, line 122 in run File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, line 84 in __call__ File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, line 122 in run File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, line 84 in __call__ File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/runner.py, line 176 in run File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/support/__init__.py, line 1772 in _run_suite File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/support/__init__.py, line 1806 in run_unittest File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test_signal.py, line 1123 in test_main File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, line 1284 in runtest_inner File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, line 967 in runtest File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, line 532 in main File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, line 1568 in main_in_temp_cwd File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, line 1593 in module File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/runpy.py, line 85 in _run_code File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/runpy.py, line 170 in _run_module_as_main -- resolution: fixed - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23708 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23708] PEP 475: Add _Py_read() and _Py_write() functions
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 rep...@bugs.python.org http://bugs.python.org/issue23708 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23708] PEP 475: Add _Py_read() and _Py_write() functions
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 Current thread 0xa000d000 (most recent call first): File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/subprocess.py, line 1407 in _execute_child File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/subprocess.py, line 855 in __init__ File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_signal.py, line 126 in run_test ... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23708 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23716] test_multiprocessing_spawn hangs on x86 Ubuntu Shared 3.x
STINNER Victor added the comment: Oh cool, it looks like the changeset 9882cc2efd36 already fixed this issue. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23716 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator
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 more complex than tempfile_iter_fix.patch. Why you prefer more complex solution to simple solution? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23700 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator
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 closes the generator and because it uses yield from also the contained subgenerator, which is the file itself. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23700 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23715] PEP 475: handle EINTR in the signal module
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 pthread_kill() function shall not return an error code of [EINTR]. pause() fails with EINTR when it receives a signal, but signal.pause() doesn't raise InterruptedError in this case, it only returns None, because we expect a signal. I tested: signal.sigwait([]) doesn't fail with EINTR with a signal is received. No need to modify this function. On Linux, signal.set_wakeup_fd() doesn't fail with InterruptedError. -- Added file: http://bugs.python.org/file38588/signal_eintr.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23715 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23618] PEP 475: handle EINTR in the socket module
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 completed successfully) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23618 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23709] Refactor ossaudiodev: use _Py_read and _Py_write with the Py_buffer
Changes by STINNER Victor victor.stin...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23709 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23001] Accept mutable bytes-like objects
Serhiy Storchaka added the comment: Thanks Victor. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23001 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23685] Fix usage of PyMODINIT_FUNC
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 - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23685 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23648] PEP 475 meta issue
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 functions that can return an error, POSIX.1-2001 specifies that the function can never fail with the error EINTR. Example of pthread_create: The pthread_create() function shall not return an error code of [EINTR]. pthread_atfork pthread_attr_destroy pthread_attr_getdetachstate pthread_attr_getguardsize pthread_attr_getinheritsched pthread_attr_getschedparam pthread_attr_getschedpolicy pthread_attr_getscope pthread_attr_getstack pthread_attr_getstacksize pthread_barrierattr_destroy pthread_barrierattr_getpshared pthread_barrier_destroy pthread_barrier_wait pthread_cancel pthread_cleanup_pop pthread_condattr_destroy pthread_condattr_getclock pthread_condattr_getpshared pthread_cond_broadcast pthread_cond_destroy pthread_cond_init pthread_cond_timedwait pthread_create pthread_detach pthread_equal pthread_getconcurrency pthread_getschedparam pthread_getspecific pthread_join pthread_key_create pthread_key_delete pthread_kill pthread_mutexattr_destroy pthread_mutexattr_getprioceiling pthread_mutexattr_getprotocol pthread_mutexattr_getpshared pthread_mutexattr_getrobust pthread_mutexattr_gettype pthread_mutex_consistent pthread_mutex_destroy pthread_mutex_getprioceiling pthread_mutex_lock pthread_mutex_timedlock pthread_once pthread_rwlockattr_destroy pthread_rwlockattr_getpshared pthread_rwlock_destroy pthread_rwlock_rdlock pthread_rwlock_timedrdlock pthread_rwlock_timedwrlock pthread_rwlock_trywrlock pthread_rwlock_unlock pthreads pthread_setcancelstate pthread_setschedprio pthread_sigmask pthread_spin_destroy pthread_spin_lock pthread_spin_unlock pthread_tryjoin_np -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23648 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22832] Tweak parameter names for fcntl module
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 rep...@bugs.python.org http://bugs.python.org/issue22832 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23717] strptime() with year-weekday pair can produce invalid data
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.struct_time(tm_year=2015, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=0, tm_yday=1, tm_isdst=-1) time.strptime('2015 2', '%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=1, tm_yday=1, tm_isdst=-1) time.strptime('2015 3', '%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=2, tm_yday=1, tm_isdst=-1) time.strptime('2015 4', '%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=3, tm_yday=1, tm_isdst=-1) time.strptime('2015 5', '%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=4, tm_yday=1, tm_isdst=-1) time.strptime('2015 6', '%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=5, tm_yday=1, tm_isdst=-1) You get Jan 1 with any weekday. -- components: Library (Lib) messages: 238645 nosy: belopolsky, lemburg, serhiy.storchaka priority: normal severity: normal status: open title: strptime() with year-weekday pair can produce invalid data type: behavior versions: Python 2.7, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23717 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23708] PEP 475: Add _Py_read() and _Py_write() functions
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 instead of save/restore errno because on Linux errno is not modified. Since they *are* platforms where errno is modified, it's safer to always save/restore errno. _Py_read()/_Py_write() *must* set set errno because some callers uses it. It's more convinient to use errno than having to get the errno attribute of the raised OSError exception. test_signal pass again on AMD64 Snow Leop 3.x buildbot, I close the issue. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23708 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12006] strptime should implement %G, %V and %u directives
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=1, tm_isdst=-1) time.strptime('2015', '%G') time.struct_time(tm_year=1900, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=0, tm_yday=1, tm_isdst=-1) See also issue23717 and issue23718. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12006 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23285] PEP 475 - EINTR handling
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 there are issues with the old patched kernel and whatnot?) On my Fedora 21 (on a physical PC, not virtualized), I ran ./python -m test -R 3:3: test_eintr 3 times. After that, I didn't see any zombi Python process. If I cannot reproduce the issue, I cannot fix it. I bet that it's related to OpenVZ. IMO this issue can be closed. It already has a long history. I prefer to open new issues. See the issue #23648 PEP 475 meta issue which lists all issues related to the PEP 475. I opened new issues for each module which didn't handle completly the PEP 475 yet. By the way: great job Charles-François! I like your changeset, it works well. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23285 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23285] PEP 475 - EINTR handling
Changes by STINNER Victor victor.stin...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23285 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23630] support multiple hosts in create_server/start_server
Yann Sionneau added the comment: Please let me know if you need anything for this patch to be integrated. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23630 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23708] PEP 475: Add _Py_read() and _Py_write() functions
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 rep...@bugs.python.org http://bugs.python.org/issue23708 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23718] strptime() can produce invalid date with negative year day
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, tm_mon=12, tm_mday=28, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=6, tm_yday=-3, tm_isdst=-1) time.strftime('%Y %U %w', t) Traceback (most recent call last): File stdin, line 1, in module ValueError: day of year out of range -- components: Library (Lib) messages: 238648 nosy: belopolsky, lemburg, serhiy.storchaka priority: normal severity: normal status: open title: strptime() can produce invalid date with negative year day type: behavior versions: Python 2.7, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23718 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator
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. A workaround is to create a wrapper class and returns it in the _TemporaryFileWrapper.__iter__() method: --- class Iterator: def __init__(self, obj): self.obj = obj def __next__(self): if self.obj is None: raise StopIteration return next(self.obj) def __iter__(self): return self def close(self): self.obj = None --- Or simply: --- class Iterator: def __init__(self, obj): self.obj = obj def __next__(self): return next(self.obj) def __iter__(self): return self --- This solution looks more complex than tempfile_iter_fix.patch. @Serhiy: Maybe add a short comment to explain why yield from is not used and must be used. (By the way, the current comment contains yields from which is confusing :-)) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23700 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2211] Cookie.Morsel interface needs update
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: -haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2211 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator
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 rep...@bugs.python.org http://bugs.python.org/issue23700 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23681] Have -b warn when directly comparing ints and bytes
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.python.org/file38591/bytes_to_int_compare_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23681 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21152] Idle: timed autosave for shell (and maybe editor) window
Terry J. Reedy added the comment: For Shell, autoappend would do the same, and saving on each rather than by time might be more appropriate. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21152 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23687] Stacktrace identifies wrong line in multiline list comprehension
SMRUTI RANJAN SAHOO added the comment: the y should be replaced by none. so that will not show any error. i attached the image of my shell. -- nosy: +SMRUTI RANJAN SAHOO Added file: http://bugs.python.org/file38612/py2.JPG ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23687 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23571] Raise SystemError if a function returns a result with an exception set
Berker Peksag added the comment: Can we add a note (probably with an example) to the Porting to Python 3.5 section of https://docs.python.org/3.5/whatsnew/3.5.html#porting-to-python-3-5 I believe that this patch exposes some subtle bugs in Django (see https://gist.github.com/berkerpeksag/8b8dbe594eb1a1c51275) and it would be great to add a note for third party libraries. -- nosy: +berker.peksag status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23571 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23042] ctypes module doesn't build on FreeBSD, RHEL (x86) - Undefined symbol ffi_call_win32
koobs added the comment: @Marc, if upstream 3.2.1 also has the issue, then that would mean the current FreeBSD Python ports, which use --use-system-ffi and the security/libffi port, currently at version 3.2.1 [1], can reproduce the issue. I'm not aware of reports that they fail in this manner though. [1] http://www.freshports.org/devel/libffi/ -- title: ctypes module doesn't build on FreeBSD x86 - ctypes module doesn't build on FreeBSD, RHEL (x86) - Undefined symbol ffi_call_win32 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23042 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23698] Multiprocessing.Manager: fix behavior and doc inconsistencies
Changes by Terry J. Reedy tjre...@udel.edu: -- title: Fix inconsistencies in behaviour and document it correctly for multiprocessing.Manager facade - Multiprocessing.Manager: fix behavior and doc inconsistencies ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23698 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22832] Tweak parameter names for fcntl module
Martin Panter added the comment: I object to dropping the brackets from the function signatures. Now it gives the impression that the functions accept keyword arguments: ioctl(fd, request, arg=0, mutate_flag=True) but: ioctl(0, 0, bytearray(), mutate_flag=False) Traceback (most recent call last): File stdin, line 1, in module TypeError: ioctl() takes no keyword arguments There is already a little bit of precedent for this, e.g. the built-in eval() function, but I would prefer using square brackets, or some other non-Python syntax indicator. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22832 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23666] Add shell session logging option to IDLE
Terry J. Reedy added the comment: I do not see how Restart (as opposed to a proposed Clear option) loses anything. However, closing without saving definitely anything since a save. Moreover, even after saving Shell once, there is no Save on Close box displayed (as for editor windows) when closing Shell without saving. This has been discussed somewhere (maybe StackOverflow) but I do not find an issue. Raymond, would it be sufficient if saving once would mean that one could not close (or clear the window) without being prompted to save again? What if we add timed autosaves #21152 (based on your comment on #21140, msg215485), or autosave (or autoappend) with each prompt? -- nosy: +terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23666 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23529] Limit decompressed data when reading from LZMAFile and BZ2File
Martin Panter added the comment: Wolfgang: Unfortunately, I think that block of changes is largely unavoidable. The write() method should not have changed in reality, but all the init and read methods around it have been split into two classes, and the diff has decided to compare the old GzipFile methods to the new _DecompressReader methods. If you like I could try preparing a pseudo diff files that forces it to compare old GzipFile to new GzipFile to highlight the changes there. Nikolaus: I will try to split my buffer_size parameter changes out and post them in a separate issue that can be enhanced further. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23529 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument
Changes by Nicholas Chammas nicholas.cham...@gmail.com: -- nosy: +Nicholas Chammas ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21423 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2292] Missing *-unpacking generalizations
Changes by Neil Girdhar mistersh...@gmail.com: Added file: http://bugs.python.org/file38611/starunpack38.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2292 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23666] Add shell session logging option to IDLE
Raymond Hettinger added the comment: Autosave would suffice. :-) The restart issue wasn't the usual restart you get by pressing F5. What is happening is that someone does an action that kills or hangs the IDLE app, then they have to force close and restart IDLE itself. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23666 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23725] update tempfile docs to say that TemporaryFile is secure
Berker Peksag added the comment: Thanks for the patch, Zbyszek. For future reference, please send patches from the Mercurial repository. It will make the patch review process easier. See also devguide. +:func:`TemporaryDirectory`, :func:`SpooledTemporaryFile`, which can be Both TemporaryDirectory and SpooledTemporaryFile are actually a class. See https://hg.python.org/cpython/file/3.4/Lib/tempfile.py#l510 + :ref:`context-managers`). On completion of the context or :ref:`context-managers` link is unnecessary in my opinion. It would be better to link https://docs.python.org/3/library/tempfile.html#examples (Please update tempfile.TemporaryDirectory docs too.) -- nosy: +berker.peksag title: [PATCH] update tempfile docs to say that TemporaryFile is secure - update tempfile docs to say that TemporaryFile is secure type: - enhancement versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23725 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22341] Python 3 crc32 documentation clarifications
Martin Panter added the comment: Hi Gregory, I think the three functions have been fixed since Python 3.0. It looks like you changed them in revisions 6a7fa8421902 (zlib module) and 132cf3a79126 (crc32 functions). Looking at the 3.0 branch, all three functions use PyLong_FromUnsignedLong(), but in the 2.7 branch, they use PyInt_FromLong(). This is tested in test_zlib.ChecksumTestCase.test_crc32_adler32_unsigned(). See also my changes to test_penguins() in the patch here for further testing. There is no explicit testing of binascii.crc32() unsignedness, but it is implicitly tested by test_same_as_binascii_crc32(), because the expected CRC is beyond the positive 32 bit signed limit. I am happy to put back the suggestion of masking for backwards compatibility if you really think it is necessary. But since it only involves Python 3.0 compatibility, I thought it would be okay to remove it; see my original post. The documentation is often pretty good about noting when Python 3 behaviours changed, but you usually have to look elsewhere to see the differences from Python 2. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22341 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23666] Add shell session logging option to IDLE
Terry J. Reedy added the comment: Do you know if, when a process is killed, date written to open files gets flushed to disk? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23666 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22832] Tweak parameter names for fcntl module
Berker Peksag added the comment: I object to dropping the brackets from the function signatures. Now it gives the impression that the functions accept keyword arguments: See issue 21488 for a similar confusion. -- nosy: +berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22832 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23705] Speed-up deque.__contains__
Raymond Hettinger added the comment: Thanks guys. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23705 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23705] Speed-up deque.__contains__
Roundup Robot added the comment: New changeset 99eb196fb345 by Raymond Hettinger in branch 'default': Issue 23705: Improve the performance of __contains__ checks for deques. https://hg.python.org/cpython/rev/99eb196fb345 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23705 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23667] IDLE to provide option for making trailing whitespace visible
Terry J. Reedy added the comment: I agree that this area needs improvement. 'Strip trailing whitespace' should strip trailing blank lines at the end of a file, as well as trailing blank spaces at the end of each line. Both are required to commit to our repository. I would like to have a configuration option to always strip trailing blanks, at least for .py files. I believe the cursor moving from one line to another is an event that is or could be caugth and acted on. If so, trailing spaces could be removed immediately from the line left, and Save would only have to check the current line and the end of the file. I would rather remove blanks than mark them for later removal. -- nosy: +terry.reedy stage: - needs patch versions: +Python 2.7, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23667 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23496] Steps for Android Native Build of Python 3.4.2
Ryan Gonzalez added the comment: ...except for the pyconfig.h changes. Need to do something with autoconf for that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23496 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23674] super() documentation isn't very clear
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23674 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23715] PEP 475: handle EINTR in the signal module
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 rep...@bugs.python.org http://bugs.python.org/issue23715 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22181] os.urandom() should use Linux 3.17 getrandom() syscall
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 in PKG_PROG_PKG_CONFIG not being expanded in configure. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22181 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator
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 #23700: NamedTemporaryFile iterator closed underlied file object in https://hg.python.org/cpython/rev/e639750ecd92 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23700 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23720] __del__() order is broken since 3.4.0
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): destroyed = False def __del__(self): self.destroyed = True def _dealloc_vector(self, v): if not self.destroyed: ... class Vector(object): def __init__(self, device): self.device = device def __del__(self): self.device._dealloc_vector(self) -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23720 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator
Wolfgang Maier added the comment: so let's look at this step-by-step (and I hope I fully understood this myself): - calling fileobj.__iter__ creates a generator because the method uses yield from - that generator does not get assigned to any reference so it will be garbage-collected - when the generator is garbage-collected, the subgenerator specified to the rigth of the yield from is finalized (that is PEP380-mandated behavior) and, in this case, that is iter(self.file) - for an io module-based fileobject, iter(f) is f and finalizing it means that its close method will be called So this is not about the file object getting garbage-collected, it is about it getting closed. Since PEP380 explicitly mentions that problem with yield from and a shared subiterator, I don't think you can call it a bug, but I think it is very problematic behavior as illustrated by this issue because client code is supposed to know whether a particular generator uses yield from or not. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23700 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2211] Cookie.Morsel interface needs update
Demian Brecht added the comment: idmap was removed in 14b65de9b798, translate was removed in 99027c2b3fd2 when their became unnecessary. I'd venture to say they slipped through the cracks. Following the deprecation procedure here would be favourable IMHO as to give users a sufficient heads up that their will be a breakage upcoming, however unlikely that the parameter is actually in use in practice. There's nothing lost by marking it deprecated and removing it for 3.6(+). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2211 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22516] Windows Installer won't - even when using just for meoption
J. Morton added the comment: First, thanks for the comments - perhaps there's hope. But from the viewpoint of a typical user (who does not care about what goes on in the background), some of what has been said does not match the realities of development in a corporate environment. 1 – Anyone who is working on a Windows box controlled by an overly anal-retentive IM department (i.e. no admin rights) will not be able to install Python. Either make the “just for me” option unrestricted or remove it entirely. Time wasted trying to install Python when it can’t be done does endear Python to new users and comes across as being rather unprofessional. I haven’t gone to the web page lately, but as an absolute minimum the page for the “just for me” option needs to state that Admin rights are needed. 2 – Anyone forced to use Windows and is NOT a total python fanatic will NEVER go to the pain of building it. In the corporate world - on any platform - this approach is generally unrealistic given the other tools already out there (not worth the time/effort/pain involved, especially if the boss is breathing down your neck about the project schedule). And even if they want to, they may not be able to build/install it – no tools, as per point 1. 3 – I do not see the comments (in msg238567) “require a second MSI that is configured to not ask for administrative privileges” and “hosting twice of many files” as having much validity. To better serve the community a better approach is to REPLACE the pointlessly restrictive “admin rights” installer with an unrestricted version (it’s how I got Firefox on this machine) – hence only one set of files. This set should be, as much as possible, completely independent of everything else on the system (disk space is cheap, networks are fast and the file sizes are, relatively speaking, small). 4 - I haven't yet tried the MSI' workaround (in msg238560) so I don't know if it will work on my restricted system. If it does, the workaround should appear on the web page. Finally (as pure self-interest) I'd like a version compatible with Eclipse/PyDev. I do appreciate and encourage what you guys are doing and also understand the realities of what you do. But my viewpoint is, that to have closed this issue without properly addressing the basic problem reminds me of an ostrich with its head in the sand. -- status: closed - languishing ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22516 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23720] __del__() order is broken since 3.4.0
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 bug for several reasons: 1) Objects should be destroyed in breadth first reference tree traversal order, starting from the root. There are no cycles. It is nonsense to have freed children in parent's destructor. 2) Our applications suffer very much from this bug. Real Vector holds GPGPU memory and real Device holds the context, and CUDA/OpenCL require the context to be freed the last. With CUDA, the invalid destructor call order leads to segmentation faults. This may have something to deal with the implementation of PEP 442 (though in our case there no reference cycles at all). -- files: bug.py messages: 238661 nosy: Alexey Kazantsev priority: normal severity: normal status: open title: __del__() order is broken since 3.4.0 type: behavior versions: Python 3.4, Python 3.5 Added file: http://bugs.python.org/file38599/bug.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23720 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23720] __del__() order is broken since 3.4.0
Changes by Alexey Kazantsev ajk@gmail.com: -- components: +Interpreter Core ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23720 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23721] Set up a daily test coverage run
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 to help new contributors to know where they can help by contributing more tests. Otherwise we should try to get something like https://coveralls.io/ set up on https://github.com/python/cpython -- messages: 238668 nosy: brett.cannon priority: normal severity: normal status: open title: Set up a daily test coverage run ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23721 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23722] During metaclass.__init__, super() of the constructed class does not work
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 __class__ from the end of __build_class__ into type.__new__. This avoids the proliferation of methods which don't have the __class__ cell set. -- components: Interpreter Core files: patch messages: 238672 nosy: Martin.Teichmann priority: normal severity: normal status: open title: During metaclass.__init__, super() of the constructed class does not work versions: Python 3.5 Added file: http://bugs.python.org/file38604/patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23722 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22831] Use with to avoid possible fd leaks
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 cos it looked interesting, but was confronted with the “unorderable types: int() NoneType()” Python 2-ism. Yes, sad, but Tools/scripts/ is full of Python 2-isms. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22831 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23529] Limit decompressed data when reading from LZMAFile and BZ2File
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23529 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator
STINNER Victor added the comment: tempfile_iter_fix.patch looks good to me, can you commit it please? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23700 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23042] ctypes module doesn't build on FreeBSD x86
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://github.com/atgreen/libffi/blob/v3.2.1/src/x86/ffi.c#L401 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23042 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23699] Add a macro to ease writing rich comparisons
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-Use-Py_RICHCOMPARE-in-rich-comparisons.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23699 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23720] __del__() order is broken since 3.4.0
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23720 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14480] os.kill on Windows should accept zero as signal
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, 0) on Windows. I reject the issue. See also the issue #14484. -- nosy: +haypo resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14480 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22832] Tweak parameter names for fcntl module
Changes by Brett Cannon br...@python.org: -- assignee: docs@python - serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22832 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23696] zipimport: chain ImportError to OSError
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 rep...@bugs.python.org http://bugs.python.org/issue23696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22831] Use with to avoid possible fd leaks
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 already took some out, I’m not going to complain. 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 cos it looked interesting, but was confronted with the “unorderable types: int() NoneType()” Python 2-ism. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22831 ___ -- Added file: http://bugs.python.org/file38601/fd_leaks_tests1_2.patch Added file: http://bugs.python.org/file38602/fd_leaks_tools1_2.patch Added file: http://bugs.python.org/file38603/fd_leaks_tools2_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22831 ___diff -r d478a2a5738a Lib/test/test_dbm_dumb.py --- a/Lib/test/test_dbm_dumb.py Fri Mar 20 10:37:34 2015 +0100 +++ b/Lib/test/test_dbm_dumb.py Fri Mar 20 14:17:30 2015 +0200 @@ -2,6 +2,7 @@ Original by Roger E. Masse +import contextlib import io import operator import os @@ -31,12 +32,11 @@ class DumbDBMTestCase(unittest.TestCase) } def test_dumbdbm_creation(self): -f = dumbdbm.open(_fname, 'c') -self.assertEqual(list(f.keys()), []) -for key in self._dict: -f[key] = self._dict[key] -self.read_helper(f) -f.close() +with contextlib.closing(dumbdbm.open(_fname, 'c')) as f: +self.assertEqual(list(f.keys()), []) +for key in self._dict: +f[key] = self._dict[key] +self.read_helper(f) @unittest.skipUnless(hasattr(os, 'umask'), 'test needs os.umask()') @unittest.skipUnless(hasattr(os, 'chmod'), 'test needs os.chmod()') @@ -69,63 +69,55 @@ class DumbDBMTestCase(unittest.TestCase) def test_dumbdbm_modification(self): self.init_db() -f = dumbdbm.open(_fname, 'w') -self._dict[b'g'] = f[b'g'] = bindented -self.read_helper(f) -f.close() +with contextlib.closing(dumbdbm.open(_fname, 'w')) as f: +self._dict[b'g'] = f[b'g'] = bindented +self.read_helper(f) def test_dumbdbm_read(self): self.init_db() -f = dumbdbm.open(_fname, 'r') -self.read_helper(f) -f.close() +with contextlib.closing(dumbdbm.open(_fname, 'r')) as f: +self.read_helper(f) def test_dumbdbm_keys(self): self.init_db() -f = dumbdbm.open(_fname) -keys = self.keys_helper(f) -f.close() +with contextlib.closing(dumbdbm.open(_fname)) as f: +keys = self.keys_helper(f) def test_write_contains(self): -f = dumbdbm.open(_fname) -f[b'1'] = b'hello' -self.assertIn(b'1', f) -f.close() +with contextlib.closing(dumbdbm.open(_fname)) as f: +f[b'1'] = b'hello' +self.assertIn(b'1', f) def test_write_write_read(self): # test for bug #482460 -f = dumbdbm.open(_fname) -f[b'1'] = b'hello' -f[b'1'] = b'hello2' -f.close() -f = dumbdbm.open(_fname) -self.assertEqual(f[b'1'], b'hello2') -f.close() +with contextlib.closing(dumbdbm.open(_fname)) as f: +f[b'1'] = b'hello' +f[b'1'] = b'hello2' +with contextlib.closing(dumbdbm.open(_fname)) as f: +self.assertEqual(f[b'1'], b'hello2') def test_str_read(self): self.init_db() -f = dumbdbm.open(_fname, 'r') -self.assertEqual(f['\u00fc'], self._dict['\u00fc'.encode('utf-8')]) +with contextlib.closing(dumbdbm.open(_fname, 'r')) as f: +self.assertEqual(f['\u00fc'], self._dict['\u00fc'.encode('utf-8')]) def test_str_write_contains(self): self.init_db() -f = dumbdbm.open(_fname) -f['\u00fc'] = b'!' -f['1'] = 'a' -f.close() -f = dumbdbm.open(_fname, 'r') -self.assertIn('\u00fc', f) -self.assertEqual(f['\u00fc'.encode('utf-8')], - self._dict['\u00fc'.encode('utf-8')]) -self.assertEqual(f[b'1'], b'a') +with contextlib.closing(dumbdbm.open(_fname)) as f: +f['\u00fc'] = b'!' +f['1'] = 'a' +with contextlib.closing(dumbdbm.open(_fname, 'r')) as f: +self.assertIn('\u00fc', f) +self.assertEqual(f['\u00fc'.encode('utf-8')], + self._dict['\u00fc'.encode('utf-8')]) +self.assertEqual(f[b'1'], b'a')
[issue23715] PEP 475: handle EINTR in the signal module
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 rep...@bugs.python.org http://bugs.python.org/issue23715 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23688] unnecessary copying of memoryview in gzip.GzipFile.write?
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 rep...@bugs.python.org http://bugs.python.org/issue23688 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23699] Add a macro to ease writing rich comparisons
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 the signature, I would like this to mirror richcmpfunc and PyObject_RichCompareBool. And returning PyObjexct*, not 0/1, is an important part of reducing boilerplate; in cases where 0/1 would be helpful you can easily work with cmp-style -1/0/1 values before using this to convert them. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23699 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23717] strptime() with year-weekday pair can produce invalid data
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') time.struct_time(tm_year=2015, tm_mon=3, tm_mday=20, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=6, tm_yday=79, tm_isdst=-1) All date values are known, the problem is that they contradict. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23717 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23042] ctypes module doesn't build on FreeBSD x86
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. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23042 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23657] Don't do isinstance checks in zipapp
Paul Moore added the comment: Updated patch. Added the requested test and a set of tests for the command line API. This also highlighted a bug in the command line --info option, which is also fixed. Coverage now: Name Stmts Miss Cover Missing --- test_zipapp 254 1295% 252-257, 263-268 zipapp 102 298% 30, 192 --- TOTAL 356 1496% Remaining misses are Unix-only tests (this was run on Windows) and the __main__ block. -- Added file: http://bugs.python.org/file38606/duck_typed_zipapp.v3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23657 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23720] __del__() order is broken since 3.4.0
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.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23720 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator
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 the file itself. Yes, there are no references to to the generator, created by fileobj.__iter__, but there are references to fileobj itself and to the file fileobj.file. I still don't understand why the file is closed. This looks as a bug. Committed existing fix only to make buildbots green. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23700 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22831] Use with to avoid possible fd leaks
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 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 cos it looked interesting, but was confronted with the “unorderable types: int() NoneType()” Python 2-ism. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22831 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23715] PEP 475: handle EINTR in the signal module
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 rep...@bugs.python.org http://bugs.python.org/issue23715 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23699] Add a macro to ease writing rich comparisons
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 specifically want this usable in third-party code. The implementation of Py_RICHCOMPARE is in the first patch. The second is example use. The signature mirrors richcmpfunc. Why would op be better as first argument? Stefan: Which optimizer should I look at? Is it important to generate the same code? Sorry if I'm asking for something obvious, I'm not a regular here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23699 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11726] clarify that linecache only works on files that can be decoded successfully
R. David Murray added the comment: OK, on further investigation I guess it wasn't intended to be so general :) But I still think we should make a nod to the reality that it can be used on other text files. I'll re-close the issue but I may add a sentence to the docs. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11726 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator
Serhiy Storchaka added the comment: Thank you for your explanation Wolfgang! Now it is clear to me. The issue is that the generator calls the close() method of the subgenerator, but if the subgenerator is a file, the close() method closes (surprise!) the file. Two different protocols use the same method. Interesting, how many similar bugs was introduced by blindly replacing for/yield with yield from? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23700 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com