[issue32284] typing.TextIO and BinaryIO are not aliases of IO[...]

2017-12-13 Thread Andrew Svetlov

Change by Andrew Svetlov :


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



[issue32284] typing.TextIO and BinaryIO are not aliases of IO[...]

2017-12-13 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset b0358e8784821867ab05b3d890717c37309be849 by Andrew Svetlov (Miss 
Islington (bot)) in branch '3.6':
bpo-32284: Fix documentation of BinaryIO and TextIO (GH-4832) (#4833)
https://github.com/python/cpython/commit/b0358e8784821867ab05b3d890717c37309be849


--

___
Python tracker 

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



[issue32284] typing.TextIO and BinaryIO are not aliases of IO[...]

2017-12-13 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4725

___
Python tracker 

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



[issue32284] typing.TextIO and BinaryIO are not aliases of IO[...]

2017-12-13 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset c3e070f84931c847d1b35e7fb36aa71edd6215f6 by Andrew Svetlov 
(Sebastian Rittau) in branch 'master':
bpo-32284: Fix documentation of BinaryIO and TextIO (#4832)
https://github.com/python/cpython/commit/c3e070f84931c847d1b35e7fb36aa71edd6215f6


--
nosy: +asvetlov

___
Python tracker 

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



[issue32299] unittest.mock.patch.dict.__enter__ should return the dict

2017-12-13 Thread Vadim Tsander

Change by Vadim Tsander :


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

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-13 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 91106cd9ff2f321c0f60fbaa09fd46c80aa5c266 by Victor Stinner in 
branch 'master':
bpo-29240: PEP 540: Add a new UTF-8 Mode (#855)
https://github.com/python/cpython/commit/91106cd9ff2f321c0f60fbaa09fd46c80aa5c266


--

___
Python tracker 

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



[issue32284] typing.TextIO and BinaryIO are not aliases of IO[...]

2017-12-13 Thread Andrew Svetlov

Change by Andrew Svetlov :


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



[issue32284] typing.TextIO and BinaryIO are not aliases of IO[...]

2017-12-13 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Done

--

___
Python tracker 

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



[issue31643] test_uuid: test_getnode and test_windll_getnode fail if connected to the Internet via an Android phone

2017-12-13 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

> C:\> ipconfig -all

So the all-zero MAC address occurs on a Windows box and that explains the 
test_windll_getnode failure (this test is skipped on Android). I missed that 
point in your initial post and knowing what Android device you are using is 
irrelevant.

--

___
Python tracker 

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



[issue32301] Typo in array documentation

2017-12-13 Thread Maik Ro

New submission from Maik Ro :

.. class:: array(typecode[, initializer])

should be 

typecode, [initializer] - comma is in square brackets

--
assignee: docs@python
components: Documentation
messages: 308195
nosy: Maik Ro, docs@python
priority: normal
severity: normal
status: open
title: Typo in array documentation
type: enhancement

___
Python tracker 

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



[issue32301] Typo in array documentation

2017-12-13 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

The given version is correct: the comma is only required if the initializer is 
given. Your suggested version 

typecode, [initializer]

implies that the comma is always required whether the initializer is given or 
not.

If we want to be absolutely pedantic, we could write:

.. class:: array(typecode[, [initializer]])

as trailing commas are legal in function calls. But I don't think that makes 
for good documentation.

--
nosy: +steven.daprano
resolution:  -> rejected
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



[issue29465] Modify _PyObject_FastCall() to reduce stack consumption

2017-12-13 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests:  -25

___
Python tracker 

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



[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread Aaron Meurer

New submission from Aaron Meurer :

Take the following scenario which happened to me recently. I am trying to debug 
an issue on Travis CI involving environment variables. Basically, I am not sure 
if an environment variable is being set correctly. So in my code, I put

print(os.environ.keys())

The reason I put keys() was 1, I didn't care about the values, and 2, I have 
secure environment variables set on Travis. 

To my surprise, in the Travis logs, I found something like this

KeysView(environ({'TRAVIS_STACK_FEATURES': 'basic cassandra chromium couchdb 
disabled-ipv6 docker docker-compose elasticsearch firefox go-toolchain 
google-chrome jdk memcached mongodb mysql neo4j nodejs_interpreter 
perl_interpreter perlbrew phantomjs postgresql python_interpreter rabbitmq 
redis riak ruby_interpreter sqlite xserver', 'CI': 'true', ..., 'MANPATH': 
'/home/travis/.nvm/versions/node/v7.4.0/share/man:/home/travis/.kiex/elixirs/elixir-1.4.5/man:/home/travis/.rvm/rubies/ruby-2.4.1/share/man:/usr/local/man:/usr/local/clang-3.9.0/share/man:/usr/local/share/man:/usr/share/man:/home/travis/.rvm/man'}))

So instead of just printing the keys like I asked for, it printed the whole 
environment, plus "KeysView(environ(". Included here was my secure environment 
variable. 

Now, fortunately, Travis hides the contents of secure environment variables in 
the logs, but it didn't used to 
(https://blog.travis-ci.com/2017-05-08-security-advisory).

Aside from being a potential security issue, it's just annoying that it prints 
the whole environment. The values are much larger than the keys. With a normal 
dictionary, print(d.keys()) just prints the keys:

>>> print(dict(a=1, b=2).keys())
dict_keys(['a', 'b'])

--
messages: 308190
nosy: Aaron.Meurer
priority: normal
severity: normal
status: open
title: print(os.environ.keys()) should only print the keys
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



[issue32284] typing.TextIO and BinaryIO are not aliases of IO[...]

2017-12-13 Thread Sebastian Rittau

Change by Sebastian Rittau :


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

___
Python tracker 

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



[issue32292] Building fails on Windows

2017-12-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> It shouldn't be any different, but what about PCBuild/build.bat?

Yes, same thing.

--

___
Python tracker 

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



[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread R. David Murray

R. David Murray  added the comment:

This is a consequence of the repr used by KeysView, which it inherits from 
MappingView.  I agree that the result is surprising, but there may not be a 
generic fix.  It's not entirely clear what KeysView should do here, but 
presumably we could at least add a repr to environ's use of it that would 
produce something useful.

Note that a workaround when doing something like a travis debug is to print 
os.environ._data.keys(), which will print the bytes versions of the keys.  I 
wouldn't recommend depending on that continuing to, though ;)

--
nosy: +r.david.murray, rhettinger, vstinner -csabella
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



[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread R. David Murray

Change by R. David Murray :


--
nosy: +csabella

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-12-13 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Wow, 28 PRs for a single issue! This is a record.

--

___
Python tracker 

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



[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

For your current situation, list(os.environ) or iter(os.environ) both return 
keys only.

It looks like the __repr__ on the class for os.environ is printed for 
os.environ (which is expected).  For os.environ.keys(), the same __repr__ is 
wrapped as a KeysView, for os.environ.values(), it's wrapped as a ValuesView, 
and os.environ.items(), as an ItemsView.

In 2.7, os.environ.keys() print just keys.

--
nosy: +csabella
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



[issue31554] Warn when __loader__ != __spec__.loader

2017-12-13 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue21762] update the import machinery to only use __spec__

2017-12-13 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue32302] test_distutils: test_get_exe_bytes() failure on AppVeyor

2017-12-13 Thread STINNER Victor

New submission from STINNER Victor :

Example: https://ci.appveyor.com/project/python/cpython/build/3.7.0a0.9414

==
ERROR: test_get_exe_bytes 
(distutils.tests.test_bdist_wininst.BuildWinInstTestCase)
--
Traceback (most recent call last):
  File "C:\projects\cpython\lib\distutils\tests\test_bdist_wininst.py", line 
24, in test_get_exe_bytes
exe_file = cmd.get_exe_bytes()
  File "C:\projects\cpython\lib\distutils\command\bdist_wininst.py", line 361, 
in get_exe_bytes
f = open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 
'C:\\projects\\cpython\\lib\\distutils\\command\\wininst-14.12.exe'
--

--
components: Tests
messages: 308203
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_distutils: test_get_exe_bytes() failure on AppVeyor
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



[issue32317] sys.exc_clear() clears exception in other stack frames

2017-12-13 Thread Garrett Berg

New submission from Garrett Berg :

# Summary
In python (2 or 3) it should always be valid to have a bare *raise* statement 
in an exception block.

try:
do_something()
except SomeException:
do_cleanup()
raise # always reraises SomeException with original stack trace

You can see this in the python exception documentation:
https://docs.python.org/2.7/tutorial/errors.html#raising-exceptions


# Reproduction of Failure of invariants
Example python file where this doesn't work:

from __future__ import print_function

import sys

def doclear():
"""This should basically be a noop"""
sys.exc_clear()

try:
1/0
except ZeroDivisionError:
exc = sys.exc_info()[0]
print("first exc:", exc)
assert exc is ZeroDivisionError

try:
1/0
except ZeroDivisionError:
exc = sys.exc_info()[0]
print("second exc (before doclear):", exc)
doclear()
exc = sys.exc_info()[0]
print("second exc (after  doclear):", exc)
assert sys.exc_info()[0] is ZeroDivisionError  # fails


Running in python2.7 gives:

first exc: 
second exc (before doclear): 
second exc (after  doclear): None
Traceback (most recent call last):
  File "doclear.py", line 23, in 
assert sys.exc_info()[0] is ZeroDivisionError  # fails
AssertionError


# Conclusion
There seems to be a bug in python 2.7 where it doesn't follow it's own spec.
[sys.exc_clear()](https://docs.python.org/2/library/sys.html#sys.exc_clear)
states:

> This function clears all information relating to the current or last
> exception that occurred in the current thread. After calling this function,
> exc_info() will return three None values until another exception is raised in
> the current thread or *the execution stack returns to a frame where another
> exception is being handled*.

The above code is clear example where sys.exc_clear() is changing the value of
sys.exc_info() *in a different stack frame*, which is against what is stated in
the above docs.

This bug makes it impossible to reraise with a bare raise statement when doing
cleanup that could use sys.exc_clear(). In other words, calling into functions
can *change your local state* with regards to what exception is being handled.

--
components: Interpreter Core
messages: 308264
nosy: Garrett Berg
priority: normal
severity: normal
status: open
title: sys.exc_clear() clears exception in other stack frames
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

shelve.Shelf is the example of such kind.

--

___
Python tracker 

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



[issue32318] Remove "globals()" call from "socket.accept()"

2017-12-13 Thread Yury Selivanov

Change by Yury Selivanov :


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

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2017-12-13 Thread Yury Selivanov

Yury Selivanov  added the comment:

> So first... that's not how nursery.start_soon works :-). It actually takes an 
> async function, not a coroutine object. [..]

Interesting, and I think I like it.  I definitely understand the motivation to 
not tell users the difference between coroutine functions and coroutine 
objects, but yeah, the ship has sailed for asyncio/curio/twisted.

Anyways, I'm not saying we shouldn't implement your proposal, even if it is 
only going to be used by Trio.  I'm saying that we need to consider all 
alternatives, and for that, I'd like to see what happens if we implement a 
tiny coro wrapper in Trio.  Maybe the runtime overhead of it will be 
negligible.

--

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2017-12-13 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

> In any case, in my opinion, it doesn't matter.  `sys.set_coroutine_wrapper` 
> controls a single thread-local setting, 
> `sys.set_unawaited_coroutine_tracking` *also* controls a single thread-local 
> setting.  Both of them have the exact same problem when there's more than one 
> user of the API.  So we can't consider this as a strong argument in favour of 
> the 'set_unawaited_coroutine_tracking' API.
[...]
> With that all in mind, my question is: have you guys tried to write a wrapper 
> object in C for coroutines (or you can use Cython to get an idea)?

This is a fair point; we probably should try that :-).

I do think that there's more of a difference than you're realizing between 
set_coroutine_wrapper and set_unawaited_coroutine_tracking WRT their behavior 
around conflicts.

For set_unawaited_coroutine_tracking, the whole idea that makes it useful is if 
you have a single central piece of code that has a global view of what your 
program is doing, and can use that to figure out specific points where there 
should be no unawaited coroutines, plus has some strategy for reporting errors. 
For pytest-asyncio, it wants to check for these at the end of each test and 
then if found, fail that test. (Oh, I should mention that I did actually talk 
to the pytest-asyncio author about this and they do want to use it, this isn't 
hypothetical :-).) For trio, we have a more subtle rule like "check at each 
schedule point or catch-all exception handler, UNLESS it is in a task that is 
hosting asyncio code through our translation layer", and the reporting is more 
complicated too. But the point I want to make is that here, it's simpliy 
intrinsic in the design that whatever system is doing this has to have some 
pretty solid global knowledge, and it doesn't make sense to have two o
 f these at once; no matter how we implemented this, two libraries trying to 
use it at the same time would necessarily need to coordinate somehow.

OTOH, for set_coroutine_wrapper, it's such a catch-all that it is plausible to 
have two different libraries that both want to use it at the same time, for two 
things that in principle don't conflict at all.

And not only is this plausible, it's what actually happens :-). If everyone 
uses set_coroutine_wrapper, then pytest-asyncio and asyncio will actually 
collide, and trio and asyncio will actually collide. But if we have 
set_unawaited_coroutine_tracking + set_coroutine_wrapper, then that's enough to 
prevent all the actual collisions we know about.

--

___
Python tracker 

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



[issue32228] truncate() changes current stream position

2017-12-13 Thread Nitish

Change by Nitish :


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

___
Python tracker 

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



[issue32318] Remove "globals()" call from "socket.accept()"

2017-12-13 Thread STINNER Victor

STINNER Victor  added the comment:

IMHO we should add a private mask constant, see:
https://github.com/python/cpython/pull/4231#issuecomment-351622381

--

___
Python tracker 

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



[issue32318] Remove "globals()" call from "socket.accept()"

2017-12-13 Thread Yury Selivanov

Change by Yury Selivanov :


--
nosy: yselivanov
priority: normal
severity: normal
status: open
title: Remove "globals()" call from "socket.accept()"

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2017-12-13 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

> 1. How will trio handle situations like:
> 
> c = coro()
> await ...
> nursery.start_soon(c)
> 
> ?
[...]
> Maybe creating a coroutine and not immediately passing it to 'start_soon' or 
> similar API is an anti-pattern in Trio, but it is an OK thing to do in 
> asyncio/curio/twisted.

Yeah, for sure. This is sort of core to the overall motivation, so probably a 
good idea to make sure we're on the same page.

So first... that's not how nursery.start_soon works :-). It actually takes an 
async function, not a coroutine object. In fact, if you try doing 
'nursery.start_soon(c)' in trio v0.2.0, you get this error message (code I ran: 
https://gist.github.com/njsmith/87687ba5de1aeb5aa92336bd31891751):

> TypeError: trio was expecting an async function, but instead it got a 
> coroutine object 
> 
> Probably you did something like:
> 
>   trio.run(coro(...))# incorrect!
>   nursery.start_soon(coro(...))  # incorrect!
> 
> Instead, you want (notice the parentheses!):
> 
>   trio.run(coro, ...)# correct!
>   nursery.start_soon(coro, ...)  # correct!

(The 'coro' in my paste above isn't a placeholder, it's the actual name of your 
example async function that trio has interpolated into the error message, 
because I am a dorky perfectionist.)

There's a broader point here beyond showing off my dorkiness.

Trio is very careful to make sure that users don't need to know about the 
existence of coroutine objects *at all*. This is a *huge* win for teaching and 
understanding: I just tell people "async functions are a special class of 
functions; they're defined like 'async def func(): ...', and called like 'await 
func()', and btw you can only use 'await func()' inside an async function." and 
that is literally everything you need to know about async/await to use trio. I 
never use the word coroutine. It's way simpler, with no loss in expressivity, 
and part of why I can teach all of trio in a 30 minute talk and people are like 
"okay cool I know how to write concurrent programs now, why do people make such 
a big deal about it?".

Buuut... that's the happy path. What happens when people make minor syntax 
mistakes? Sometimes, we can catch it -- like the example above, when they 
accidentally write 'nursery.start_soon(func())' -- and give a nice helpful 
message to tell them what to fix, and it's fine. But unawaited coroutines are a 
problem: most people are going to forget an 'await' sooner or later. And when 
the happens, then you get messages like "coroutine was never awaited" or 
"coroutine object has no attribute '...'" which are completely incomprehensible 
if you don't know that there are such things as coroutine objects. (And never 
mind the cases where you don't get an error/warning at all!) So then my users 
are forced to learn a bunch of new concepts and async/await implementation 
details, *just* to understand this one error case.

So basically yeah, I am totally happy to prohibit 'c = coro(); await sleep(0); 
await c' because it's actually the key thing that makes the whole system 
simpler.

Of course the problem is how to do this in a way that works for both trio and 
asyncio :-).

--

___
Python tracker 

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



[issue32318] Remove "globals()" call from "socket.accept()"

2017-12-13 Thread Yury Selivanov

New submission from Yury Selivanov :

socket.accept currently has this code:

type = self.type & ~globals().get("SOCK_NONBLOCK", 0)

which I believe is (a) bad Python style; (b) slows things down.

--
components: +Library (Lib)
nosy: +asvetlov, vstinner
type:  -> enhancement
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



[issue32317] sys.exc_clear() clears exception in other stack frames

2017-12-13 Thread Garrett Berg

Garrett Berg  added the comment:

I found a workaround, and probably the reason this has not been detected before:

import sys

def doclear2()
try:
1/0
except ZeroDivisionError:
sys.exc_clear()

try:
1/0
except ZeroDivisionError:
exc = sys.exc_info()[0]
print("third exc (before doclear):", exc)
doclear2()
exc = sys.exc_info()[0]
print("third exc (after  doclear):", exc)
assert sys.exc_info()[0] is ZeroDivisionError

The above passes. It seems that being inside a local exception block allows for 
the spec to hold, only the "local exception" is cleared.

I still think this is a pretty major bug, but it is good to know what the 
workaround/reason it's "been working" is.

--

___
Python tracker 

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



[issue30241] Add contextlib.AbstractAsyncContextManager

2017-12-13 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset 176baa326be4ec2dc70ca0c054b7e2ab7ca6a9cf by Yury Selivanov (Jelle 
Zijlstra) in branch 'master':
bpo-30241: implement contextlib.AbstractAsyncContextManager (#1412)
https://github.com/python/cpython/commit/176baa326be4ec2dc70ca0c054b7e2ab7ca6a9cf


--

___
Python tracker 

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



[issue30241] Add contextlib.AbstractAsyncContextManager

2017-12-13 Thread Yury Selivanov

Change by Yury Selivanov :


--
resolution:  -> fixed
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



[issue32030] PEP 432: Rewrite Py_Main()

2017-12-13 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset b5fd9ad05e0f15f8272b8f1b829af22077230584 by Victor Stinner in 
branch 'master':
bpo-32030: Rewrite _PyMainInterpreterConfig (#4854)
https://github.com/python/cpython/commit/b5fd9ad05e0f15f8272b8f1b829af22077230584


--

___
Python tracker 

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



[issue32317] sys.exc_clear() clears exception in other stack frames

2017-12-13 Thread Garrett Berg

Garrett Berg  added the comment:

I forgot to post this:

python --version



Python 2.7.14

--

___
Python tracker 

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



[issue32298] Email.quopriprime over-encodes characters

2017-12-13 Thread Geoff Kuenning

Geoff Kuenning  added the comment:

I should have read that part of RFC 2047 before I submitted.

I'd love to claim that I'm going to write a patch that would do as you suggest. 
 But the reality is that I'm unlikely to find the time, so I'm going to be wise 
for once and avoid promising what I can't deliver.

--

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-12-13 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4744

___
Python tracker 

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



[issue29877] compileall hangs when accessing urandom even if number of workers is 1

2017-12-13 Thread Dustin Spicuzza

Change by Dustin Spicuzza :


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

___
Python tracker 

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



[issue32316] [3.6] make regen-all fails on Travis CI on "python3.6" command

2017-12-13 Thread STINNER Victor

Change by STINNER Victor :


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



[issue32316] [3.6] make regen-all fails on Travis CI on "python3.6" command

2017-12-13 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 1d2a387b9526ef5f4d694734d8022e739f7fd410 by Victor Stinner in 
branch '3.6':
bpo-32316: Travis CI: use PYTHON_FOR_REGEN=python3 (#4853)
https://github.com/python/cpython/commit/1d2a387b9526ef5f4d694734d8022e739f7fd410


--

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-12-13 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4743

___
Python tracker 

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



[issue32303] Namespace packages have inconsistent __loader__ and __spec__.loader

2017-12-13 Thread Barry A. Warsaw

New submission from Barry A. Warsaw :

Let's say I have a namespace package:

>>> importlib_resources.tests.data03.namespace


This package has a non-None __loader__ but a None __spec__.loader:

>>> importlib_resources.tests.data03.namespace.__loader__
<_frozen_importlib_external._NamespaceLoader object at 0x1043c1588>
>>> importlib_resources.tests.data03.namespace.__spec__.loader
>>> 

That seems inconsistent and broken.  I suspect it's just an oversight that the 
__spec__.loader for a namespace package isn't getting set.  It's probably been 
this way forever.

See also Issue31554

--
messages: 308204
nosy: barry
priority: normal
severity: normal
status: open
title: Namespace packages have inconsistent __loader__ and __spec__.loader
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-13 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset d5dda98fa80405db82e2eb36ac48671b4c8c0983 by Victor Stinner in 
branch 'master':
pymain_set_sys_argv() now copies argv (#4838)
https://github.com/python/cpython/commit/d5dda98fa80405db82e2eb36ac48671b4c8c0983


--

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-12-13 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset d5dda98fa80405db82e2eb36ac48671b4c8c0983 by Victor Stinner in 
branch 'master':
pymain_set_sys_argv() now copies argv (#4838)
https://github.com/python/cpython/commit/d5dda98fa80405db82e2eb36ac48671b4c8c0983


--

___
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-13 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4729

___
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-13 Thread Mathieu Dupuy

Mathieu Dupuy  added the comment:

I finally released my work. It looks like Paul's work is more comprehensive, 
but if you want to pick one thing or two in mine, feel free.

--

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-13 Thread STINNER Victor

STINNER Victor  added the comment:

test_readline failed. It seems to be related to my commit:

http://buildbot.python.org/all/#/builders/87/builds/360

==
FAIL: test_nonascii (test.test_readline.TestReadline)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_readline.py",
 line 219, in test_nonascii
self.assertIn(b"text 't\\xeb'\r\n", output)
AssertionError: b"text 't\\xeb'\r\n" not found in 
bytearray(b"^A^B^B^B^B^B^B^B\t\tx\t\r\n[\\303\\257nserted]|t\x07\x08\x08\x08\x08\x08\x08\x08\x07\x07xrted]|t\x08\x08\x08\x08\x08\x08\x08\x07\r\nresult
 \'[\\xefnsexrted]|t\'\r\nhistory \'[\\xefnsexrted]|t\'\r\n")

--

___
Python tracker 

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



[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread STINNER Victor

STINNER Victor  added the comment:

Usually, I use print(sorted(os.environ)) since I prefer a sorted list and it 
prevents such issue :-)

David:
> I agree that the result is surprising, but there may not be a generic fix.

What about something like:

vstinner@apu$ ./python -c 'import os; print(os.environ.keys())'


vstinner@apu$ git diff
diff --git a/Lib/_collections_abc.py b/Lib/_collections_abc.py
index a5c7bfcda1..5e524dffbf 100644
--- a/Lib/_collections_abc.py
+++ b/Lib/_collections_abc.py
@@ -719,6 +719,9 @@ class KeysView(MappingView, Set):
 def __iter__(self):
 yield from self._mapping
 
+def __repr__(self):
+return '' % list(self)
+
 KeysView.register(dict_keys)
 
 

list(key_view) is valid. I mimicked dict views implementation:

static PyObject *
dictview_repr(_PyDictViewObject *dv)
{
PyObject *seq;
PyObject *result;

seq = PySequence_List((PyObject *)dv);
if (seq == NULL)
return NULL;

result = PyUnicode_FromFormat("%s(%R)", Py_TYPE(dv)->tp_name, seq);
Py_DECREF(seq);
return result;
}

--

___
Python tracker 

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



[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread STINNER Victor

STINNER Victor  added the comment:

If we decide to change abc.KeysView.__repr__, IMHO we should also modify 
abc.ValuesView.__repr__, and maybe also abc.ItemsView.__repr__.

--

___
Python tracker 

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



[issue32004] Allow specifying code packing order in audioop adpcm functions

2017-12-13 Thread MosesofEgypt

MosesofEgypt  added the comment:

Added serhiy.storchaka to nosy list as the issue has been open for over a month 
without response(not sure if I should have done this in the first place).

--
nosy: +serhiy.storchaka
versions: +Python 2.7

___
Python tracker 

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



[issue32236] open() shouldn't silently ignore buffering=1 in binary mode

2017-12-13 Thread Alexey Izbyshev

Change by Alexey Izbyshev :


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

___
Python tracker 

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



[issue21332] subprocess bufsize=1 docs are misleading

2017-12-13 Thread Alexey Izbyshev

Change by Alexey Izbyshev :


--
pull_requests: +4732

___
Python tracker 

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



[issue32302] test_distutils: test_get_exe_bytes() failure on AppVeyor

2017-12-13 Thread Steve Dower

Steve Dower  added the comment:

This is the bit that needs fixing 
https://github.com/python/cpython/blob/master/Lib/distutils/command/bdist_wininst.py#L340

bv = '.'.join(CRT_ASSEMBLY_VERSION.split('.', 2)[:2])
if bv == '14.11':
# v141 and v140 are binary compatible,
# so keep using the 14.0 stub.
bv = '14.0'

AppVeyor has clearly gotten hold of 14.12, which should also be binary 
compatible (version numbers here are not strictly SemVer, but the 14 indicates 
binary compatibility).

--

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2017-12-13 Thread Yury Selivanov

Yury Selivanov  added the comment:

>   send_ping() # don't care about result, forgot await
>   # get collected
>   await something_that_will_trigger_check_coros_weakreaf() # oh no !

I don't understand what you are trying to say with this example.  What is 
"something_that_will_trigger_check_coros_weakreaf" supposed to do?

The point of my proposal that you will have a coroutine reported at the "get 
collected" point in CPython, or sometime later in PyPy.

> So if its weak-refd then you can't be sure you are actually preventing 
> non-awaited coros.

Sorry, I don't understand this sentence either.

--

___
Python tracker 

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



[issue32303] Namespace packages have inconsistent __loader__ and __spec__.loader

2017-12-13 Thread Eric V. Smith

Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue32305] Namespace packages have inconsistent __file__ and __spec__.origin

2017-12-13 Thread Eric V. Smith

Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue31554] Warn when __loader__ != __spec__.loader

2017-12-13 Thread Eric V. Smith

Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue32302] test_distutils: test_get_exe_bytes() failure on AppVeyor

2017-12-13 Thread Steve Dower

Steve Dower  added the comment:

I thought we'd special cased the v14 toolset already.

This should be an update to the Python code in distutils that selects the 
filename based on compiler version.

--

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2017-12-13 Thread Matthias Bussonnier

Matthias Bussonnier  added the comment:

Your last description is about exactly what 
https://github.com/python-trio/trio/pull/176 is about (which I need to resurect)

There are some issue with weakref some that I don't remember, but one of them 
is (IIRC): what if a non-awaited coro get collected before being awaited and 
check by trio ? 

   send_ping() # don't care about result, forgot await
   # get collected
   await something_that_will_trigger_check_coros_weakreaf() # oh no !

   
So if its weak-refd then you can't be sure you are actually preventing 
non-awaited coros.

By default in trio we also would like to enforce immediate coro awaiting, but 
we of course would provide a convenience function to wrap coroutines you really 
do not want to await now. (Explicit is better than implicit) So you would write:

c = coro()
really_not_awaiting_now_leave_me_alone(c)
await ... #
nursery.start_soon(c)

What above PR does is check each time you enter the trio scheduler whether 
there is unawaited Coros (not marked as really_no_not_awaiting_now), and if so, 
next time you restart this task (or enter an cancellation point.. but details) 
raise a NonAwaitedCoroutineError. It does not raise _exactly_ where it was not 
awaited but narrow down where the non-awaited coro is (between two schedule 
point). And _if_ you enable tracemalloc the error message give you where the 
stack trace that created this coro.

--

___
Python tracker 

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



[issue32307] Bad assumption on thread stack size makes python crash with musl libc

2017-12-13 Thread Natanael Copa

New submission from Natanael Copa :

Python assumes that the system default thread stack size is big enough for 
python, except for OSX and FreeBSD where stack size is explicitly set. With 
musl libc the system thread stack size is only 80k, which leads to hard crash 
before `sys.getrecursionlimit()` is hit.

See: https://github.com/python/cpython/blob/master/Python/thread_pthread.h#L22


Testcase:

import threading
import sys

def f(n=0):
try:
print(n)
f(n+1)
except Exception:
print("we hit recursion limit")
sys.exit(0)

t = threading.Thread(target=f)
t.start()


This can be pasted into:

  docker run --rm -it python:2.7-alpine
  docker run --rm -it python:3.6-alpine

--
components: Interpreter Core
messages: 308226
nosy: Natanael Copa
priority: normal
severity: normal
status: open
title: Bad assumption on thread stack size makes python crash with musl libc
type: crash
versions: Python 2.7, Python 3.6

___
Python tracker 

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



[issue10344] codecs.open() buffering doc needs fix

2017-12-13 Thread Alexey Izbyshev

Change by Alexey Izbyshev :


--
keywords: +patch
pull_requests: +4731
stage: needs patch -> patch review

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2017-12-13 Thread Yury Selivanov

Yury Selivanov  added the comment:

First, I've no questions about the proposed implementation.  It shouldn't have 
performance impact when unawaited coroutine tracking is off, which is the 
default.  It will cause minimal overhead when the tracking is on, which is 
fine.  Adding two extra pointers to coroutine objects should be OK too.

Back to the specification.  Few questions:

1. How will trio handle situations like:

c = coro()
await ...
nursery.start_soon(c)

?

There's a brief period of time when "c" is not being awaited, and thus it will 
be in the list that "sys.collect_unawaited_coroutines()" returns.  How exactly 
do you plan to use this new API in Trio?

Maybe creating a coroutine and not immediately passing it to 'start_soon' or 
similar API is an anti-pattern in Trio, but it is an OK thing to do in 
asyncio/curio/twisted.


2. What if another framework (say asyncio that you want to interoperate with) 
calls "sys.set_unawaited_coroutine_tracking(False)"?  

The API you propose has the *same* pitfall that 'sys.set_coroutine_wrapper()' 
has, when used by several frameworks simultaneously.


3. Given (2), why don't you have a coroutine wrapper like this:

   def trio_coroutine_wrapper(coro):
   ref = weakref.ref(coro, trio._untrack_coro)
   trio._track_coro(ref)
   return coro

This way:

- you don't introduce a lot of overhead, because there's no actual wrapper 
around a coroutine

- you can capture the file/lineno at the point where a coroutine was created, 
which is useful for reporting unawaited coroutines

--

___
Python tracker 

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



[issue32306] Clarify map API in concurrent.futures

2017-12-13 Thread David Lukeš

New submission from David Lukeš :

The docstring for `concurrent.futures.Executor.map` starts by stating that it 
is "Equivalent to map(func, *iterables)". In the case of Python 3, I would 
argue this is true only superficially: with `map`, the user expects 
memory-efficient processing, i.e. that the entire resulting collection will not 
be held in memory at once unless s/he requests so e.g. with `list(map(...))`. 
(In Python 2, the expectations are different of course.) On the other hand, 
while `Executor.map` superficially returns a generator, which seems to align 
with this expectation, what happens behind the scenes is that the call blocks 
until all results are computed and only then starts yielding them. In other 
words, they have to be stored in memory all at once at some point.

The lower-level multiprocessing module also describes 
`multiprocessing.pool.Pool.map` as "A parallel equivalent of the map() built-in 
function", but at least it immediately goes on to add that "It blocks until the 
result is ready.", which is a clear indication that all of the results will 
have to be stored somewhere before being yielded.

I can think of several ways the situation could be improved, listed here from 
most conservative to most progressive:

1. Add "It blocks until the result is ready." to the docstring of 
`Executor.map` as well, preferably somewhere at the beginning.
2. Reword the docstrings of both `Executor.map` and `Pool.map` so that they 
don't describe the functions as "equivalent" to built-in `map`, which raises 
the wrong expectations. ("Similar to map(...), but blocks until all results are 
collected and only then yields them.")
3. I would argue that the function that can be described as semantically 
equivalent to `map` is actually `Pool.imap`, which yields results as they're 
being computed. It would be really nice if this could be added to the 
higher-level `futures` API, along with `Pool.imap_unordered`. `Executor.map` 
simply doesn't work for very long streams of data.
4. Maybe instead of adding `imap` and `imap_unordered` methods to `Executor`, 
it would be a good idea to change the signature of `Executor.map(func, 
*iterables, timeout=None, chunksize=1)` to `Executor.map(func, *iterables, 
timeout=None, chunksize=1, block=True, ordered=True)`, in order to keep the API 
simple with good defaults while providing flexibility via keyword arguments.
5. I would go so far as to say that for me personally, the `block` argument to 
the version of `Executor.map` proposed in #4 above should be `False` by 
default, because that would make it behave most like built-in `map`, which is 
the least suprising behavior. But I've observed that for smaller work loads, 
`imap` tends to be slower than `map`, so I understand it might be a tradeoff 
between performance and semantics. Still, in a higher-level API meant for 
non-experts, I think semantics should be emphasized.

If the latter options seem much too radical, please consider at least something 
along the lines of #1 above, I think it would help people correct their 
expectations when they first encounter the API :)

--
components: Library (Lib)
messages: 308221
nosy: David Lukeš
priority: normal
severity: normal
status: open
title: Clarify map API in concurrent.futures
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread R. David Murray

R. David Murray  added the comment:

Agreed about the other classes if we change this.  Your solution looks 
reasonable to me.

--

___
Python tracker 

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



[issue32304] Upload failed (400): Digests do not match on .tar.gz ending with x0d binary code

2017-12-13 Thread Louis Lecaroz

New submission from Louis Lecaroz :

Hi,
.tar.gz files can end with x0d bytes or whatever you want

When running setup.py sdist upload, depending on the project, the .tar.gz file, 
as said can sometimes end with x0d. When doing the upload, the line 
https://github.com/python/cpython/blob/master/Lib/distutils/command/upload.py#L162
 (if value and value[-1:] == b'\r') will remove the ending char of the .tar.gz 
generating a 400 response error from the server like: 

Upload failed (400): Digests do not match, found: 
09f23b52764a6802a87dd753009c2d3d, expected: 972b8e9d3dc8cf6ba6b4b1ad5991f013
error: Upload failed (400): Digests do not match, found: 
09f23b52764a6802a87dd753009c2d3d, expected: 972b8e9d3dc8cf6ba6b4b1ad5991f013

As this line is generic & run on all key/values, I clearly understand that this 
check was initially written to eliminate certainly some issues on values in 
text format. 

But the mistake here, is that you are also changing the content of the 
'content' key which contains the .tar.gz as value, and because you remove the 
ending 0D, you change the .tar.gz content to be uploaded. As consequence, the 
server will return a 400 error about a wrong digest/crc.

I was able to make the code working with all .tar.gz files by changing this 
line to:

if value and value[-1:] == '\r' and not key=='content':

With a such fix, the .tar.gz content will not see its ending \r to be removed & 
the computed CRC from the server will be the same as computed by 
md5(content).hexdigest() in upload.py

--
components: Distutils
messages: 308205
nosy: dstufft, eric.araujo, llecaroz
priority: normal
severity: normal
status: open
title: Upload failed (400): Digests do not match on .tar.gz ending with x0d 
binary code
type: security
versions: Python 2.7, Python 3.5, 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



[issue32305] Namespace packages have inconsistent __file__ and __spec__.origin

2017-12-13 Thread Barry A. Warsaw

New submission from Barry A. Warsaw :

Along the lines of Issue32303 there's another inconsistency in namespace 
package metadata.  Let's say I have a namespace package:

>>> importlib_resources.tests.data03.namespace


The package has no __file__ attribute, and it has a misleading __spec__.origin

>>> importlib_resources.tests.data03.namespace.__spec__.origin
'namespace'
>>> importlib_resources.tests.data03.namespace.__file__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: module 'importlib_resources.tests.data03.namespace' has no 
attribute '__file__'

This is especially bad because the documentation for __spec__.origin implies a 
correlation to __file__, and says:

"Name of the place from which the module is loaded, e.g. “builtin” for built-in 
modules and the filename for modules loaded from source. Normally “origin” 
should be set, but it may be None (the default) which indicates it is 
unspecified."

I don't particularly like that its origin is "namespace".  That's an odd 
special case that's unhelpful to test against (what if you import a 
non-namespace package from the directory "namespace"?)

What would break if __spec__.origin were (missing? or) None?

--
messages: 308206
nosy: barry
priority: normal
severity: normal
status: open
title: Namespace packages have inconsistent __file__ and __spec__.origin
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue32302] test_distutils: test_get_exe_bytes() failure on AppVeyor

2017-12-13 Thread Zachary Ware

Change by Zachary Ware :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
priority: normal -> high
stage:  -> needs patch

___
Python tracker 

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



[issue32292] Building fails on Windows

2017-12-13 Thread Steve Dower

Steve Dower  added the comment:

Are you using a normal command prompt or the Visual Studio one? Totally clean 
environment should work fine these days, but I suspect there's an environment 
variable affecting something.

"set" to show everything that is set, remove any personal info and post or just 
email it to me if you'd like me to check.

--

___
Python tracker 

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



[issue32292] Building fails on Windows

2017-12-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

It's a normal command prompt.  Here is the output of "set":
https://gist.github.com/pitrou/2baf9950b0ab2f68b39b4973355b2e79

--

___
Python tracker 

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



[issue32302] test_distutils: test_get_exe_bytes() failure on AppVeyor

2017-12-13 Thread STINNER Victor

STINNER Victor  added the comment:

Extract of pythoninfo of the failed build:

os.environ[VS110COMNTOOLS]: C:\Program Files (x86)\Microsoft Visual Studio 
11.0\Common7\Tools\
os.environ[VS120COMNTOOLS]: C:\Program Files (x86)\Microsoft Visual Studio 
12.0\Common7\Tools\
os.environ[VS140COMNTOOLS]: C:\Program Files (x86)\Microsoft Visual Studio 
14.0\Common7\Tools\

The build starts with:

Using "C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe"  (found in the PATH)

--

___
Python tracker 

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



[issue32302] test_distutils: test_get_exe_bytes() failure on AppVeyor

2017-12-13 Thread STINNER Victor

STINNER Victor  added the comment:

Oh, and the PATH:

os.environ[PATH]: 
C:\Perl\site\bin;C:\Perl\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
 Files\7-Zip;C:\Tools\GitVersion;C:\Tools\NuGet;C:\Program Files\Microsoft\Web 
Platform Installer\;C:\Tools\PsTools;C:\Program Files\Git LFS;C:\Program 
Files\Mercurial\;C:\Program Files 
(x86)\Subversion\bin;C:\Tools\WebDriver;C:\Tools\Coverity\bin;C:\Tools\MSpec;C:\Tools\NUnit\bin;C:\Tools\NUnit3;C:\Tools\xUnit;C:\Program
 Files\nodejs;C:\Program Files (x86)\iojs;C:\Program 
Files\iojs;C:\Users\appveyor\AppData\Roaming\npm;C:\Program Files\Microsoft SQL 
Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client 
SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL 
Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL 
Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL 
Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL 
Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\1
 30\Tools\Binn\;C:\Program Files\Microsoft SQL 
Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL 
Server\130\DTS\Binn\;C:\Program Files\Microsoft SQL 
Server\130\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client 
SDK\ODBC\130\Tools\Binn\;C:\Ruby193\bin;C:\go\bin;C:\Program 
Files\Java\jdk1.8.0\bin;C:\Program Files 
(x86)\Apache\Maven\bin;C:\Python27;C:\Python27\Scripts;C:\Program 
Files\erl8.3\bin;C:\Program Files (x86)\CMake\bin;C:\Tools\curl\bin;C:\Program 
Files\LLVM\bin;C:\Users\appveyor\.dnx\bin;C:\Program Files\Microsoft 
DNX\Dnvm\;C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Community\MSBuild\15.0\Bin;C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Community\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\130;C:\Program 
Files\Amazon\AWSCLI\;C:\Program Files\dotnet\;C:\Tools\vcpkg;C:\Program Files 
(x86)\dotnet\;C:\Users\appveyor\AppData\Local\Microsoft\WindowsApps;C:\Users\appveyor\AppData\Local\Yarn\bin;C:\Users\appveyor\AppData\Roaming\npm;C:\Program
 Files\Docker
 ;C:\Program Files\Git\cmd;C:\Program Files\Microsoft Service 
Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service 
Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program 
Files\Git\usr\bin;C:\Program Files 
(x86)\Yarn\bin;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Microsoft 
SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL 
Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL 
Server\140\DTS\Binn\;C:\Program Files (x86)\nodejs\;C:\Program Files 
(x86)\Microsoft Visual 
Studio\2017\Community\Common7\IDE\Extensions\TestPlatform;C:\Users\appveyor\AppData\Local\Microsoft\WindowsApps;C:\Users\appveyor\AppData\Local\Yarn\bin;C:\Users\appveyor\AppData\Roaming\npm;C:\Program
 Files\AppVeyor\BuildAgent\

--

___
Python tracker 

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



[issue32302] test_distutils: test_get_exe_bytes() failure on AppVeyor

2017-12-13 Thread STINNER Victor

STINNER Victor  added the comment:

@Steve: do you want to work on a fix?

--

___
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-13 Thread INADA Naoki

INADA Naoki  added the comment:


New changeset 7ea143ae795a9fd57eaccf490d316bdc13ee9065 by INADA Naoki in branch 
'master':
bpo-29469: Move constant folding to AST optimizer (GH-2858)
https://github.com/python/cpython/commit/7ea143ae795a9fd57eaccf490d316bdc13ee9065


--

___
Python tracker 

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



[issue32319] re fullmatch error with non greedy modifier

2017-12-13 Thread Daniel Hrisca

New submission from Daniel Hrisca :

Consider this code snippet:


from re import match, fullmatch

pattern = '".+?"'
string = '"hello" "again"'

print(match(pattern, string))
print(fullmatch(pattern, string))


Which prints:
<_sre.SRE_Match object; span=(0, 7), match='"hello"'>
<_sre.SRE_Match object; span=(0, 15), match='"hello" "again"'>

The fullmatch function seems to ignore the non-greedy modifier.

>From the fullmatch docstring I expected that fullmatch is equivalent to:

def fullmatch(pattern, string):
match = re.match(pattern, string)
if match:
if match.start() == 0 and match.end() == len(string):
return match
else:
return None
else:
return None

--
components: Library (Lib)
messages: 308278
nosy: danielhrisca
priority: normal
severity: normal
status: open
title: re fullmatch error with non greedy modifier
type: behavior
versions: Python 3.4, Python 3.5, 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



[issue29469] AST-level Constant folding

2017-12-13 Thread INADA Naoki

Change by INADA Naoki :


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



[issue32104] add method throw() to asyncio.Task

2017-12-13 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

I think the ship has sailed.
Now too many code is based on assumption that the only way to cancel a task 
from outer code is `task.cancel()`. Internally it is turned into 

try:
   await do_stuff()
except asyncio.CancelledError:
   do_task_cancellation() 

Raising *any* exception for cancellation breaks all existing code like this. 
Moreover figuring out if a task was cancelled from outside (by timeout for 
example) or exception was raised by inner code becomes impossible.

I suggest closing the issue with "wont fix" resolution.

--
nosy: +asvetlov

___
Python tracker 

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



[issue17852] Built-in module _io can lose data from buffered files at exit

2017-12-13 Thread Neil Schemenauer

Change by Neil Schemenauer :


--
pull_requests: +4735
stage: needs patch -> patch review

___
Python tracker 

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



[issue32300] print(os.environ.keys()) should only print the keys

2017-12-13 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
components: +Library (Lib)
type:  -> behavior

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-12-13 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4728

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-13 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4727
stage:  -> patch review

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-12-13 Thread STINNER Victor

STINNER Victor  added the comment:

> Wow, 28 PRs for a single issue! This is a record.

You can expect much more :-) One of the goal of the PEP 432 is to put compute 
sys.path and put it in _PyMainInterpreterConfig. I'm trying to implement that, 
but we are still far from being able to do it. At least, we are getting closer 
at each commit.

While it might be possible to squash 28 changes into a single change, I 
wouldn't be able to review it (I review my own changes on GitHub :-)), and it 
would very annoying if it causes any regression :-(

--

___
Python tracker 

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



[issue32307] Bad assumption on thread stack size makes python crash with musl libc

2017-12-13 Thread R. David Murray

R. David Murray  added the comment:

Well, from our point of view it isn't a bad assumption, it's that muslc needs 
to be added to the list of exceptions.  (I know almost nothing about this...I 
assume there is some reason we can't determine the stack size programatically?)

Would you care to propose a PR?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-12-13 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4733

___
Python tracker 

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



[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2017-12-13 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

Currently re.sub() replaces empty matches only when not adjacent to a previous 
match. This makes it inconsistent with re.findall() and re.finditer() which 
finds empty matches adjacent to a previous non-empty match and with other RE 
engines.

Proposed PR makes all functions that makes repeated searching (re.split(), 
re.sub(), re.findall(), re.finditer()) mutually consistent.

The PR change the behavior of re.split() too, but this doesn't matter, since it 
already is different from the 3.6 behavior.

BDFL have approved this change.

This change doesn't break any stdlib code. It is expected that it will not 
break much third-party code, and even if it will break some code, it can be 
easily rewritten. For example replacing re.sub('(.*)', ...) (which now matches 
an empty string at the end of the string) with re.sub('(.+)', ...) is an 
obvious fix.

--
assignee: serhiy.storchaka
components: Library (Lib), Regular Expressions
messages: 308229
nosy: ezio.melotti, mrabarnett, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Replace empty matches adjacent to a previous non-empty match in re.sub()
type: enhancement
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



[issue17852] Built-in module _io can lose data from buffered files at exit

2017-12-13 Thread Neil Schemenauer

Neil Schemenauer  added the comment:

I created a new PR which uses the atexit module instead of using _Py_PyAtExit.  
I think registering in io.py is okay.

I see that atexit is now implemented in C.  Rather than registering in io.py, 
we could create a C API to register callbacks (i.e. atexit_register).  That 
would perhaps be a bit cleaner.

--

___
Python tracker 

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



[issue32236] open() shouldn't silently ignore buffering=1 in binary mode

2017-12-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

After looking at the PR, I think it would be a bit too strong to raise an 
error. Perhaps emit a warning instead?

--

___
Python tracker 

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




[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2017-12-13 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue32292] Building fails on Windows

2017-12-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, I've decided to bite the bullet.  I uninstalled VS 2015 and installed VS 
2017 Community Edition.  Things seem to work now.  Thanks for the help!

--
resolution:  -> fixed
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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2017-12-13 Thread Matthias Bussonnier

Matthias Bussonnier  added the comment:

Let me try to explain better, I'm pretty sure there is just a misunderstanding
from some of use in the vocabulary or presupposition we start from. I have the
impression that you feel like the API will automatically make coroutine raise
when they are not awaited, while I have the impression that in only provide a
tool for frameworks to detect unawaited coros and raise As soon as possible in
the right place.


We have the scheduler/eventloop that advance users tasks. Each time a user task
yield to the scheduler directly, or indirectly, the scheduler want to check that
since last time it was called in the same task no non-awaited coroutines are
pending, that is to say

await sleep(0) # yield to scheduler
c1 = coro() 
await c1

c2 = coro()

c3 = coro()
del c3
gc.collect()

await sleep(0) # yield again.


We want to make sure that between the two `sleep(0)` no coro is unawaited. Let's
assume `await coro()` does not itself yield to the scheduler for simplicity. In
above case you can see that c2 is not awaited, so according to Nathaniel
proposal, `sys.collect_unawaited_coroutines()` would returns `[c2, c3]`, So the
second sleep(0) can raise NonAwaitedCoroutineError, (and if tracemalloc is
enabled give more informations). 



You propose to use 
  weakref.ref(coro, trio._untrack_coro)

And I suppose you want us to do

  def _untrack_coro(self, ref):
  coro = ref()
  if inspect.getcoroutinestate(c) == 'CORO_STARTED'
.. do what's necessary for unawaited coroutine. 
  else:
# just discard from the tracked list.


Unfortunately:

> the weak reference object will be passed as the only parameter to the
> callback; *the referent will no longer be available*.

Thus we cannot check the state of the collected coroutine, according to my
understanding and experiments (Also we need to keep ref alive, but that's a
minor inconvenience). My guess is the referent is not around for users not to
suddenly add a ref to it...

So such a tracked list could only be use to know if coroutines where GC'd or
not.


If you are using wekrefs, you may also think about
`sys.collect_unawaited_coroutines()` returning weakref list, but that would lead
to `WeakRefList[c2]` because c3 was collected :-(. While we still raise because 
of
c2, a user logic only containing c3 would pass the "no unawaited coroutines".

To respond to your answer more specifically:

> 1. How will trio handle situations like:

>c = coro()
>await ...
>nursery.start_soon(c)


It depends what your `...` is, if its yielding to the trio scheduler, then the
scheduler will check unawaited coroutines, see that the list is non-empty and
raise a NonAwaitedCoroutineError at your `await ...`. In the case your `await
...` does not yield.. then nothing. 

> Maybe creating a coroutine and not immediately passing it to 'start_soon' or 
> similar API is an anti-pattern in Trio, but it is an OK thing to do in 
> asyncio/curio/twisted.

Yes, and the trio/curio/asyncio library is responsible to check
`sys.collect_unawaited_coroutines()`, and react appropriately. Trio will likely
decide to raise. Asyncio can just forget this option exists.

> 2. What if another framework (say asyncio that you want to interoperate with) 
> calls "sys.set_unawaited_coroutine_tracking(False)"?  

> The API you propose has the *same* pitfall that 'sys.set_coroutine_wrapper()' 
> has, when used by several frameworks simultaneously.

As far as I understand you'll need to yield back to the other framework at some
point. Then it's IMHO to the author to make sure to save the state of
`sys.collect_unawaited_coroutines()`, set
`sys.set_unawaited_coroutine_tracking(enabled: bool)` to what the other
framework expect, and  do the opposite when they get control back. 


> 3. Given (2), why don't you have a coroutine wrapper like this:

>  def trio_coroutine_wrapper(coro):
>  ref = weakref.ref(coro, trio._untrack_coro)
>  trio._track_coro(ref)
>  return coro

We can't use weakref (cf issue with c3/weakref above).


We could track all coroutines, with a normal container, which is exactly what we
do here[1], except now everytime you need to check
`inspect.getcoroutinestate(coro) == 'CORO_CREATED'` on every item. You can't
use weakref callback as you can't check the coro state in this case. The check
on all coro everytime does add potentially significant overhead, AND block the
GC of awaited couroutines in between checks. While we _do want_ to  block GC of
coroutine only if `sys.collect_unawaited_coroutines()` is set to true and
coroutine is not awaited.

Also we like to keep the actual non-awaited coro around for error messages, but
I guess we can do without. 

One alternative would be the ability to add a callback when coros change
states... But I though coroutines where one way to avoid callbacks...


Now you have way more understanding of core CPython than me, and I may 

[issue26259] Memleak when repeated calls to asyncio.queue.Queue.get is performed, without push to queue.

2017-12-13 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Duplicate of https://bugs.python.org/issue31620

--
nosy: +asvetlov
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> asyncio.Queue leaks memory if the queue is empty and consumers 
poll it frequently

___
Python tracker 

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



[issue32309] Implement asyncio.create_task() and asyncio.run_in_executor shortcuts

2017-12-13 Thread Andrew Svetlov

Change by Andrew Svetlov :


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

___
Python tracker 

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



[issue32310] Remove _Py_PyAtExit from Python.h

2017-12-13 Thread Neil Schemenauer

New submission from Neil Schemenauer :

_Py_PyAtExit only supports on callback function.  Its sole use it to be used by 
atexit.  IMHO, it should be removed from Python.h to prevent misuse.

--
components: Interpreter Core
messages: 308242
nosy: nascheme
priority: low
severity: normal
stage: patch review
status: open
title: Remove _Py_PyAtExit from Python.h
type: enhancement

___
Python tracker 

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



[issue32311] Implement asyncio.create_task() shortcut

2017-12-13 Thread Andrew Svetlov

Change by Andrew Svetlov :


--
components: Library (Lib), asyncio
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Implement asyncio.create_task() shortcut
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



[issue31620] asyncio.Queue leaks memory if the queue is empty and consumers poll it frequently

2017-12-13 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Sorry for late closing the issue, PR was merged a month ago.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue32302] test_distutils: test_get_exe_bytes() failure on AppVeyor

2017-12-13 Thread Steve Dower

Steve Dower  added the comment:

Happy for someone else to do it. I won't have time this week - too much going 
on at work.

--

___
Python tracker 

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



[issue32296] Implement asyncio._get_running_loop() and get_event_loop() in C

2017-12-13 Thread STINNER Victor

STINNER Victor  added the comment:

Hum, sometimes it's better to wait for AppVeyor :-) You broke all Windows 
buildbots! :-) Example:

http://buildbot.python.org/all/#/builders/40/builds/278

==
ERROR: test_get_event_loop_returns_running_loop 
(test.test_asyncio.test_events.TestCGetEventLoop)
--
Traceback (most recent call last):
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_asyncio\test_events.py",
 line 2738, in setUp
watcher = asyncio.SafeChildWatcher()
AttributeError: module 'asyncio' has no attribute 'SafeChildWatcher'
==
ERROR: test_get_event_loop_returns_running_loop 
(test.test_asyncio.test_events.TestPyGetEventLoop)
--
Traceback (most recent call last):
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_asyncio\test_events.py",
 line 2738, in setUp
watcher = asyncio.SafeChildWatcher()
AttributeError: module 'asyncio' has no attribute 'SafeChildWatcher'

--
nosy: +vstinner
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue32312] Create Py_AtExitRegister C API

2017-12-13 Thread STINNER Victor

STINNER Victor  added the comment:

See also:
[Python-Dev] PEP 489: module m_traverse called with NULL module state
https://mail.python.org/pipermail/python-dev/2017-December/151238.html

--

___
Python tracker 

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



[issue32312] Create Py_AtExitRegister C API

2017-12-13 Thread STINNER Victor

Change by STINNER Victor :


--
nosy: +pitrou, vstinner

___
Python tracker 

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



  1   2   >