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

2015-03-20 Thread Serhiy Storchaka
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

[issue23001] Accept mutable bytes-like objects

2015-03-20 Thread Serhiy Storchaka
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

[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 rep...@bugs.python.org http://bugs.python.org/issue12006 ___

[issue22826] Support context management protocol in bkfile

2015-03-20 Thread Serhiy Storchaka
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 ___

[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

[issue23001] Accept mutable bytes-like objects

2015-03-20 Thread Serhiy Storchaka
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

[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 ___

[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 rep...@bugs.python.org http://bugs.python.org/issue23700 ___ ___ Python-bugs-list mailing

[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:

[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 ___

[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 rep...@bugs.python.org http://bugs.python.org/issue23700

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

2015-03-20 Thread Berker Peksag
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 ___

[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 rep...@bugs.python.org http://bugs.python.org/issue23700

[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

[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

[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:

[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 rep...@bugs.python.org http://bugs.python.org/issue23001

[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 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

[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

[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

[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: 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

[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 rep...@bugs.python.org http://bugs.python.org/issue23716

[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

[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

[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

[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

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

2015-03-20 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23709 ___

[issue23001] Accept mutable bytes-like objects

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Victor. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23001 ___ ___ Python-bugs-list mailing list

[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 -

[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

[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 rep...@bugs.python.org http://bugs.python.org/issue22832

[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')

[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

[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=1,

[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

[issue23285] PEP 475 - EINTR handling

2015-03-20 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23285 ___

[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 rep...@bugs.python.org http://bugs.python.org/issue23630 ___

[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

[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,

[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. A

[issue2211] Cookie.Morsel interface needs update

2015-03-20 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: -haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2211 ___ ___ Python-bugs-list

[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 rep...@bugs.python.org http://bugs.python.org/issue23700

[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:

[issue21152] Idle: timed autosave for shell (and maybe editor) window

2015-03-20 Thread Terry J. Reedy
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

[issue23687] Stacktrace identifies wrong line in multiline list comprehension

2015-03-20 Thread SMRUTI RANJAN SAHOO
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

[issue23571] Raise SystemError if a function returns a result with an exception set

2015-03-20 Thread Berker Peksag
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

[issue23042] ctypes module doesn't build on FreeBSD, RHEL (x86) - Undefined symbol ffi_call_win32

2015-03-20 Thread koobs
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

[issue23698] Multiprocessing.Manager: fix behavior and doc inconsistencies

2015-03-20 Thread Terry J. Reedy
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

[issue22832] Tweak parameter names for fcntl module

2015-03-20 Thread Martin Panter
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

[issue23666] Add shell session logging option to IDLE

2015-03-20 Thread Terry J. Reedy
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

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

2015-03-20 Thread Martin Panter
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

[issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument

2015-03-20 Thread Nicholas Chammas
Changes by Nicholas Chammas nicholas.cham...@gmail.com: -- nosy: +Nicholas Chammas ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21423 ___ ___

[issue2292] Missing *-unpacking generalizations

2015-03-20 Thread Neil Girdhar
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 ___

[issue23666] Add shell session logging option to IDLE

2015-03-20 Thread Raymond Hettinger
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. --

[issue23725] update tempfile docs to say that TemporaryFile is secure

2015-03-20 Thread Berker Peksag
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

[issue22341] Python 3 crc32 documentation clarifications

2015-03-20 Thread Martin Panter
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(),

[issue23666] Add shell session logging option to IDLE

2015-03-20 Thread Terry J. Reedy
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 ___

[issue22832] Tweak parameter names for fcntl module

2015-03-20 Thread Berker Peksag
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

[issue23705] Speed-up deque.__contains__

2015-03-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks guys. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23705 ___

[issue23705] Speed-up deque.__contains__

2015-03-20 Thread Roundup Robot
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 ___

[issue23667] IDLE to provide option for making trailing whitespace visible

2015-03-20 Thread Terry J. Reedy
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

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-03-20 Thread Ryan Gonzalez
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 ___

[issue23674] super() documentation isn't very clear

2015-03-20 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23674 ___ ___ Python-bugs-list

[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

[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 in

[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

[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):

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

2015-03-20 Thread Wolfgang Maier
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

[issue2211] Cookie.Morsel interface needs update

2015-03-20 Thread Demian Brecht
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

[issue22516] Windows Installer won't - even when using just for meoption

2015-03-20 Thread J. Morton
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 –

[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 ajk@gmail.com: -- components: +Interpreter Core ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23720 ___ ___

[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

[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

[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 cos

[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

[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 rep...@bugs.python.org http://bugs.python.org/issue23700 ___

[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:

[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:

[issue23720] __del__() order is broken since 3.4.0

2015-03-20 Thread Amaury Forgeot d'Arc
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

[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, 0)

[issue22832] Tweak parameter names for fcntl module

2015-03-20 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- assignee: docs@python - serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22832 ___ ___

[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

[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 already

[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 rep...@bugs.python.org

[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

[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

[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')

[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. --

[issue23657] Don't do isinstance checks in zipapp

2015-03-20 Thread Paul Moore
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

[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:

[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 the

[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

[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

[issue11726] clarify that linecache only works on files that can be decoded successfully

2015-03-20 Thread R. David Murray
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

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

2015-03-20 Thread Serhiy Storchaka
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

  1   2   >