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

2016-02-20 Thread Bas Wijnen
Bas Wijnen added the comment: Thank you for your fast response as well. I overlooked that paragraph indeed. It doesn't mention anything about avoiding a socket shutdown however. Keeping a list of requests isn't very useful if all the sockets in the list are closed. ;-) So I would indeed sug

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-02-20 Thread Ian Kelly
Ian Kelly added the comment: Chris Angelico suggested on python-list that another possibly useful thing to do would be to add a "from __future__ import generator_stop" to asyncio/futures.py. This would at least have the effect of causing "await future" to raise a RuntimeError instead of silent

[issue26392] socketserver.BaseServer.close_server should stop serve_forever

2016-02-20 Thread Aviv Palivoda
Aviv Palivoda added the comment: I see your point about the server_close purpose and I changed the patch to simulate the behavior of closed file (raising ValueError when operating on closed file). I don't think that this should be an enhancement as what i try to do is return the behavior as it

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

2016-02-20 Thread Eryk Sun
Eryk Sun added the comment: > By your explanation, it sounds like it would be better > to call unlink() before close(). Sorry, I was responding in general, because I thought you meant unlink would fail like it would for most open files on Windows, because the CRT normally doesn't open files w

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

2016-02-20 Thread SilentGhost
SilentGhost added the comment: Here is the updated patch including fixes for except and order of deletion. -- Added file: http://bugs.python.org/file41979/issue26385_3.diff ___ Python tracker __

[issue4928] Problem with tempfile.NamedTemporaryFile

2016-02-20 Thread Eryk Sun
Eryk Sun added the comment: Maybe a note could be added to suggest using a SIGTERM signal handler (e.g. the handler could raise a SIGTERM exception): POSIX: The file will not be deleted if the process is terminated abruptly by a signal. A process may register a SIGTERM handler to ensure that t

[issue26394] argparse: Add set_values() function to complement set_defaults()

2016-02-20 Thread Michael Herold
New submission from Michael Herold: argparse has at least three features to set defaults (default=, set_defaults(), argument_default=). However, there is no feature to set the values of arguments. The difference is, that a required argument has to be specified, also if a default value exists

[issue26336] Expose regex bytecode as attribute of compiled pattern object

2016-02-20 Thread Jonathan Goble
Jonathan Goble added the comment: Noting for the record that, as I had brought up on python-ideas [1], in addition to simply exposing the raw code, it would be nice to have a public constructor for the compiled pattern type and a 'dis'-like module for support. The former would enable optimizer

[issue25913] base64.a85decode adobe flag incorrectly utilizes <~ as a marker causing error

2016-02-20 Thread Martin Morrison
Martin Morrison added the comment: 3.patch looks good to me. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2016-02-20 Thread Brett Cannon
Brett Cannon added the comment: So Terry's right that in my haste to write down the idea I contradicted myself. I do want to tweak the APIs in the traceback module to accept only an exception. The question is whether we need entirely new functions or if the pre-existing ones can be updated to

[issue26394] argparse: Add set_values() function to complement set_defaults()

2016-02-20 Thread Brett Cannon
Brett Cannon added the comment: To paraphrase Michael, he wants a way to tell argparse that an argument has to be supplied either from the command-line or some other mechanism (e.g., envvar, config file, etc.), but that if the value cannot be found in either situation, argparse fails saying th

[issue26394] Have argparse provide ability to require a fallback value be present

2016-02-20 Thread Brett Cannon
Changes by Brett Cannon : -- title: argparse: Add set_values() function to complement set_defaults() -> Have argparse provide ability to require a fallback value be present ___ Python tracker _

[issue26307] no PGO for built-in modules with `make profile-opt`

2016-02-20 Thread Brett Cannon
Changes by Brett Cannon : -- stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2016-02-20 Thread Brett Cannon
Brett Cannon added the comment: Please add the fix to the issue that reported the problem so that the fix can be tracked with the bug report. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-02-20 Thread Guido van Rossum
Guido van Rossum added the comment: Chris, can you help out here? I still don't understand the issue here. Since "from __future__ import generator_stop" only works in 3.5+ it would not work in Python 3.3/3.4 (supported by upstream asyncio with literally the same source code currently). If ther

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

2016-02-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset e523efd47418 by Brett Cannon in branch '3.5': Issue #26367: Have importlib.__init__() raise RuntimeError when https://hg.python.org/cpython/rev/e523efd47418 New changeset 8f72bf88f471 by Brett Cannon in branch 'default': Merge for issue #26367 https

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

2016-02-20 Thread Brett Cannon
Brett Cannon added the comment: Thanks for the patch, Manuel! -- resolution: -> fixed status: open -> closed ___ Python tracker ___ _

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-02-20 Thread Chris Angelico
Chris Angelico added the comment: Ultimately, it's the exact same thing that PEP 479 is meant to deal with - raising StopIteration is functionally identical to returning. I don't use asyncio enough to be certain, but I'm not aware of any good reason to inject a StopIteration into it; maybe an

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

2016-02-20 Thread Martin Panter
Martin Panter added the comment: I think patch 3 is good for Python 3, thankyou. For Python 2, the test will have to be adjusted. From memory, mode='wr' is accepted without an exception, and mode=2 triggers an early error (so we never trigger the bug). -- _

[issue21042] ctypes.util.find_library() should return full pathname instead of filename in linux

2016-02-20 Thread Tamás Bence Gedai
Tamás Bence Gedai added the comment: What do you think about this regex? '(lib%s\.[^\s]+\s\(%s(?:\)|,\s.*\))\s=>\s.*)' % (re.escape(name), abi_type)) It works on 64 bit, just like before, but I could not test it on 32 bit. I'll add tests soon. I looked for documentation on ldconfig, but could

[issue26395] asyncio does not support yielding from recvfrom (socket/udp)

2016-02-20 Thread Simon Bernier St-Pierre
New submission from Simon Bernier St-Pierre: I want to receive data on a UDP socket that was bound, without blocking the event loop. I've looked through the asyncio docs, and I haven't found a way of doing that using the coroutine API (yield from/await). There is a sock_recv method on BaseEven

[issue24872] Add /NODEFAULTLIB:MSVCRT to _msvccompiler

2016-02-20 Thread Mark Mikofski
Mark Mikofski added the comment: still have the `link.exe` 1561 error without `extra_args=['/DLL']` issue. is there a patch? It goes in `distutils._msvccompiler` right? -- nosy: +bwanamarko ___ Python tracker

[issue26395] asyncio does not support yielding from recvfrom (socket/udp)

2016-02-20 Thread Guido van Rossum
Guido van Rossum added the comment: You should be able to do this by calling create_datagram_endpoint(), passing it a custom DatagramProtocol subclass whose datagram_received() stores the data in the result of a Future. You can then wait for the Future to wait for the data (assuming it ever ar

[issue26000] Crash in Tokenizer - Heap-use-after-free

2016-02-20 Thread Sean Gillespie
Sean Gillespie added the comment: Is anyone currently working on this? If not, I'd like to try and fix this. I've debugged this a little and think I have an idea of what's going on. -- nosy: +swgillespie ___ Python tracker

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-02-20 Thread Guido van Rossum
Guido van Rossum added the comment: OK, since eventually there won't be a way to inject StopIteration into a Future anyway (it'll always raise RuntimeError once PEP 479 is the default behavior) we should just reject this in set_exception(). -- ___ Pyt

[issue26395] asyncio does not support yielding from recvfrom (socket/udp)

2016-02-20 Thread Simon Bernier St-Pierre
Simon Bernier St-Pierre added the comment: That could work. I came up with this class MyProtocol(aio.DatagramProtocol): def __init__(self, fut): self._fut = fut def datagram_received(self, data, addr): self.fut.set_result((data, addr)) fut = aio.Future() loop.create_dat

[issue26395] asyncio does not support yielding from recvfrom (socket/udp)

2016-02-20 Thread Guido van Rossum
Guido van Rossum added the comment: I won't make you go through the PEP process, but I do think it's a bad idea to add this. After all datagrams aren't guaranteed to arrive, so, whil I don't know what protocol you're trying to implement, I think you're probably better off writing the whole thing

[issue26396] Create json.JSONType

2016-02-20 Thread Brett Cannon
New submission from Brett Cannon: See https://github.com/python/typing/issues/182 for the full details, but it should be: JSONType = t.Union[str, int, float, bool, None, t.Dict[str, t.Any], t.List[Any]] -- assignee: brett.cannon components: Library (Lib) messages: 260587 nosy: brett.ca

[issue26395] asyncio does not support yielding from recvfrom (socket/udp)

2016-02-20 Thread Simon Bernier St-Pierre
Simon Bernier St-Pierre added the comment: I want to have a loop that receives data like this: socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) socket.bind(('0.0.0.0', port)) socket.setblocking(False) while True: data, addr = await loop.sock_recvfrom(sock, 4096) # process packet

[issue26397] Tweak importlib Example of importlib.import_module() to use importlib.util.module_from_spec()

2016-02-20 Thread Brett Cannon
New submission from Brett Cannon: The example uses `spec.loader.create_module()` where it should be using `util.module_from_spec(spec)`. -- assignee: brett.cannon components: Documentation messages: 260589 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: o

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-02-20 Thread Chris Angelico
Chris Angelico added the comment: POC patch, no tests. Is TypeError right? Should it be ValueError, since the notional type is "Exception"? -- keywords: +patch Added file: http://bugs.python.org/file41980/no_stop_iter.patch ___ Python tracker

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-02-20 Thread Guido van Rossum
Guido van Rossum added the comment: I think TypeError is fine. I would make the message a bit longer to explain carefully what's the matter. -- ___ Python tracker ___ ___

[issue26388] Disabling changing sys.argv[0] with runpy.run_module(...alter_sys=True)

2016-02-20 Thread Mike Kaplinskiy
Changes by Mike Kaplinskiy : -- keywords: +patch Added file: http://bugs.python.org/file41981/patch.diff ___ Python tracker ___ ___ Py

[issue26186] LazyLoader rejecting use of SourceFileLoader

2016-02-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9f1e680896ef by Brett Cannon in branch '3.5': Issue #26186: Remove an invalid type check in https://hg.python.org/cpython/rev/9f1e680896ef New changeset 86fc6cdd65de by Brett Cannon in branch 'default': Merge for issue #26186 https://hg.python.org/c

[issue26186] LazyLoader rejecting use of SourceFileLoader

2016-02-20 Thread Brett Cannon
Brett Cannon added the comment: This has been resolved by removing the check (the docs have always said the method was ignored, so that will just continue). I also did separate commit to list that BuiltinImporter and ExtensionFileLoader won't work (they would need to be updated to return a mod

[issue26397] Tweak importlib Example of importlib.import_module() to use importlib.util.module_from_spec()

2016-02-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset f2a089d68297 by Brett Cannon in branch 'default': Issue #26397: Update an importlib example to use util.module_from_spec() instead of create_module() https://hg.python.org/cpython/rev/f2a089d68297 -- nosy: +python-dev _

[issue26397] Tweak importlib Example of importlib.import_module() to use importlib.util.module_from_spec()

2016-02-20 Thread Brett Cannon
Changes by Brett Cannon : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker ___ ___ Py

[issue21042] ctypes.util.find_library() should return full pathname instead of filename in linux

2016-02-20 Thread Martin Panter
Martin Panter added the comment: Tamás, it might be a good idea for you to sign a contributor agreement . I compiled Python in 32-bit mode and tried your v2 patch out, which found the wrong library as I predicted. Then I tried your new regex an

[issue26395] asyncio does not support yielding from recvfrom (socket/udp)

2016-02-20 Thread Martin Panter
Martin Panter added the comment: If your event loop supports it, maybe you could use add_reader() etc as a workaround (roughly based off a different function of my own; this version completely untested): async def sock_recvfrom(nonblocking_sock, *pos, loop, **kw): while True: try: