[issue10395] new os.path function to extract common prefix based on path components

2015-03-20 Thread Paddy McCarthy
Paddy McCarthy added the comment: Can we now: 1. Move os.path.commonprefix to str.commonprefix or string.commonprefix 2. Deprecate the use of os.path.commonprefix 3. Add os.path.commonpath 4. Update the documentation. This seems to have lingered for too long and yet people have been willing

[issue23704] Make deques a full MutableSequence by adding index(), insert(), and copy()

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: When appending fails, the deque is left in changed state. I would do it in different way. First append new item (can fail), and then make circular shift (never fail). This also should be faster (up to 2 times). Most code can be shared between rotate() and ci

[issue15011] Change Scripts to bin on Windows

2015-03-20 Thread Steve Dower
Steve Dower added the comment: Right now I'm inclined to reject it completely, if only for backwards compatibility (there was certainly strong opposition on python-dev recently). That said, there's some ongoing discussion about what a python.org installation is meant to look like, which may le

[issue9445] Fix undefined symbol errors on VS8.0 build

2015-03-20 Thread Steve Dower
Steve Dower added the comment: The patch is obsolete, but Martin is correct - we can drop the detection completely. Any concerns? (Reading through the issue, there may be some value in a more general GetFinalPathNameByHandle wrapper that can get VOLUME_NAME_DOS if available and VOLUME_NAME_NT

[issue22832] Tweak parameter names for fcntl module

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is worth a discussion on Python-Dev. http://comments.gmane.org/gmane.comp.python.devel/152025 -- ___ Python tracker ___ _

[issue23704] Make deques a full MutableSequence by adding index(), insert(), and copy()

2015-03-20 Thread Raymond Hettinger
New submission from Raymond Hettinger: Attaching an updated patch with documentation updates and tests. -- Added file: http://bugs.python.org/file38617/deque_insert_index_copy4.diff ___ Python tracker _

[issue23727] rfc2231 line continuations result in an additional newline

2015-03-20 Thread Steve Dower
Changes by Steve Dower : -- nosy: -steve.dower ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue23687] Stacktrace identifies wrong line in multiline list comprehension

2015-03-20 Thread R. David Murray
Changes by R. David Murray : Removed file: http://bugs.python.org/file38612/py2.JPG ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue23687] Stacktrace identifies wrong line in multiline list comprehension

2015-03-20 Thread R. David Murray
Changes by R. David Murray : -- Removed message: http://bugs.python.org/msg238746 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue23727] rfc2231 line continuations result in an additional newline

2015-03-20 Thread R. David Murray
R. David Murray added the comment: Can you provide an example email in a simple reproducer script? -- ___ Python tracker ___ ___ Pytho

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

2015-03-20 Thread R. David Murray
R. David Murray added the comment: It would also be helpful to have a patch with minimum changes (that is, do not reflow the lines). -- nosy: +r.david.murray ___ Python tracker

[issue22936] traceback module has no way to show locals

2015-03-20 Thread R. David Murray
Changes by R. David Murray : -- nosy: +n ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.or

[issue23724] Stack Trace should show argument value passed into a function, not just the keyword

2015-03-20 Thread R. David Murray
R. David Murray added the comment: Duplicate of issue 22936. -- nosy: +r.david.murray resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> traceback module has no way to show locals versions: -Python 2.7, Python 3.4, Python 3.6 __

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

2015-03-20 Thread R. David Murray
R. David Murray added the comment: There's actually an issue about exactly that broken-per-docs issue for io. IMO if the goal of calling close is to close only things that are generator objects or pretending to be one, the method should have been named close_generator or something. -

[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-03-20 Thread Steve Dower
Steve Dower added the comment: I think my patch queue went bad somewhere - a few lines disappeared. New patch. -- Added file: http://bugs.python.org/file38616/23524_5.patch ___ Python tracker __

[issue9445] Fix undefined symbol errors on VS8.0 build

2015-03-20 Thread Mark Lawrence
Mark Lawrence added the comment: I believe that this can be closed as fixed, would someone like to do the honours please. -- nosy: +steve.dower, tim.golden, zach.ware ___ Python tracker

[issue15011] Change Scripts to bin on Windows

2015-03-20 Thread Mark Lawrence
Mark Lawrence added the comment: Should we try to implement this in 3.5, hold it until 3.6, reject it completely or what? -- nosy: +BreamoreBoy, tim.golden ___ Python tracker __

[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-03-20 Thread Steve Dower
Steve Dower added the comment: Updated the patch, mainly because of the changes that have gone in over the last week (especially _Py_read and _Py_write). -- Added file: http://bugs.python.org/file38615/23524_4.patch ___ Python tracker

[issue23668] Support os.[f]truncate on Windows

2015-03-20 Thread Steve Dower
Steve Dower added the comment: Updated the patch, since there's been a lot of checkins. I also removed the pyconfig.h changes and updated the #ifdef in posixmodule.c to enable truncate/ftruncate and define PATH_HAVE_FTRUNCATE. And I know in the last review I said I'd switch to _Py_wopen(), but

[issue2292] Missing *-unpacking generalizations

2015-03-20 Thread Neil Girdhar
Neil Girdhar added the comment: Removed a confusing and outdated comment in Lib/importlib/_bootstrap.py -- Added file: http://bugs.python.org/file38613/starunpack39.diff ___ Python tracker __

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

2015-03-20 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

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

[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 https://gist.github.com/berkerpeksag/8b8db

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

[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

[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

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

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

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

2015-03-20 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- title: Fix inconsistencies in behaviour and document it correctly for multiprocessing.Manager facade -> Multiprocessing.Manager: fix behavior and doc inconsistencies ___ Python tracker

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

[issue2292] Missing *-unpacking generalizations

2015-03-20 Thread Neil Girdhar
Changes by Neil Girdhar : Added file: http://bugs.python.org/file38611/starunpack38.diff ___ Python tracker ___ ___ Python-bugs-list mailing li

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

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

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

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

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

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

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

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

2015-03-20 Thread Nicholas Chammas
Changes by Nicholas Chammas : -- nosy: +Nicholas Chammas ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[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(), bu

[issue23726] Don't enable GC for classes that don't add new fields

2015-03-20 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +benjamin.peterson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue5680] Command-line arguments when running in IDLE

2015-03-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Here's my comment from the duplicate tracker item: -- A number of IDEs support menu options to set the execution environment for programs under development and testing. In particular, it would be nice if IDLE

[issue23726] Don't enable GC for classes that don't add new fields

2015-03-20 Thread Eugene Toder
Eugene Toder added the comment: Actually, this is rather new -- new in 3.5. The check was relaxed in #22986: https://hg.python.org/cpython/rev/c0d25de5919e Previously only heap types allowed re-assigning __class__. -- ___ Python tracker

[issue23726] Don't enable GC for classes that don't add new fields

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be we should forbid assigning the __class__ attribute of basic builtin types (especially internable, such as int, str, bytes, tuple, bool, NoneType). -- ___ Python tracker _

[issue23727] rfc2231 line continuations result in an additional newline

2015-03-20 Thread Eric V. Smith
Changes by Eric V. Smith : -- components: +email -Windows nosy: +barry, r.david.murray ___ Python tracker ___ ___ Python-bugs-list mai

[issue22516] Windows Installer won't - even when using "just for me"option

2015-03-20 Thread Steve Dower
Steve Dower added the comment: > my guess (conceded, this is based on no actual metrics) would be that 99% of > Windows users use the python.org installers, certainly not the other way > around. Based on numbers I've heard it's certainly a majority currently using the python.org installers, b

[issue23726] Don't enable GC for classes that don't add new fields

2015-03-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: I wasn't aware of that :-o -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5680] Command-line arguments when running in IDLE

2015-03-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: I closed #23665 in favor of this one. Raymond's take: msg238108 -- ___ Python tracker ___ ___ Python

[issue23665] Provide IDLE menu option to set command-line arguments

2015-03-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: #5680 has 3 different patches. I have not reviewed them yet. I will link to Raymond's message there. -- nosy: +terry.reedy resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> Command-line arguments when runni

[issue23726] Don't enable GC for classes that don't add new fields

2015-03-20 Thread Eugene Toder
Eugene Toder added the comment: Agreed, but this is not new. This works without my change: >>> class Tuple(tuple): ... __slots__ = () ... def __repr__(self): return 'Imma tuple!' ... >>> ().__class__ = Tuple >>> () Imma tuple! --

[issue23728] binascii.crc_hqx() can return negative integer

2015-03-20 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: zlib.adler32(), zlib.crc32(), and binascii.crc32() always return 32-bit unsigned integer in Python 3. binascii.crc_hqx() almost always returns 16-bit unsigned integer. But there is an exception. The result can negative only when arguments of binascii.crc_h

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

2015-03-20 Thread Ned Deily
Changes by Ned Deily : -- assignee: -> docs@python components: +Documentation -Library (Lib) nosy: +docs@python stage: -> patch review ___ Python tracker ___ __

[issue23727] rfc2231 line continuations result in an additional newline

2015-03-20 Thread Brian Peterson
New submission from Brian Peterson: Hey, So here we go: When an email header goes over a line break, rfc2231 (https://tools.ietf.org/html/rfc2231) specifies that it get formatted in such a way that the line break is stripped out. This formatting looks like, for example: > filename*0="my lo

[issue23723] Provide a way to disable bytecode staleness checks

2015-03-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: This would avoid the need to modify an interpreter to have this optimization. In this mode the potentially expensive stat() call is avoided. No need to ensure that the pyc file's embedded timestamp matches the py file's timestamp. The only use of this mod

[issue22341] Python 3 crc32 documentation clarifications

2015-03-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: I do not object to the removal of the & 0xfff from the stdlib library code if these functions have actually been fixed to always return unsigned now. (double check the behavior, and if good, just do it!) But I think the docs should still mention that th

[issue23648] PEP 475 meta issue

2015-03-20 Thread Charles-François Natali
Charles-François Natali added the comment: Well, all the syscalls which can blocki can fail with EINTR, so all I:O related one. -- ___ Python tracker ___

[issue23726] Don't enable GC for classes that don't add new fields

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >>> class UserIntSlots(int): ... __slots__ = () ... def __repr__(s): return '5' ... >>> (4).__class__ = UserIntSlots >>> 2+2 5 >>> type(2+2) It looks weird. -- ___ Python tracker

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

2015-03-20 Thread Charles-François Natali
Charles-François Natali added the comment: Could you regenerate your latest patch? It doesn't show properly in the review tool. Also, what's with the assert? -- ___ Python tracker _

[issue23726] Don't enable GC for classes that don't add new fields

2015-03-20 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Interpreter Core nosy: +serhiy.storchaka stage: -> patch review versions: +Python 3.5 -Python 3.6 ___ Python tracker ___ __

[issue22516] Windows Installer won't - even when using "just for me"option

2015-03-20 Thread Paul Moore
Paul Moore added the comment: > 99% of Python users should be getting a distribution rather than the > python.org installers I'm not at all convinced by this logic. On Windows, as far as I'm aware, the only "major" Python distributions are Anaconda and Enthought, both of which are intended ma

[issue23726] Don't enable GC for classes that don't add new fields

2015-03-20 Thread Eugene Toder
New submission from Eugene Toder: As far as I can tell, if a new class does not add any new fields, and its base class doesn't use GC, there's no reason to enable GC for the new class. This is useful for creating lightweight wrappers around classes implemented in C. -- files: class_gc.

[issue23705] Speed-up deque.__contains__

2015-03-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: It would be nice to add a test for the RuntimeError case. -- nosy: +pitrou ___ Python tracker ___ __

[issue23306] Within zipfile, use of zlib.crc32 raises OverflowError at argument-parsing time on large strings

2015-03-20 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue22341] Python 3 crc32 documentation clarifications

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue4903. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue22341] Python 3 crc32 documentation clarifications

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: These notes was added by Gregory in r68535. Ask him if they still are needed. -- nosy: +gregory.p.smith ___ Python tracker ___ ___

[issue22758] Regression in Python 3.2 cookie parsing

2015-03-20 Thread Tim Graham
Tim Graham added the comment: Patch updated to fix conflict in NEWS. Could we have it committed to ensure it gets fixed in the next 3.2 released? -- Added file: http://bugs.python.org/file38609/secure-httponly-3.2-backport.diff ___ Python tracker

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

2015-03-20 Thread Zbyszek Jędrzejewski-Szmek
New submission from Zbyszek Jędrzejewski-Szmek: tempfile docs can use some refreshing. -- components: Library (Lib) files: 0001-docs-update-description-of-TemporaryFile-and-tempfil.patch keywords: patch messages: 238713 nosy: zbysz priority: normal severity: normal status: open title: [P

[issue22516] Windows Installer won't - even when using "just for me"option

2015-03-20 Thread Steve Dower
Steve Dower added the comment: > My understanding is that at least some of the separate distributions are > separate gardens cut off from the wider pip-accessible python ecosystem. Maybe some are, but certainly not all of them. There are sometimes cross-dependencies that require you to go to t

[issue23724] Stack Trace should show argument value passed into a function, not just the keyword

2015-03-20 Thread Umank Behera
New submission from Umank Behera: Code: def main(foo): raise Exception("Some Exception") bar = 1 main(bar) On execution: Traceback (most recent call last): File "st.py", line 5, in main(bar) File "st.py", line 2, in main raise Exception("Some Exception") Exception: Some Ex

[issue22516] Windows Installer won't - even when using "just for me"option

2015-03-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: > 99% of Python users should be getting a distribution rather than the > python.org installers. I do not understand this at all. Why? My understanding is that at least some of the separate distributions are separate gardens cut off from the wider pip-access

[issue23705] Speed-up deque.__contains__

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Except one line with dubious spacing the patch LGTM. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-03-20 Thread Steve Dower
Steve Dower added the comment: Any chance of a review on the newest patch? -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue22832] Tweak parameter names for fcntl module

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks you for your patch Alex. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___

[issue22832] Tweak parameter names for fcntl module

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset a3c9c2c92b87 by Serhiy Storchaka in branch 'default': Issue #22832: Tweaked parameter names for fcntl module to better match https://hg.python.org/cpython/rev/a3c9c2c92b87 -- nosy: +python-dev ___ Python

[issue23723] Provide a way to disable bytecode staleness checks

2015-03-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: What is the benefit? -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue23723] Provide a way to disable bytecode staleness checks

2015-03-20 Thread Brett Cannon
New submission from Brett Cannon: In environments where bytecode generation is thoroughly controlled, it would be nice if there was a way to specify that the bytecode file is externally guaranteed to be up-to-date, and thus skip any stat call involving bytecode verification. Could be represent

[issue22832] Tweak parameter names for fcntl module

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Except brackets the patch LGTM. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue23662] Cookie.domain is undocumented

2015-03-20 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: +demian.brecht ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

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

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Agree. But may be at least emit a warning? -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue23419] Faster default __reduce__ for classes without __init__

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For a namedtuple such as turtle.Vec2D there is no significant difference in the time of unpickling. But for simpler type it is. $ ./python -m timeit -s 'import pickle, turtle; global I' -s 'class I(int): pass' -s 'p = pickle.dumps([I(i) for i in range(1000)]

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

2015-03-20 Thread Wolfgang Maier
Wolfgang Maier added the comment: OTOH, it would be very hard to change the way fileobjects compared to designing yield from differently so I'd still blame it partly. Maybe it is unfortunate that generators have a close method instead of, say, __close__ ? -- __

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

2015-03-20 Thread Wolfgang Maier
Wolfgang Maier added the comment: You are probably right that the io classes are broken. >From https://docs.python.org/3/library/stdtypes.html#iterator-types: Once an iterator’s __next__() method raises StopIteration, it must continue to do so on subsequent calls. Implementations that do not o

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

2015-03-20 Thread STINNER Victor
STINNER Victor added the comment: > Isn't there some discussion somewhere that if iter(x) returns x you probably > have buggy code? I agree that the issue comes from TextIOWrapper.__iter__(), BufferedReader.__iter__() and FileIO.__iter__() returns simply return self *and* have a close method. T

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

2015-03-20 Thread R. David Murray
R. David Murray added the comment: Isn't there some discussion somewhere that if iter(x) returns x you probably have buggy code? Maybe it is io that is broken, design-wise. I think there was another issue related to iter(file) recently...someone surprised by the fact that you can't iterate a

[issue22516] Windows Installer won't - even when using "just for me"option

2015-03-20 Thread Steve Dower
Steve Dower added the comment: @Mark: You can't - MSIs have a single flag indicating whether they should elevate or not. That's why I moved the 3.5 installer to a new format. Unfortunately, since we're in a transitional state, admin privileges are necessary to install the new CRT version, but

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

2015-03-20 Thread Skip Montanaro
Skip Montanaro added the comment: 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. Garbage in, garbage

[issue22958] Constructors of weakref mapping classes don't accept "self" and "dict" keyword arguments

2015-03-20 Thread Benjamin Peterson
Benjamin Peterson added the comment: lgtm -- nosy: +benjamin.peterson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue22516] Windows Installer won't - even when using "just for me"option

2015-03-20 Thread Mark Mikofski
Mark Mikofski added the comment: 1. J morton: just install Anacondahttp://continuum.io/downloads 2. I will take a look at the msi and see if I can accommodate both installs in the same installer -- ___ Python tracker

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

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset ceb14ecc1942 by R David Murray in branch '3.4': #11726: Make linecache docs reflect that all files are treated the same. https://hg.python.org/cpython/rev/ceb14ecc1942 New changeset 1a5c72f9ff53 by R David Murray in branch 'default': Merge: #11726:

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

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

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

[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

[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: I think that that patch that Victor committed is incorrect, and that Thomas's patch is closer to correct. People *do* use linecache with files other than python source files, and as far as I can see we are not going to stop supporting that. Given the origin

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

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset b8ceb071159f by Victor Stinner in branch 'default': Issue #22181: Run "aclocal; autoconf; autoheader" to regenerate configure https://hg.python.org/cpython/rev/b8ceb071159f -- ___ Python tracker

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

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

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

2015-03-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 104c55bc2276 by Serhiy Storchaka in branch '3.4': Issue #23681: Fixed Python 2 to 3 poring bugs. https://hg.python.org/cpython/rev/104c55bc2276 New changeset 817f1f47824c by Serhiy Storchaka in branch 'default': Issue #23681: Fixed Python 2 to 3 por

[issue22516] Windows Installer won't - even when using "just for me"option

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 – Anyone

[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

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

[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

  1   2   >