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

https://bugs.chromium.org/p/chromium/issues/detail?id=195550

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

--
nosy: +martin.panter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
  
fp.write(chunk)
TypeError: a bytes-like object is required, not 'str'
```

This may not a bug. But it should mention at docs 
https://docs.python.org/3/library/json.html#json.dump

--
components: Library (Lib)
messages: 308517
nosy: qingyunha
priority: normal
severity: normal
status: open
title: json.dump: fp must be a text file object
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 Cython), as it uses `isinstance(obj, 
collections.abc.Coroutine)` call.  This makes 
'loop.create_task(cython_coroutine)' 20% slower than 
'loop.create_task(python_coroutine)'.

The PR adds a positive type cache to the iscoroutine() function and to the 
asyncio.Task C implementation.  Both caches make 'loop.create_task()' equally 
fast for all kinds of coroutines.

--
components: asyncio
messages: 308515
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Optimize asyncio.iscoroutine() for non-native coroutines
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 use 
uvloop - another 10-20%.

If it's still slower than asynq, then the issue must be in how asynq schedules 
its callbacks, it might be more optimal for some specific use cases than 
asyncio.

FWIW I don't expect asynq to be any faster than asyncio (or than uvloop) for 
network IO.  And there's definitely no problem with async/await performance -- 
we're optimizing asyncio here, not the interpreter.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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)
https://github.com/python/cpython/commit/902ab80b590e474bb2077b1fae8aac497b856d66


--
nosy: +yselivanov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 “up” to 2017-12-18 00:00.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 transport.pause_reading()/resume_reading() idempotent; add 
transport.is_reading()

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32355] Optimize asyncio.gather()

2017-12-17 Thread Yury Selivanov

Change by Yury Selivanov :


--
keywords: +patch
pull_requests: +4807
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 makes asyncio.gather 10-15% faster on the attached benchmark.

--
assignee: yselivanov
components: asyncio
files: t.py
messages: 308508
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Optimize asyncio.gather()
type: performance
versions: Python 3.7
Added file: https://bugs.python.org/file47336/t.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

What is unclear, is if there is an intention to replace these (wrappers for 
'_PyUnicode_ToLowerFull' for eg).

Or if this will be removed without any alternative.

I assume the functionality will be kept somewhere since Python needs 
str.lower/upper.

Will there be a way to perform this in the future? Either way, could docs be 
updated to reflect this?

--
components: Unicode
messages: 308506
nosy: ezio.melotti, ideasman42, vstinner
priority: normal
severity: normal
status: open
title: Unclear intention of deprecating Py_UNICODE_TOLOWER / Py_UNICODE_TOUPPER
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

time.fromisoformat("23:59:59.995")

Perhaps it is better to always truncate to zero, only support 6 digits 
(rejecting fractions of a microsecond), or add Anders’s 
truncate_microseconds=True option.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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)
https://github.com/python/cpython/commit/1b7c11ff0ee3efafbf5b38c3c6f37de5d63efb81


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
λ:[master !?](~/Code/src/python/cpython)=> uname -a
Darwin ripley.attlocal.net 16.7.0 Darwin Kernel Version 16.7.0: Wed Oct  4 
00:17:00 PDT 2017; root:xnu-3789.71.6~1/RELEASE_X86_64 x86_64

- Before:
λ:[master ?](~/Code/src/python/cpython)=> ./python.exe -m timeit -s "from 
binascii import unhexlify; b = b'aa'*2**20" "unhexlify(b)"
20 loops, best of 5: 11.3 msec per loop

- After:
λ:[master !?](~/Code/src/python/cpython)=> ./python.exe -m timeit -s "from 
binascii import unhexlify; b = b'aa'*2**20" "unhexlify(b)"
50 loops, best of 5: 4.15 msec per loop

--
nosy: +meador.inge

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
  PyRun_SimpleString("import mymodule");
```

And lets say ``mymodule`` is supposed to be an frozen module in that embedded 
interpreter named ``myprogram``

It would fail to work because it wont be able to find ``mymodule`` when it 
really should. This doc change should help fix that senerio and hopefully 
suggest an fix to that senerio as well.

--
assignee: docs@python
components: Documentation
messages: 308497
nosy: Decorater, docs@python
priority: normal
severity: normal
status: open
title: Add docs about Embedding with an frozen module limitation.
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 in the 
stdlib.  So do we want to remove the types from importlib.resources?

Doing so could make for more work as we continue to track importlib_resource, 
so I'm inclined not to remove them.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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)
https://github.com/python/cpython/commit/4c72bc4a38eced10a55ba7071e084b26a2b5ed4b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 about objects up to equality, it would be a 
bit unusual to care whether you get {1} or {1.0} in the above situation, and 
I'd say the implementation should be free to do whatever's convenient. Making 
documented guarantees would unnecessarily constrain other implementations.

I suppose one could document the *lack* of a guarantee here ...

--
nosy: +mark.dickinson, rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32264] move pygetopt.h into internal/

2017-12-17 Thread Benjamin Peterson

Change by Benjamin Peterson :


--
pull_requests: +4803

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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)
https://github.com/python/cpython/commit/5382c05021026fe623def829d121f5f6af4909fb


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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): 
continue
inspect.getfullargspec(obj)
except Exception as e:
print(each, e)
```

Here are the results:

```
__build_class__ unsupported callable
__import__ unsupported callable
dir unsupported callable
getattr unsupported callable
iter unsupported callable
max unsupported callable
min unsupported callable
next unsupported callable
print unsupported callable
round unsupported callable
vars unsupported callable
bool unsupported callable
bytearray unsupported callable
bytes unsupported callable
classmethod unsupported callable
complex unsupported callable
dict unsupported callable
enumerate unsupported callable
filter unsupported callable
float unsupported callable
frozenset unsupported callable
property unsupported callable
int unsupported callable
list unsupported callable
map unsupported callable
range unsupported callable
reversed unsupported callable
set unsupported callable
slice unsupported callable
staticmethod unsupported callable
str unsupported callable
super unsupported callable
tuple unsupported callable
type unsupported callable
zip unsupported callable
BaseException unsupported callable
Exception unsupported callable
TypeError unsupported callable
StopAsyncIteration unsupported callable
StopIteration unsupported callable
GeneratorExit unsupported callable
SystemExit unsupported callable
KeyboardInterrupt unsupported callable
ImportError unsupported callable
ModuleNotFoundError unsupported callable
OSError unsupported callable
EnvironmentError unsupported callable
IOError unsupported callable
WindowsError unsupported callable
EOFError unsupported callable
RuntimeError unsupported callable
RecursionError unsupported callable
NotImplementedError unsupported callable
NameError unsupported callable
UnboundLocalError unsupported callable
AttributeError unsupported callable
SyntaxError unsupported callable
IndentationError unsupported callable
TabError unsupported callable
LookupError unsupported callable
IndexError unsupported callable
KeyError unsupported callable
ValueError unsupported callable
UnicodeError unsupported callable
UnicodeEncodeError unsupported callable
UnicodeDecodeError unsupported callable
UnicodeTranslateError unsupported callable
AssertionError unsupported callable
ArithmeticError unsupported callable
FloatingPointError unsupported callable
OverflowError unsupported callable
ZeroDivisionError unsupported callable
SystemError unsupported callable
ReferenceError unsupported callable
BufferError unsupported callable
MemoryError unsupported callable
Warning unsupported callable
UserWarning unsupported callable
DeprecationWarning unsupported callable
PendingDeprecationWarning unsupported callable
SyntaxWarning unsupported callable
RuntimeWarning unsupported callable
FutureWarning unsupported callable
ImportWarning unsupported callable
UnicodeWarning unsupported callable
BytesWarning unsupported callable
ResourceWarning unsupported callable
ConnectionError unsupported callable
BlockingIOError unsupported callable
BrokenPipeError unsupported callable
ChildProcessError unsupported callable
ConnectionAbortedError unsupported callable
ConnectionRefusedError unsupported callable
ConnectionResetError unsupported callable
FileExistsError unsupported callable
FileNotFoundError unsupported callable
IsADirectoryError unsupported callable
NotADirectoryError unsupported callable
InterruptedError unsupported callable
PermissionError unsupported callable
ProcessLookupError unsupported callable
TimeoutError unsupported callable
```

--
components: Library (Lib)
messages: 308488
nosy: thautwarm
priority: normal
severity: normal
status: open
title: `inspect.getfullargspec` doesn't work fine for some builtin callable 
objects
type: behavior
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: normal
severity: normal
status: open
title: Use fastpath in asyncio.sleep if delay<0
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 version of pip. At the moment there is 
no planned date for the next release of pip, but we're hoping to put together a 
release in the not too distant future.

--
assignee:  -> paul.moore
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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:
---
Exception:
Traceback (most recent call last):
  File 
"C:\Users\(...)\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\compat\__init__.py",
 line 73, in console_to_str
return s.decode(sys.__stdout__.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 51: 
invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"C:\Users\(...)\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\basecommand.py",
 line 215, in main
status = self.run(options, args)
  File 
"C:\Users\(...)\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\commands\install.py",
 line 342, in run
prefix=options.prefix_path,
  File 
"C:\Users\(...)\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\req\req_set.py",
 line 784, in install
**kwargs
  File 
"C:\Users\(...)\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\req\req_install.py",
 line 878, in install
spinner=spinner,
  File 
"C:\Users\(...)\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\utils\__init__.py",
 line 676, in call_subprocess
line = console_to_str(proc.stdout.readline())
  File 
"C:\Users\(...)\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\compat\__init__.py",
 line 75, in console_to_str
return s.decode('utf_8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 51: 
invalid start byte
---

I changed line 73 in \pip\compat\__init__.py to: print("!! TEST !! : ", s). The 
full console output after that change is in the attachment. The relevant part 
is:

 !! TEST !! :  b'C:\\Program Files (x86)\\Microsoft Visual 
Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503\\bin\\HostX86\\x64\\cl.exe
 /c /nologo /Ox /W3 /GL /DNDEBUG /MD 
-IC:\\Users\\(...)\\AppData\\Local\\Programs\\Python\\Python36\\include 
-IC:\\Users\\(...)\\AppData\\Local\\Programs\\Python\\Python36\\include 
"-IC:\\Program Files (x86)\\Microsoft Visual 
Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503\\ATLMFC\\include" 
"-IC:\\Program Files (x86)\\Microsoft Visual 
Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503\\include" "-IC:\\Program 
Files (x86)\\Windows Kits\\10\\include\\10.0.16299.0\\ucrt" "-IC:\\Program 
Files (x86)\\Windows Kits\\10\\include\\10.0.16299.0\\shared" "-IC:\\Program 
Files (x86)\\Windows Kits\\10\\include\\10.0.16299.0\\um" "-IC:\\Program Files 
(x86)\\Windows Kits\\10\\include\\10.0.16299.0\\winrt" /Tcsrc/wrapt/_wrappers.c 
/Fobuild\\temp.win-amd64-3.6\\Release\\src/wrapt/_wrappers.obj\r\n'
 !! TEST !! :  b'_wrappers.c\r\n'
 !! TEST !! :  b"src/wrapt/_wrappers.c(195): warning C4244: 'return'\xff: 
conversion de 'Py_hash_t' en 'long', perte possible de donn\x82es\r\n"
 error
 Exception:
 Traceback (most recent call last):
   File 
"C:\Users\(...)\AppData\Local\Programs\Python\Python36\Lib\site-packages\pip\compat\__init__.py",
 line 74, in console_to_str
 return s.decode(sys.__stdout__.encoding)
 UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 51: 
invalid start byte

As a workaround I've changed the original line 73 in \pip\compat\__init__.py :

return s.decode(sys.__stdout__.encoding)

to:

return s.decode(sys.__stdout__.encoding, "replace")

(thanks to dieter on comp.lang.python for his help). I don't have the knowledge 
to propose a patch.

--
components: Windows
files: console.txt
messages: 308485
nosy: Cutter, Marcus.Smith, dstufft, ncoghlan, paul.moore, steve.dower, 
tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: pip can't handle MSVC warnings containing special characters
type: crash
versions: Python 3.6
Added file: https://bugs.python.org/file47334/console.txt

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com