[issue31639] http.server and SimpleHTTPServer hang after a few requests

2017-12-17 Thread Glenn Linderman
Glenn Linderman added the comment: This probably has been around for a while: this 2011 thread in a Chromium wontfix bug is enlightening, but the solution suggested, a ThreadingMixIn for the HTTPServer, didn't help me.

[issue32352] `inspect.getfullargspec` doesn't work fine for some builtin callable objects

2017-12-17 Thread Martin Panter
Martin Panter added the comment: This was documented for the “getfullargspec” function in Issue 7422 (long before “signature” existed). The error message was also clarified in Issue 6905. However IMO the term “Python function” is too subtle and ambiguous. --

[issue29469] AST-level Constant folding

2017-12-17 Thread INADA Naoki
INADA Naoki added the comment: New changeset 87010e85cb37192d63b1a30e5fabba307ad5a3f5 by INADA Naoki in branch 'master': bpo-29469: peephole: Remove const_stack (GH-4879) https://github.com/python/cpython/commit/87010e85cb37192d63b1a30e5fabba307ad5a3f5 --

[issue31639] http.server and SimpleHTTPServer hang after a few requests

2017-12-17 Thread Glenn Linderman
Glenn Linderman added the comment: Same behavior on Windows. -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, v+python, zach.ware ___ Python tracker

[issue32358] json.dump: fp must be a text file object

2017-12-17 Thread TaoQingyun
New submission from TaoQingyun <845767...@qq.com>: ``` >>> import json >>> f = open('/tmp/t.json', 'wb') >>> json.dump(123, f) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.6/json/__init__.py", line 180, in dump

[issue32338] Save OrderedDict import in re

2017-12-17 Thread INADA Naoki
INADA Naoki added the comment: Please don't do this. del d[next(iter(d))] is not O(1) on current dict implementation. OrderedDict is designed for such use cases. Please keep using it. -- nosy: +inada.naoki ___ Python tracker

[issue32357] Optimize asyncio.iscoroutine() and loop.create_task() for non-native coroutines

2017-12-17 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +4809 stage: -> patch review ___ Python tracker ___

[issue32357] Optimize asyncio.iscoroutine() and loop.create_task() for non-native coroutines

2017-12-17 Thread Yury Selivanov
Change by Yury Selivanov : -- title: Optimize asyncio.iscoroutine() for non-native coroutines -> Optimize asyncio.iscoroutine() and loop.create_task() for non-native coroutines ___ Python tracker

[issue32357] Optimize asyncio.iscoroutine() for non-native coroutines

2017-12-17 Thread Yury Selivanov
New submission from Yury Selivanov : asyncio.Task now uses asyncio.iscoroutine() to give a comprehensible error if a user creates a Task for a non-awaitable type. The problem is that iscoroutine() is quite expensive for non-native coroutines (like the ones compiled with

[issue32204] async/await performance is very low

2017-12-17 Thread Yury Selivanov
Yury Selivanov added the comment: NP. I have another PR in the pipeline: https://github.com/python/cpython/pull/4913 Both optimizations make your benchmark run 30% faster on 3.7. If you compile asyncio.gather() with Cython you will get it another 5-15% faster. If you

[issue32204] async/await performance is very low

2017-12-17 Thread Liran Nuna
Liran Nuna added the comment: Yury, thank you very much for circling back. I wish I could be more helpful in pursuing performance improvements. -- ___ Python tracker

[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-12-17 Thread Yury Selivanov
Yury Selivanov added the comment: I think that what Nathaniel proposes is very reasonable. The PR is LGTM and I've just merged it. Closing the issue. -- components: +Interpreter Core resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-12-17 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset 902ab80b590e474bb2077b1fae8aac497b856d66 by Yury Selivanov (Nathaniel J. Smith) in branch 'master': bpo-30050: Allow disabling full buffer warnings in signal.set_wakeup_fd (#4792)

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2017-12-17 Thread Martin Panter
Martin Panter added the comment: Not if the time is associated with a particular day. Imagine implementing datetime.fromisoformat by separately calling date.fromisoformat and time.fromisoformat. The date will be off by one day if you naively rounded 2017-12-18 23:59

[issue32356] asyncio: Make transport.pause_reading()/resume_reading() idempotent; add transport.is_reading()

2017-12-17 Thread Yury Selivanov
New submission from Yury Selivanov : As briefly discussed on https://github.com/python/asyncio/issues/488 and https://github.com/python/cpython/pull/528 -- messages: 308509 nosy: yselivanov priority: normal severity: normal status: open title: asyncio: Make

[issue32356] asyncio: Make transport.pause_reading()/resume_reading() idempotent; add transport.is_reading()

2017-12-17 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +4808 stage: -> patch review ___ Python tracker ___

[issue32356] asyncio: Make transport.pause_reading()/resume_reading() idempotent; add transport.is_reading()

2017-12-17 Thread Yury Selivanov
Change by Yury Selivanov : -- nosy: +asvetlov ___ Python tracker ___ ___

[issue32355] Optimize asyncio.gather()

2017-12-17 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +4807 stage: -> patch review ___ Python tracker ___

[issue32355] Optimize asyncio.gather()

2017-12-17 Thread Yury Selivanov
New submission from Yury Selivanov : asyncio.gather can be made faster if: 1. we don't use functools.partial 2. create less intermittent collections 3. drop unnecessary code (e.g. gather has some code that's duplicated in ensure_future that it uses etc) The proposed PR

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2017-12-17 Thread Paul Ganssle
Paul Ganssle added the comment: @martin.panter I don't see the problem here? Wouldn't 23:59.995 round up to 00:00? -- ___ Python tracker

[issue32347] System Integrity Protection breaks shutil.copystat()

2017-12-17 Thread Ryan Govostes
Change by Ryan Govostes : -- keywords: +patch pull_requests: +4806 stage: -> patch review ___ Python tracker ___

[issue32354] Unclear intention of deprecating Py_UNICODE_TOLOWER / Py_UNICODE_TOUPPER

2017-12-17 Thread Campbell Barton
New submission from Campbell Barton : Py_UNICODE_TOLOWER / Py_UNICODE_TOUPPER are marked as deprecated in the docs. https://docs.python.org/3/c-api/unicode.html?highlight=py_unicode_tolower#c.Py_UNICODE_TOLOWER Someone submitted a patch to our project which uses these.

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2017-12-17 Thread Martin Panter
Martin Panter added the comment: Regarding Matthieu’s RFC 3339 parser, Victor wanted to use the round-half-to-even rule to get a whole number of microseconds. But considering the “time” class cannot represent 24:00, how do you round up in the extreme case past 23:59?

[issue32204] async/await performance is very low

2017-12-17 Thread Yury Selivanov
Yury Selivanov added the comment: Liran, Task (C implementation) was optimized in issue 32348; your benchmark now runs 15% faster. -- ___ Python tracker

[issue32348] Optimize asyncio.Future schedule/add/remove callback

2017-12-17 Thread Yury Selivanov
Change by Yury Selivanov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue32348] Optimize asyncio.Future schedule/add/remove callback

2017-12-17 Thread Yury Selivanov
Yury Selivanov added the comment: The attached benchmark from https://bugs.python.org/issue32204 shows that the updated Task is 15% faster. -- Added file: https://bugs.python.org/file47335/t.py ___ Python tracker

[issue32348] Optimize asyncio.Future schedule/add/remove callback

2017-12-17 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset 1b7c11ff0ee3efafbf5b38c3c6f37de5d63efb81 by Yury Selivanov in branch 'master': bpo-32348: Optimize asyncio.Future schedule/add/remove callback. (#4907)

[issue32248] Port importlib_resources (module and ABC) to Python 3.7

2017-12-17 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: PR 4911 implements the importlib.resources API, along with tests and documentation. @brett.cannon - I'm thinking we should do the native ResourceReader implementations for the built-in loaders as a separate branch. --

[issue32248] Port importlib_resources (module and ABC) to Python 3.7

2017-12-17 Thread Barry A. Warsaw
Change by Barry A. Warsaw : -- pull_requests: +4805 ___ Python tracker ___ ___

[issue32352] `inspect.getfullargspec` doesn't work fine for some builtin callable objects

2017-12-17 Thread Meador Inge
Meador Inge added the comment: This is a documented limitation for CPython: https://docs.python.org/3.7/library/inspect.html#inspect.signature -- nosy: +meador.inge ___ Python tracker

[issue32152] Add pid to .cover filename in lib/trace.py

2017-12-17 Thread Nikhil Hegde
Nikhil Hegde added the comment: Any ETA I can get on this? -- ___ Python tracker ___

[issue32147] improve performance of binascii.unhexlify() by using conversion table

2017-12-17 Thread Meador Inge
Meador Inge added the comment: FWIW, I see a win on OS X 10.12.6: λ:[master !?](~/Code/src/python/cpython)=> cc --version Apple LLVM version 8.1.0 (clang-802.0.42) Target: x86_64-apple-darwin16.7.0 Thread model: posix InstalledDir:

[issue32353] Add docs about Embedding with an frozen module limitation.

2017-12-17 Thread Decorater
New submission from Decorater : It seems that 1 thing that bites me is that there is no section on the embedding docs about limitations to using frozen modules in them. So lets say for example your program has this like in the main function on an embedded python: ```c

[issue32353] Add docs about Embedding with an frozen module limitation.

2017-12-17 Thread Decorater
Change by Decorater : -- keywords: +patch pull_requests: +4804 stage: -> patch review ___ Python tracker ___

[issue32259] Misleading "not iterable" Error Message when generator return a "simple" type, and a tuple is expected

2017-12-17 Thread Terry J. Reedy
Terry J. Reedy added the comment: Thanks, Serhiy, for the C implementation, and Eric for reviewing it. I would add 'non-iterable', to get "cannot unpack non-iterable int object", to tell people what is needed instead. I do think this worthwhile. --

[issue32248] Port importlib_resources (module and ABC) to Python 3.7

2017-12-17 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I have the tests and code ported, but there are still a few things to do, but here's a question: We're using type annotations in importlib_resources, which of course is the right decision. But I think we still have a moratorium on typing

[issue32264] move pygetopt.h into internal/

2017-12-17 Thread Benjamin Peterson
Benjamin Peterson added the comment: New changeset 4c72bc4a38eced10a55ba7071e084b26a2b5ed4b by Benjamin Peterson in branch 'master': add 'extern' to pygetopt.h symbols, so then don't end up in comdat (#4909)

[issue32349] Add detailed return value information for set.intersection function

2017-12-17 Thread Mark Dickinson
Mark Dickinson added the comment: To clarify, are you referring to this behaviour? >>> a = {1, 2, 3} >>> b = {1.0, 4.0} >>> a.intersection(b) # expect {1} {1.0} I'd personally expect this to be implementation-dependent: since for set operations you usually only care

[issue32264] move pygetopt.h into internal/

2017-12-17 Thread Benjamin Peterson
Change by Benjamin Peterson : -- pull_requests: +4803 ___ Python tracker ___ ___

[issue32264] move pygetopt.h into internal/

2017-12-17 Thread Benjamin Peterson
Benjamin Peterson added the comment: Thanks the report and debugging. You're exactly right—I forgot to add extern. -- ___ Python tracker

[issue32147] improve performance of binascii.unhexlify() by using conversion table

2017-12-17 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: Is there anything I can do to push this forward? BTW, Serhiy, what are your OS, compiler and CPU? -- ___ Python tracker

[issue32259] Misleading "not iterable" Error Message when generator return a "simple" type, and a tuple is expected

2017-12-17 Thread Eric V. Smith
Eric V. Smith added the comment: The PR looks okay to me. I'm also not sure it's worth the change, though. -- ___ Python tracker

[issue32351] Use fastpath in asyncio.sleep if delay<0

2017-12-17 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> performance ___ Python tracker

[issue32351] Use fastpath in asyncio.sleep if delay<0

2017-12-17 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 5382c05021026fe623def829d121f5f6af4909fb by Andrew Svetlov in branch 'master': bpo-32351: Use fastpath in asyncio.sleep if delay<0 (#4908)

[issue32352] `inspect.getfullargspec` doesn't work fine for some builtin callable objects

2017-12-17 Thread thautwarm
New submission from thautwarm : It's quite confusing to me that `inspect.getfullargspec` crashed when it was applied on some builtin callable objects. ``` for each in __builtin__.__dict__: try: obj = getattr(__builtin__, each) if not callable(obj):

[issue32351] Use fastpath in asyncio.sleep if delay<0

2017-12-17 Thread Andrew Svetlov
Change by Andrew Svetlov : -- keywords: +patch pull_requests: +4802 stage: -> patch review ___ Python tracker ___

[issue32351] Use fastpath in asyncio.sleep if delay<0

2017-12-17 Thread Andrew Svetlov
New submission from Andrew Svetlov : Currently asyncio.sleep schedules a callback execution by `loop.call_later()` call, which has the same behavior but 2x slower. -- components: Library (Lib), asyncio messages: 308487 nosy: asvetlov, yselivanov priority:

[issue32350] pip can't handle MSVC warnings containing special characters

2017-12-17 Thread Paul Moore
Paul Moore added the comment: This is a pip issue, not a Python issue. It's a known issue in the current version of pip, and should be fixed in the development version (via pull request https://github.com/pypa/pip/pull/4486). If you like, you can try the development

[issue32350] pip can't handle MSVC warnings containing special characters

2017-12-17 Thread Cutter
New submission from Cutter : When trying to install pylint using pip on Windows 10, the installation of wrapt (a dependency of pylint) fails because a special character in an MSVC warning can't be decoded to utf-8. Below is the relevant part of the console output: ---