[issue26374] concurrent_futures Executor.map semantics better specified in docs

2016-02-19 Thread Mark Dickinson
Mark Dickinson added the comment: I just noticed this point, which may be confusing things: > Rebut: order is undefined, concurrent_futures specifies map() returns an > iterator, where builtin map returns a list. In Python 3, the built-in map function returns an iterator, not a list.

[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-19 Thread STINNER Victor
STINNER Victor added the comment: > I wonder if Victor could clarify why bare except wasn't used in the python3 > version. What do you call a "bare except"? I wrote "except Exception: ; raise", it doesn't ignore the error. I want to always call the cleanup code on error. --

[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-19 Thread Martin Panter
Martin Panter added the comment: Victor: You changed “except Exception:” to bare “except:” in revision 182f08c0dd45 in Python 2, but the Python 3 code never got such a change. -- ___ Python tracker

[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-19 Thread STINNER Victor
STINNER Victor added the comment: > Victor: You changed “except Exception:” to bare “except:” in revision > 182f08c0dd45 in Python 2, but the Python 3 code never got such a change. Ah strange :-) Python 3 must also be fixed. -- ___ Python tracker

[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-19 Thread Georg Brandl
Changes by Georg Brandl : -- nosy: -georg.brandl ___ Python tracker ___ ___

[issue26382] List object memory allocator

2016-02-19 Thread Catalin Gabriel Manciu
Catalin Gabriel Manciu added the comment: Hi Victor, This patch follows the same idea as your proposal, but it's focused on a single object type. I think doing this incrementally is the safer approach, allowing us to have finer control over the new areas where we enable allocating using the

[issue26382] List object memory allocator

2016-02-19 Thread STINNER Victor
STINNER Victor added the comment: Catalin Gabriel Manciu: "(...) allowing us to have finer control over the new areas where we enable allocating using the small object allocator and detect where this replacement might be detrimental to the performance" Ah, interesting, do you think that it's

[issue26390] hashlib's pbkdf2_hmac documentation "rounds" does not match source

2016-02-19 Thread Daan Bakker
Daan Bakker added the comment: Good catch. I updated that reference now from rounds to iterations as well. -- Added file: http://bugs.python.org/file41969/pbkdf2_5.patch ___ Python tracker

[issue26382] List object memory allocator

2016-02-19 Thread Catalin Gabriel Manciu
Catalin Gabriel Manciu added the comment: Theoretically, an object type that consistently allocates more than the small object threshold would perform a bit slower because it would first jump to the small object allocator, do the size comparison and then jump to malloc. There would be a small

[issue26382] List object memory allocator

2016-02-19 Thread STINNER Victor
STINNER Victor added the comment: "Theoretically, an object type that consistently allocates more than the small object threshold would perform a bit slower because it would first jump to the small object allocator, do the size comparison and then jump to malloc." I expect that the cost of

[issue26382] List object memory allocator

2016-02-19 Thread Alecsandru Patrascu
Changes by Alecsandru Patrascu : -- nosy: +alecsandru.patrascu ___ Python tracker ___

[issue26391] Specialized sub-classes of Generic never call __init__

2016-02-19 Thread Kai Wohlfahrt
New submission from Kai Wohlfahrt: A specialized sub-class of a generic type never calls __init__ when it is instantiated. See below for an example: from typing import Generic, TypeVar T = TypeVar('T') class Foo(Generic[T]): def __init__(self, value: T): self.value = value Bar =

[issue23430] socketserver.BaseServer.handle_error() should not catch exiting exceptions

2016-02-19 Thread Berker Peksag
Changes by Berker Peksag : -- stage: patch review -> commit review ___ Python tracker ___

[issue26366] Use “.. versionadded” over “.. versionchanged” where appropriate

2016-02-19 Thread Tony R.
Tony R. added the comment: > Here are the original descriptions of the old LaTeX version. Holy crap! You all used to use LaTeX?! :D (I know--LaTeX is still going strong in academia. I just had no idea it was ever part of Python’s documentation, except as an output format.) > Adding a

[issue26366] Use “.. versionadded” over “.. versionchanged” where appropriate

2016-02-19 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: On Fri, Feb 19, 2016 at 10:02 AM, Tony R. wrote: > Holy crap! You all used to use LaTeX?! :D Python's documentation has a long & colorful history. :-) > Well then, if this is the sort of place where the status quo is sacred,

[issue26366] Use “.. versionadded” over “.. versionchanged” where appropriate

2016-02-19 Thread Georg Brandl
Georg Brandl added the comment: > Well then, if this is the sort of place where the status quo is sacred, > then there is nothing more to discuss. That wasn't my intention when quoting the old documenting guide, it was just to show what the intent was (and still is), and that I didn't just

[issue23061] Update pep8 to specify explicitly 'module level' imports at top of file

2016-02-19 Thread Pas
Changes by Pas : -- nosy: +pas ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue25668] Deadlock in logging caused by a possible race condition with "format"

2016-02-19 Thread Oliver Ruiz Dorantes
Oliver Ruiz Dorantes added the comment: I am logging from a different thread than the thread which actually created the object. Though I am getting its reference in a very odd way I can reproduce the following while is not a deadlock, I believe is related: Traceback (most recent call last):

[issue26392] socketserver.BaseServer.close_server should stop serve_forever

2016-02-19 Thread Aviv Palivoda
New submission from Aviv Palivoda: Currently if you call server_close you only close the socket. If we called serve_forever and then call server_close without calling shutdown the serve_forever loop keep running. Before using the selectors module for doing the poll we would have had

[issue26366] Use “.. versionadded” over “.. versionchanged” where appropriate

2016-02-19 Thread Tony R.
Tony R. added the comment: > Part of the problem is getting the granularity right. The initial intent was > that 'version*' were annotations for the enclosing object (function, class, > method, etc.). If we want to have something more granular (parameter > added / deprecated / whatever), we

[issue26366] Use “.. versionadded” over “.. versionchanged” where appropriate

2016-02-19 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: Another reason to value the status-quo in this case is that this isn't just a matter for the Python documentation; it's about the recommended usage for the markup, which is used by many other packages. Questions that should be discussed include: 1. Should

[issue26376] Tkinter root window won't close if packed.

2016-02-19 Thread Sam Yeager
Sam Yeager added the comment: I've reverted to ActiveTcl 8.5.18. Issue persists. Uploading screenshots before and after attempting to close root window. -- Added file: http://bugs.python.org/file41972/1 Before closing root window.png ___ Python

[issue26376] Tkinter root window won't close if packed.

2016-02-19 Thread Sam Yeager
Changes by Sam Yeager : Added file: http://bugs.python.org/file41973/2 After closing root window.png ___ Python tracker ___

[issue21878] wsgi.simple_server's wsgi.input read/readline waits forever in certain circumstances

2016-02-19 Thread tzickel
tzickel added the comment: Just encountered this issue as well. It's not related to newlines, but to not supporting HTTP or persistent connections (the wsgi.input is the socket's I/O directly, and if the client serves a persistent connection, then the .read() will block forever). A simple

[issue26377] Tkinter dialogs will not close if root window not packed.

2016-02-19 Thread Sam Yeager
Changes by Sam Yeager : Added file: http://bugs.python.org/file41975/2 After closing window and box.png ___ Python tracker ___

[issue26377] Tkinter dialogs will not close if root window not packed.

2016-02-19 Thread Sam Yeager
Changes by Sam Yeager : Added file: http://bugs.python.org/file41974/1 Before closing window and box.png ___ Python tracker ___

[issue26393] random.shuffled

2016-02-19 Thread Aviv Palivoda
New submission from Aviv Palivoda: I am suggesting adding random.shuffled to the random module. This is very similar to the shuffle function just return a new shuffled list instead of in place shuffle. This is very similar to the sorted and list.sort. As you can see in the patch the shuffled

[issue25668] Deadlock in logging caused by a possible race condition with "format"

2016-02-19 Thread Vinay Sajip
Vinay Sajip added the comment: @Oliver Ruiz Dorantes I don't see how yuou reach that conclusion from what you're showing - it just looks like s mismatch bertween format string and arguments. If you can shrink it down to a small standalone script that demonstrates the problem, it would be

[issue5715] listen socket close in SocketServer.ForkingMixIn.process_request()

2016-02-19 Thread Martin Panter
Martin Panter added the comment: Replying to Donghyun’s last message, I understand UDPServer is derived from the TCPServer, so it would inherit TCPServer.server_close(), and therefore would close the one and only UDP socket. I think you may have to add a new prepare_child() method, or add a

[issue26392] socketserver.BaseServer.close_server should stop serve_forever

2016-02-19 Thread Martin Panter
Martin Panter added the comment: I thought the purpose of server_close() was to clean up resources after you have finished calling serve_forever() or handle_request(). Just like you call close() on a file after you have finished reading or writing it. If you try to read or write a closed

[issue1429] FD leak in SocketServer when request handler throws exception

2016-02-19 Thread Martin Panter
Martin Panter added the comment: Jeff has tried many times over two years to produce the originally reported bug without success. By code inspection, I cannot see how a request handler exception could cause a leak. Therefore I am closing this as “works for me”. Working backwards from all the

[issue13354] tcpserver should document non-threaded long-living connections

2016-02-19 Thread Martin Panter
Martin Panter added the comment: Bas: I think you need to provide more information. Are you talking about protocols like HTTP, where multiple high-level (HTTP-level) requests are made over a single low-level (socket-level) connection? Some example code might help. Overriding

[issue26377] Tkinter dialogs will not close if root window not packed.

2016-02-19 Thread Sam Yeager
Changes by Sam Yeager : -- type: -> behavior ___ Python tracker ___ ___

[issue26351] Occasionally check for Ctrl-C in long-running operations like sum

2016-02-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: Great idea. In Windows, closing the window with [x] will kill the process, at the cost of loosing its contents. In IDLE's Shell, Restart Shell will do the same without killing IDLE, but it is easy to not know of or forget that option in a moment of panic.

[issue26351] Occasionally check for Ctrl-C in long-running operations like sum

2016-02-19 Thread STINNER Victor
STINNER Victor added the comment: > Great idea. In Windows, closing the window with [x] will kill the process, > at the cost of loosing its contents. Note: after a few years, I heard that Windows supports something like SIGKILL: CTRL+Pause kills the current process ;-) You loose the process,

[issue26358] mmap.mmap.__iter__ is broken (yields bytes instead of ints)

2016-02-19 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +twouters versions: -Python 3.2, Python 3.3, Python 3.4 ___ Python tracker ___

[issue22468] Tarfile using fstat on GZip file object

2016-02-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 94a94deaf06a by Martin Panter in branch '3.5': Issues #22468, #21996, #22208: Clarify gettarinfo() and TarInfo usage https://hg.python.org/cpython/rev/94a94deaf06a New changeset e66c476b25ec by Martin Panter in branch 'default': Issue #22468: Merge

[issue26367] importlib.__import__ does not fail for invalid relative import

2016-02-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: Manuel, welcome to the tracker and thank you for submitting patches. I agree that 5 lines is past the threshhold. Your profile has been CLA-updated, so we are good to go. -- nosy: +terry.reedy ___ Python tracker

[issue21996] gettarinfo method does not handle files without text string names

2016-02-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 94a94deaf06a by Martin Panter in branch '3.5': Issues #22468, #21996, #22208: Clarify gettarinfo() and TarInfo usage https://hg.python.org/cpython/rev/94a94deaf06a New changeset 9d5217aaea13 by Martin Panter in branch '2.7': Issues #22468, #21996,

[issue22208] tarfile can't add in memory files (reopened)

2016-02-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 94a94deaf06a by Martin Panter in branch '3.5': Issues #22468, #21996, #22208: Clarify gettarinfo() and TarInfo usage https://hg.python.org/cpython/rev/94a94deaf06a New changeset 9d5217aaea13 by Martin Panter in branch '2.7': Issues #22468, #21996,

[issue22468] Tarfile using fstat on GZip file object

2016-02-19 Thread Martin Panter
Martin Panter added the comment: Hoping my clarification in the documentation is enough to call this fixed -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 2.7, Python 3.6 -Python 3.4 ___ Python

[issue21996] gettarinfo method does not handle files without text string names

2016-02-19 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed versions: +Python 3.6 -Python 3.4 ___ Python tracker

[issue26369] doc for unicode.decode and str.encode is unnecessarily confusing

2016-02-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: The intended use for str.encode is for same-type transcoding, like this: I was unaware of the seemingly useless behavior you quote. >>> 'abc'.encode('base64') 'YWJj\n' >>> 'YWJj\n'.decode('base64') 'abc' Here is a similar use for unicode.decode. >>>

[issue26375] Python 2.7.10 and 3.4.4 hang on imaplib.IMAP4_SSL()

2016-02-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: where was the 'RC4 cipher' removed from. Do you know the issue or commit that did so? -- keywords: +3.4regression nosy: +terry.reedy stage: -> test needed title: New versions of Python hangs on imaplib.IMAP4_SSL() -> Python 2.7.10 and 3.4.4 hang on

[issue26376] Tkinter root window won't close if packed.

2016-02-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: No problem on Windows either, where the minimum window width is wide enough to acommodate all 3 frame buttons (- [] X). Please run your test.py directly, either in the terminal or however else one does so on OSX, without IDLE, to make absolutely sure that

[issue26377] Tkinter dialogs will not close if root window not packed.

2016-02-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: Try adding 'parent=rootWin' to the messagebox call. Otherwise, I expect that this is, as far as cause, a duplicate of #2637, in which case my comment https://bugs.python.org/issue26376#msg260544 applies. -- components: -IDLE nosy: +terry.reedy

[issue26379] zlib decompress as_bytearray flag

2016-02-19 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +nadeem.vawda, twouters ___ Python tracker ___ ___

[issue13354] tcpserver should document non-threaded long-living connections

2016-02-19 Thread Bas Wijnen
Bas Wijnen added the comment: For example, I have some programs which are HTTP servers that implement WebSockets. For regular web page requests, it is acceptable if the connection is closed after the page is sent. But for a WebSocket it isn't: the whole point of that protocol is to allow

[issue26380] Add an http method enum

2016-02-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: If I were deciding, I would be inclined to reject this. Part of the understanding when enums were added was that they would not automatically be used in the stdlib anywhere there could be used. To answer 'why not', there is an obvious gain to naming

[issue26382] List object memory allocator

2016-02-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: My impression is that we do not do such performance enhancements to 2.7 for the same reason we would not do them to current 3.x -- the risk of breakage. Have I misunderstood? -- nosy: +terry.reedy ___ Python

[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: `except:` is equivalent to `except BaseException:`. When I introduced the former into idlelib, a couple of years ago, I was told to do the latter in a follow-up patch, so that there would be no doubt as to the intent. The same should be done here.

[issue26382] List object memory allocator

2016-02-19 Thread STINNER Victor
STINNER Victor added the comment: Terry J. Reedy added the comment: > My impression is that we do not do such performance enhancements to 2.7 for > the same reason we would not do them to current 3.x -- the risk of breakage. > Have I misunderstood? Breakage of what? The change looks very

[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-19 Thread STINNER Victor
STINNER Victor added the comment: I prefer "except:" over "except BaseException:". What is the benefit of passing explicitly BaseException? -- ___ Python tracker

[issue26380] Add an http method enum

2016-02-19 Thread Martin Panter
Martin Panter added the comment: The RFC for HTTP says the method is case-sensitive, although I have seen one person use lowercase (probably by accident). So “over the wire” it has to be uppercase b"GET". -- ___ Python tracker

[issue26386] tkinter - Treeview - .selection_add and selection_toggle

2016-02-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: The 3.5 version of 2015 Dec 6 is 3.5.1. A traceback is not a crash for the purpose of this tracker. It is generally a good idea to mention OS, OS version, and Tk Version. (IDLE displays TkVersion in Help => About IDLE.) However, on Win 10 (8.6.4), I was

[issue26386] tkinter - Treeview - .selection_add and selection_toggle

2016-02-19 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- stage: -> test needed versions: +Python 2.7, Python 3.6 ___ Python tracker ___

[issue26389] Expand traceback module API to accept just an exception as an argument

2016-02-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: You title and post don't seem to match. The title says to expand the API and the post says there is no reason to expand the API. Did you mean 'good reason'? Also, I think you meant 'grab the traceback' (from the exception) rather than 'grab the exception'.

[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-19 Thread Martin Panter
Martin Panter added the comment: Eryk Sun: The patch proposes to add an unlink() call after the file has been closed: except Exception: _os.close(fd) # This automatically deletes the file right? _os.unlink(name) # Won’t this raise FileNotFoundError? raise By your explanation, it

[issue26351] Occasionally check for Ctrl-C in long-running operations like sum

2016-02-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: I verified that ^Break(pause) works. It even causes ^C to be printed. -- ___ Python tracker ___

[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: It makes it clearer that you know that it will 'everything' and intend to catch do so and that you did not casually toss in 'except:', as used to be the habit of many. There are over 20 bare excepts in idlelib and I suspect many or most are unintentionally

[issue13354] tcpserver should document non-threaded long-living connections

2016-02-19 Thread Martin Panter
Martin Panter added the comment: Thanks for the fast response! There is a paragraph right at the end of that mentions this technique: “. . . maintain an explicit table of partially finished requests . . .”. Perhaps

[issue26389] Expand traceback module API to accept just an exception as an argument

2016-02-19 Thread Martin Panter
Martin Panter added the comment: There is precedent with Python 2’s “raise” statement for accepting an exception instance for the first parameter (where an exception class would otherwise be passed). Also, generator.throw() supports this; see Issue 14911 for clarifying its documentation. I

[issue13354] tcpserver should document non-threaded long-living connections

2016-02-19 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue4928] Problem with tempfile.NamedTemporaryFile

2016-02-19 Thread Martin Panter
Martin Panter added the comment: I am surprised at the report that Red Hat Linux automatically removed the file. What system calls are involved? On my Arch Linux setup with current 3.6 code it leaves the file behind (same as the Solaris report). However the the Windows version does

[issue26261] NamedTemporaryFile documentation is vague about the `name` attribute

2016-02-19 Thread Martin Panter
Martin Panter added the comment: Here is my proposed patch. -- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file41977/tempfile-name.patch ___ Python tracker