[issue37676] cmath.phase array support

2019-07-24 Thread Hendrik


New submission from Hendrik :

It would be nice if cmath.phase supports arrays like this: 
```
import cmath
import numpy as np

z=255*np.ones((3,3)) * np.exp(1j * np.pi*np.ones((3,3)))

def get_k_amp_array(z):
return abs(z)

def get_k_ph_array(z):
return np.array([[cmath.phase(z_row) for z_row in z_col] for z_col in z ])

amp_array=  get_k_amp_array(z)
ph_array=   get_k_ph_array(z)

print(amp_array)
print(ph_array)
```

--
components: Library (Lib)
messages: 348428
nosy: kolibril13
priority: normal
severity: normal
status: open
title: cmath.phase array support
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



[issue37398] contextlib.ContextDecorator decorating async functions

2019-07-24 Thread Nathaniel Smith


Nathaniel Smith  added the comment:

There are two different axes of sync/async here, and it's important not to mix 
them up: the context manager could be sync or async, and the function that's 
being decorated could be sync or async. This issue is about the case where you 
have a sync context manager, and it's decorating an async function.

The current behavior is definitely super confusing and not at all useful.

In general, I'm also very skeptical about using iscoroutinefunction to 
automatically change semantics, because of the issue Andrew mentions about 
failing to handle complicated objects like functools.partial instances or sync 
functions that return awaitables. In this *specific* case though, I'm not 
sure... maybe it actually is OK?

What's special about this case is that when you write:

@sync_cm()
async def foo():
...

...the same person is writing both the @ line and the 'async def' line, and 
they're right next to each other in the source code. So the normal concern 
about some unexpected foreign object being passed in doesn't really apply. And 
in fact, if I did have an awaitable-returning-function:

@sync_cm()
def foo():
return some_async_fn()

...then I think most people would actually *expect* this to be equivalent to:

def foo():
with sync_cm():
return some_async_fn()

Not very useful, but not surprising either. So maybe this is the rare case 
where switching on iscoroutinefunction is actually OK? The only cases where it 
would fail is if someone invokes the decorator form directly, e.g.

new_fn = sync_cm()(old_fn)

This seems pretty rare, but probably someone does do it, so I dunno.

If we think that's too magic, another option would be to make up some more 
explicit syntax, like:

@sync_cm().wrap_async
async def foo(): ...

...Oh, but I think this breaks the Guido's gut feeling rule 
(https://mail.python.org/pipermail/python-dev/2004-August/046711.html), so it 
would have to instead be:

@sync_cm.wrap_async()
async def foo(): ...

And even if we decide not to automatically switch on iscoroutinefunction, we 
should probably add a warning or something at least, because right now

@sync_cm()
async def ...

is definitely a mistake.

(Adding Nick to nosy as the contextlib maintainer.)

--
nosy: +ncoghlan, njs

___
Python tracker 

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



[issue37398] contextlib.ContextDecorator decorating async functions

2019-07-24 Thread John Belmonte


John Belmonte  added the comment:

I was caught by this again, indirectly via @contextmanager.

If I define a non-async context manager using @contextmanager, I expect the 
decorator support to work on async functions.  I.e. the following should be 
equivalent:

```
async def foo():
with non_async_cm:
...
```
```
@non_async_cm
async def foo():
...
```

Not only does the 2nd case not work, but the decorator is (effectively) 
silently ignored :(

--

___
Python tracker 

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



[issue37340] remove free_list for bound method objects

2019-07-24 Thread Inada Naoki


Inada Naoki  added the comment:

Latest benchmark:

```
$ pyperf compare_to master.json no-freelist.json -G --min-speed=2
Slower (2):
- unpickle_list: 4.19 us +- 0.02 us -> 4.28 us +- 0.03 us: 1.02x slower (+2%)
- pathlib: 23.2 ms +- 0.2 ms -> 23.7 ms +- 0.3 ms: 1.02x slower (+2%)

Faster (2):
- nbody: 149 ms +- 2 ms -> 141 ms +- 2 ms: 1.06x faster (-6%)
- logging_simple: 10.1 us +- 0.2 us -> 9.86 us +- 0.18 us: 1.02x faster (-2%)

Benchmark hidden because not significant (56)
```

I decided to just remove the free_list.

--

___
Python tracker 

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



[issue36953] Remove collections ABCs?

2019-07-24 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
nosy: +yan12125

___
Python tracker 

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



[issue37324] collections: remove deprecated aliases to ABC classes

2019-07-24 Thread Chih-Hsuan Yen


Chih-Hsuan Yen  added the comment:

In CPython commit 5380def8269b24a8a3bc46396373a1dc91b1dd1a, bundled pip is 
updated to 19.2.1, and since pip 19.2 an html5lib patch is backported [1] to 
"prefer importing from collections.abc instead of collections" [2]. I believe 
https://github.com/python/cpython/pull/10596 can be revisited now.

[1] https://github.com/pypa/pip/commit/ef7ca1472c1fdd085cffb8183b7ce8abbe9e2800
[2] https://github.com/pypa/pip/commit/3d6bb3a29676f880e84014d98afcb5ac74a9844e

--
nosy: +yan12125

___
Python tracker 

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



[issue37670] Description of UserDict is misleading

2019-07-24 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The term "mapping" is in lowercase and refers to the generic concept of a 
mapping as defined in the glossary.  This is distinct from the capital letter 
classes "Mapping" and "MutableMapping" as provided in the collections.abc 
module.  It is the former meaning that is intended.

Thank you for the suggestion.

--
resolution:  -> not a bug
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



[issue37671] itertools.combinations could be lazier

2019-07-24 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thank you for the suggestion, but I'm going to decline for the reasons 
articulated in the link.

Consider posting you code to the Python package index where others can use if 
the need arises.

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



[issue37668] Allow individual test to be specified by "#" or "."

2019-07-24 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> I don't think this change should be made.

I recommend closing this request.

--
nosy: +rhettinger

___
Python tracker 

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



[issue37675] 2to3 doesn't work when run from a zipfile

2019-07-24 Thread miss-islington


miss-islington  added the comment:


New changeset 69802f6163c9f18ca0e0b9c4c43a49365fc63e2d by Miss Islington (bot) 
in branch '3.8':
closes bpo-37675: Use pkgutil.iter_modules to find fixers in a package rather 
than listdir. (14942)
https://github.com/python/cpython/commit/69802f6163c9f18ca0e0b9c4c43a49365fc63e2d


--

___
Python tracker 

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



[issue37675] 2to3 doesn't work when run from a zipfile

2019-07-24 Thread miss-islington


miss-islington  added the comment:


New changeset 53639dd55a0d5b3b7b4ef6ae839a98008f22e2d3 by Miss Islington (bot) 
in branch '2.7':
closes bpo-37675: Use pkgutil.iter_modules to find fixers in a package rather 
than listdir. (14942)
https://github.com/python/cpython/commit/53639dd55a0d5b3b7b4ef6ae839a98008f22e2d3


--

___
Python tracker 

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



[issue37675] 2to3 doesn't work when run from a zipfile

2019-07-24 Thread miss-islington


miss-islington  added the comment:


New changeset 9194a20a5b0b933a2a43ce0e81becbf8f0356314 by Miss Islington (bot) 
in branch '3.7':
closes bpo-37675: Use pkgutil.iter_modules to find fixers in a package rather 
than listdir. (14942)
https://github.com/python/cpython/commit/9194a20a5b0b933a2a43ce0e81becbf8f0356314


--
nosy: +miss-islington

___
Python tracker 

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



[issue37674] Is imp module deprecated or pending deprecation?

2019-07-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +brett.cannon, eric.snow, ncoghlan

___
Python tracker 

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



[issue36310] pygettext3.7 Does Not Recognize gettext Calls Within fstrings

2019-07-24 Thread Eric V. Smith


Eric V. Smith  added the comment:

I've put some more thought in to this, and this is the best I can come up with, 
using today's Python.

The basic idea is that you have a function _f(), which takes a normal (non-f) 
string. It does a lookup to find the translated string (again, a non-fstring), 
turns that into an f-string, then compiles it and returns the code object. Then 
the caller evals the returned code object to convert it to a string.

The ugly part, of course, is the eval. You can't just say:
_f("{val}")
you have to say:
eval(_f("{val}"))
You can't reduce this to a single function call: the eval() has to take place 
right here. It is possible to play games with stack frames, but that doesn't 
always work (see PEP 498 for details, where it talks about locals() and 
globals(), which is part of the same problem).

But I don't see much choice. Since a translated f-string can do anything (like 
f'{subprocess.run("script to rm all files")'), I'm not sure it's the eval 
that's the worst thing here. The translated text absolutely has to be trusted: 
that's the worst thing. Even an eval_fstring(), that only understood how to 
exec code objects that are f-strings, would still be exposed to arbitrary 
expressions and side effects in the translated strings.

The advantage of compiling it and caching is that you get most of the 
performance advantages of f-strings, after the first time a string is used. The 
code generation still has to happen, though. It's just the parsing that's being 
saved. I can't say how significant that is.

See the sample code in the attached file.

--
Added file: https://bugs.python.org/file48504/f-string-gettext.py

___
Python tracker 

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



[issue37675] 2to3 doesn't work when run from a zipfile

2019-07-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14717
pull_request: https://github.com/python/cpython/pull/14945

___
Python tracker 

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



[issue37675] 2to3 doesn't work when run from a zipfile

2019-07-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14715
pull_request: https://github.com/python/cpython/pull/14943

___
Python tracker 

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



[issue37675] 2to3 doesn't work when run from a zipfile

2019-07-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14716
pull_request: https://github.com/python/cpython/pull/14944

___
Python tracker 

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



[issue37675] 2to3 doesn't work when run from a zipfile

2019-07-24 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 93e8aa62cfd0a61efed4a61a2ffc2283ae986ef2 by Benjamin Peterson in 
branch 'master':
closes bpo-37675: Use pkgutil.iter_modules to find fixers in a package rather 
than listdir. (14942)
https://github.com/python/cpython/commit/93e8aa62cfd0a61efed4a61a2ffc2283ae986ef2


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



[issue30685] Multiprocessing Send to Manager Fails for Large Payload

2019-07-24 Thread Zackery Spytz


Zackery Spytz  added the comment:

It seems that this was fixed in bpo-17560.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue37668] Allow individual test to be specified by "#" or "."

2019-07-24 Thread Zackery Spytz


Zackery Spytz  added the comment:

I don't think this change should be made.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue37675] 2to3 doesn't work when run from a zipfile

2019-07-24 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
keywords: +patch
pull_requests: +14714
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14942

___
Python tracker 

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



[issue37675] 2to3 doesn't work when run from a zipfile

2019-07-24 Thread Benjamin Peterson


New submission from Benjamin Peterson :

get_all_fix_names does listdir() to find fixers. That breaks if the standard 
library is in a zipfile. It shouldn't be hard to replace this with 
pkgutil.iter_modules.

--
assignee: benjamin.peterson
components: 2to3 (2.x to 3.x conversion tool)
messages: 348413
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: 2to3 doesn't work when run from a zipfile
versions: Python 2.7, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue37672] Switch Windows Store package to use pip.ini for user mode

2019-07-24 Thread Steve Dower


Change by Steve Dower :


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



[issue37672] Switch Windows Store package to use pip.ini for user mode

2019-07-24 Thread miss-islington


miss-islington  added the comment:


New changeset 4b7ce105ff80467bf4d79c413d7adc256b824153 by Miss Islington (bot) 
in branch '3.8':
bpo-37672: Switch Windows Store package to use pip.ini for user mode (GH-14939)
https://github.com/python/cpython/commit/4b7ce105ff80467bf4d79c413d7adc256b824153


--
nosy: +miss-islington

___
Python tracker 

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



[issue37663] Making venv activation script prompts consistent

2019-07-24 Thread Brett Cannon


Change by Brett Cannon :


--
keywords: +patch
pull_requests: +14713
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14941

___
Python tracker 

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



[issue37674] Is imp module deprecated or pending deprecation?

2019-07-24 Thread Mariatta


New submission from Mariatta :

The doc https://docs.python.org/3.7/library/imp.html says "Deprecated since 
version 3.4: The imp package is pending deprecation in favor of importlib."

Is it in "deprecated" state, or "pendingdeprecation" state?
Should it just be removed in 3.9?

Maybe I just don't understand the difference of "deprecated" and "pending 
deprecation" :(

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 348411
nosy: Mariatta, docs@python
priority: normal
severity: normal
status: open
title: Is imp module deprecated or pending deprecation?

___
Python tracker 

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



[issue37672] Switch Windows Store package to use pip.ini for user mode

2019-07-24 Thread Steve Dower


Steve Dower  added the comment:


New changeset 123536fdab7b8def15c859aa70232bc55ec73096 by Steve Dower in branch 
'master':
bpo-37672: Switch Windows Store package to use pip.ini for user mode (GH-14939)
https://github.com/python/cpython/commit/123536fdab7b8def15c859aa70232bc55ec73096


--

___
Python tracker 

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



[issue37672] Switch Windows Store package to use pip.ini for user mode

2019-07-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14712
pull_request: https://github.com/python/cpython/pull/14940

___
Python tracker 

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



[issue37672] Switch Windows Store package to use pip.ini for user mode

2019-07-24 Thread Steve Dower


Change by Steve Dower :


--
keywords: +patch
pull_requests: +14711
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14939

___
Python tracker 

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



[issue37673] Tkinter won't create 5000 check boxes, stops at 1309.

2019-07-24 Thread Lou Perazzoli


New submission from Lou Perazzoli :

Here's a short example.

--
components: Tkinter
files: tk-bug.py
messages: 348409
nosy: Loupz
priority: normal
severity: normal
status: open
title: Tkinter won't create 5000 check boxes, stops at 1309.
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48503/tk-bug.py

___
Python tracker 

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



[issue37672] Switch Windows Store package to use pip.ini for user mode

2019-07-24 Thread Steve Dower


New submission from Steve Dower :

Currently we set PIP_USER environment variable in the pip.exe redirector, which 
is not ideal. Now that we have the latest release of pip, we can use a pip.ini 
file to set the option by default.

--
assignee: steve.dower
components: Windows
messages: 348408
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Switch Windows Store package to use pip.ini for user mode
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue37664] Update bundled pip and setuptools

2019-07-24 Thread Steve Dower


Steve Dower  added the comment:

Leaving this open until 3.8b4 in case we want to take another update.

--

___
Python tracker 

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



[issue19809] Doc: subprocess should warn uses on race conditions when multiple threads spawn child processes

2019-07-24 Thread Eryk Sun


Eryk Sun  added the comment:

> This is still the case on windows as the pipes created to talk to the
> process might be inherited by two or more simultaneous CreateProcess 
> calls.

subprocess already uses PROC_THREAD_ATTRIBUTE_HANDLE_LIST to address this 
problem, at least between its own subprocess.Popen calls. The handles in the 
list still have to be inheritable, so it does not solve the problem with 
os.system and os.spawn* calls that are concurrent with subprocess.Popen -- nor 
extension-module, ctypes, cffi, or PyWin32 code  in the wild that inherits 
handles without PROC_THREAD_ATTRIBUTE_HANDLE_LIST. There's a warning about this 
in the docs:

https://docs.python.org/3/library/subprocess.html#subprocess.STARTUPINFO.lpAttributeList

It's why we can't use the handle list to implement pass_fds in Windows and why 
the general capability is buried in STARTUPINFO, instead of being exposed as a 
high-level Popen parameter.

--
nosy: +eryksun

___
Python tracker 

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



[issue37646] eval() in a list comprehension

2019-07-24 Thread Grzegorz Krasoń

Grzegorz Krasoń  added the comment:

I re-opened the issue.

Dear core developers, can we ask you to confirm if described behavior of eval() 
is expected?

--

___
Python tracker 

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



[issue37646] eval() in a list comprehension

2019-07-24 Thread Grzegorz Krasoń

Change by Grzegorz Krasoń :


--
resolution: not a bug -> 
status: closed -> open

___
Python tracker 

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



[issue37664] Update bundled pip and setuptools

2019-07-24 Thread miss-islington


miss-islington  added the comment:


New changeset 0cdb21d6eb3428abe50a55f9291ca0e9728654d9 by Miss Islington (bot) 
in branch '3.8':
bpo-37664: Update bundled pip to 19.2.1 and setuptools to 41.0.1 (GH-14934)
https://github.com/python/cpython/commit/0cdb21d6eb3428abe50a55f9291ca0e9728654d9


--
nosy: +miss-islington

___
Python tracker 

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



[issue37664] Update bundled pip and setuptools

2019-07-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14710
pull_request: https://github.com/python/cpython/pull/14937

___
Python tracker 

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



[issue37664] Update bundled pip and setuptools

2019-07-24 Thread Steve Dower


Steve Dower  added the comment:


New changeset 5380def8269b24a8a3bc46396373a1dc91b1dd1a by Steve Dower (Pradyun 
Gedam) in branch 'master':
bpo-37664: Update bundled pip to 19.2.1 and setuptools to 41.0.1 (GH-14934)
https://github.com/python/cpython/commit/5380def8269b24a8a3bc46396373a1dc91b1dd1a


--

___
Python tracker 

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



[issue37595] Python 3.7.4 does not build on Raspbian Buster

2019-07-24 Thread Thomas Knox


Thomas Knox  added the comment:

Any update on this? This is biting me too.

I've tested on a Raspberry Pi 3B+, a 4B and a Zero W all running buster. All of 
them exhibit this same behavior.

Also, this same error is preventing Python 2.7.16 from compiling on the same 
hardware.

--
nosy: +DNSGeek

___
Python tracker 

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



[issue37671] itertools.combinations could be lazier

2019-07-24 Thread Antal Nemes


Antal Nemes  added the comment:

Thanks for sharing the discussion above. I did not know this was discussed 
earlier.

Indeed, I do not come from a real world example. I ran into this problem while 
solving an online coding challenge that also measures performance. I got the 
right answer, just took too long time to calculate. In the crafted testcase the 
stop condition could have occurred within the first few elements of the input 
iterator, but the execution took longer because of exhausting all elements.

I could pass the challenge by adding my own lazy_combination, that is basically 
a wrapper around itertools.combinations. 

I came up with this version, which is of course incomplete for production. Not 
too difficult, but it was not straightforward either.

def lazy_combinations(g, n):
try:
known_elements = []
for i in range(n-1):
known_elements.append(next(g))

while True:
final_element = next(g)
for i in itertools.combinations(known_elements, n-1):
next_element = i+(final_element,)
yield next_element
known_elements.append(final_element)
except StopIteration:
pass

What I would like to say is the demand for such behavior might be out there. I 
understand that such feature would induce complexity for the core. However, if 
this is not part of the core, the complexity does not disappear, just manifests 
elsewhere: users might need to spend some time with the debugging, and also 
write some nontrivial code as a workaround.

--

___
Python tracker 

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



[issue37399] XML text behaviour change if there are comments

2019-07-24 Thread Stefan Behnel


Change by Stefan Behnel :


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



[issue37659] subprocess.list2cmdline() should not escape wrapping single/double quotes

2019-07-24 Thread Steve Dower


Steve Dower  added the comment:

Maybe we need to finally make shlex.split() at least be consistent with 
list2cmdline() on Windows so it can round-trip, perhaps with a "windows=True" 
parameter.

I don't think it's unreasonable to aim for round-tripability. That isn't near 
as hard as "correctly quoting arguments in the absence of a specification for 
how to quote arguments".

--

___
Python tracker 

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



[issue37399] XML text behaviour change if there are comments

2019-07-24 Thread Stefan Behnel


Stefan Behnel  added the comment:


New changeset bb697899aa65d90488af1950ac7cceeb3877d409 by Stefan Behnel in 
branch '3.8':
[3.8] bpo-37399: Correctly attach tail text to the last element/comment/pi 
(GH-14856) (GH-14936)
https://github.com/python/cpython/commit/bb697899aa65d90488af1950ac7cceeb3877d409


--

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-07-24 Thread Stefan Behnel


Stefan Behnel  added the comment:


New changeset 63673916464bace8e2147357395fdf3497967ecb by Stefan Behnel (Miss 
Islington (bot)) in branch '3.8':
[3.8] bpo-34160: explain how to deal with attribute order in ElementTree 
(GH-14867) (GH-14935)
https://github.com/python/cpython/commit/63673916464bace8e2147357395fdf3497967ecb


--

___
Python tracker 

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



[issue37399] XML text behaviour change if there are comments

2019-07-24 Thread Stefan Behnel


Change by Stefan Behnel :


--
pull_requests: +14709
pull_request: https://github.com/python/cpython/pull/14936

___
Python tracker 

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



[issue37671] itertools.combinations could be lazier

2019-07-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

See also related discussion https://bugs.python.org/msg276855

--
nosy: +xtreak

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-07-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14708
pull_request: https://github.com/python/cpython/pull/14935

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-07-24 Thread Stefan Behnel


Stefan Behnel  added the comment:


New changeset a3697db0102b9b6747fe36009e42f9b08f0c1ea8 by Stefan Behnel in 
branch 'master':
bpo-34160: explain how to deal with attribute order in ElementTree (GH-14867)
https://github.com/python/cpython/commit/a3697db0102b9b6747fe36009e42f9b08f0c1ea8


--

___
Python tracker 

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



[issue37671] itertools.combinations could be lazier

2019-07-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +rhettinger

___
Python tracker 

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



[issue37671] itertools.combinations could be lazier

2019-07-24 Thread Antal Nemes


New submission from Antal Nemes :

Reproducible with current master (3.9, 151b91dfd21a100ecb1eba9e293c0a8695bf3bf5)

I would expect itertools.combinations to be lazy in the sense that it should 
not exhaust the input iterator in constructor time.

import itertools;
itertools.combinations(itertools.count(),2)

should return instantly. Instead it "hangs" until the process is killed.

Similarly, one can reproduce with the following simple crafted generator:

Python 3.9.0a0 (heads/master-dirty:151b91d, Jul 24 2019, 19:51:53) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> def mygenerator_with_exception():
yield 2
yield 2
yield 3
raise Exception("Should not be raised")
... ... ... ... ... 
>>> g = mygenerator_with_exception()
>>> import itertools 
>>> itertools.combinations(g,2)
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 5, in mygenerator_with_exception
Exception: Should not be raised

Could you please consider making itertools.combinations truely lazy?

--
components: Interpreter Core
messages: 348395
nosy: furiel
priority: normal
severity: normal
status: open
title: itertools.combinations could be lazier
type: behavior
versions: Python 3.5, Python 3.9

___
Python tracker 

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



[issue37399] XML text behaviour change if there are comments

2019-07-24 Thread Stefan Behnel


Stefan Behnel  added the comment:


New changeset c6cb4cdd21c0c3a09b0617dbfaa7053d3bfa6def by Stefan Behnel in 
branch 'master':
bpo-37399: Correctly attach tail text to the last element/comment/pi (GH-14856)
https://github.com/python/cpython/commit/c6cb4cdd21c0c3a09b0617dbfaa7053d3bfa6def


--

___
Python tracker 

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



[issue37670] Description of UserDict is misleading

2019-07-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +rhettinger

___
Python tracker 

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



[issue37670] Description of UserDict is misleading

2019-07-24 Thread Caleb Donovick


New submission from Caleb Donovick :

The documentation for collections.UserDict states "In addition to supporting 
the methods and operations of mappings, UserDict instances provide the 
following attribute:  ..."

This however is misleading as it supports the operations of mutable mappings. 
Which is not stated anywhere.

--
assignee: docs@python
components: Documentation
messages: 348393
nosy: docs@python, donovick
priority: normal
severity: normal
status: open
title: Description of UserDict is misleading

___
Python tracker 

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



[issue37664] Update bundled pip and setuptools

2019-07-24 Thread Pradyun Gedam


Pradyun Gedam  added the comment:

Alrighty! Filed gh-14934.

(Sounds good to me. Filed a PR on devguide, adding me to the devguide: 
https://github.com/python/devguide/pull/513)

--
keywords: +patch
message_count: 3.0 -> 4.0
pull_requests: +14707
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14934

___
Python tracker 

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



[issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls)

2019-07-24 Thread Pradyun Gedam


Change by Pradyun Gedam :


--
pull_requests: +14706
pull_request: https://github.com/python/cpython/pull/14934

___
Python tracker 

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



[issue37669] Make mock_open return per-file content

2019-07-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +cjw296, mariocj89, michael.foord, xtreak
versions:  -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



[issue37668] Allow individual test to be specified by "#" or "."

2019-07-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Why you can not use "."?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue10819] ValueError on repr(closed_socket_file)

2019-07-24 Thread Nir Soffer


Nir Soffer  added the comment:

I find this new behavior a usability regression. Before this change, code
(e.g python 2 code ported to python 3) could do:

   fd = sock.fileno()

Without handling errors, since closed socket would raise (good). Now such code 
need to check the return value (bad):

   fd = sock.fileno()
   if fd == -1:
   fail...

This is also not consistent with other objects:

>>> f = open("Makefile")
>>> f.fileno()
3
>>> f.close()
>>> f.fileno()
Traceback (most recent call last):
  File "", line 1, in 
ValueError: I/O operation on closed file
>>> repr(f)
"<_io.TextIOWrapper name='Makefile' mode='r' encoding='UTF-8'>"


The issue with repr() on closed socket can be mitigated easily inside __repr__, 
handling closed sockets without affecting code using file descriptors.

Can we return the old safe behavior?

--
nosy: +nirs

___
Python tracker 

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



[issue37664] Update bundled pip and setuptools

2019-07-24 Thread Steve Dower


Steve Dower  added the comment:

Oh that's a nasty issue... but it sounds like you're reaching some kind of 
agreement.

3.8b3 is scheduled for this week, so perhaps we can take the current release 
for now and then update it when you make the next release?

(Also Pradyun, would you like to be added to 
https://devguide.python.org/experts/ for pip so that you get nosied with that 
category? I'm happy to do that for you)

--

___
Python tracker 

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



[issue37664] Update bundled pip and setuptools

2019-07-24 Thread Pradyun Gedam


Pradyun Gedam  added the comment:

I might be doing another bugfix, for https://github.com/pypa/pip/issues/6775. I 
don't think we've decided how to go about that issue yet.

If a week isn't too long a waiting time, I'd suggest we wait for a week and 
then vendor whatever is the latest at that point.

I'll be happy to file a PR, if we want to go ahead with this. :)

--

___
Python tracker 

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



[issue37605] CI should not depend on gmane response

2019-07-24 Thread Zachary Ware


Zachary Ware  added the comment:

For doctests, I would prefer to just disable some or all of the doctests in 
Doc/library/nntplib.rst rather than go to the effort of trying to mock things.

--

___
Python tracker 

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



[issue37669] Make mock_open return per-file content

2019-07-24 Thread Damien Nadé

Change by Damien Nadé :


--
keywords: +patch
pull_requests: +14705
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14933

___
Python tracker 

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



[issue37669] Make mock_open return per-file content

2019-07-24 Thread Damien Nadé

New submission from Damien Nadé :

Let's say I have a function that opens 2 files and compare them. mock_open 
would not allow me to test this case, as it would return the same data for both 
files (through its read_data argument).

I want to be able to do this in a mocked-open context:
```
with open("file1") as file1:
assert file1.read() == "data1"

with open("file2") as file2:
assert file2.read() == "data2"
```

--
components: Library (Lib)
messages: 348386
nosy: Anvil
priority: normal
severity: normal
status: open
title: Make mock_open return per-file content
type: enhancement
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue37664] Update bundled pip and setuptools

2019-07-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +pradyunsg

___
Python tracker 

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



[issue37668] Allow individual test to be specified by "#" or "."

2019-07-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

If I understand the patch correctly this is is the behavior of the patch

./python.exe -m unittest test#test_keyword
...
--
Ran 7 tests in 0.001s

OK

Do you have a good use case over why # also needs to be supported? Using "." 
feels more readable and its more intuitive given import statements use it and 
almost used throughout the language. I am also not sure how "#" will behave in 
different shell environments since its a common character used as to denote 
comments.

--
nosy: +xtreak
versions:  -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



[issue19809] Doc: subprocess should warn uses on race conditions when multiple threads spawn child processes

2019-07-24 Thread Leonardo Santagada


Leonardo Santagada  added the comment:

This is still the case on windows as the pipes created to talk to the process 
might be inherited by two or more simultaneous CreateProcess calls.

I've found a suggested solution to this:

https://devblogs.microsoft.com/oldnewthing/20111216-00/?p=8873

By only inheriting the stdout/err/in handles and them supporting close_fds for 
windows.

Would more users be interested in a proper patch for this? For us now we have a 
lock around Popen.__init__ but that obviously doesn't suport subinterpreters 
and other calls to CreateProcess that might happen.

--
nosy: +santagada
versions: +Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue37605] CI should not depend on gmane response

2019-07-24 Thread Ngalim Siregar


Ngalim Siregar  added the comment:

is it allowed to mock news.gmane.org response?

if it is okay i would like to help

--
nosy: +nsiregar

___
Python tracker 

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



[issue36053] pkgutil.walk_packages jumps out from given path if there is package with the same name in sys.path

2019-07-24 Thread Piotr Karkut


Piotr Karkut  added the comment:

bump

--

___
Python tracker 

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



[issue29548] Recommend PyObject_Call* APIs over PyEval_Call*() APIs

2019-07-24 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 151b91dfd21a100ecb1eba9e293c0a8695bf3bf5 by Inada Naoki (Jeroen 
Demeyer) in branch 'master':
bpo-29548: deprecate PyEval_Call* functions (GH-14804)
https://github.com/python/cpython/commit/151b91dfd21a100ecb1eba9e293c0a8695bf3bf5


--

___
Python tracker 

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



[issue37668] Allow individual test to be specified by "#" or "."

2019-07-24 Thread mental


Change by mental :


--
nosy: +ezio.melotti, michael.foord, rbcollins

___
Python tracker 

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



[issue37661] venv activation scripts erroneously check if __VENV_PROMPT__ is defined

2019-07-24 Thread mental


mental  added the comment:

I've added a PR (#1492) since it was a simple fix.

Please feel free to reject if this issue is reserved or some other fatal issue 
with the solution is found.

Otherwise I'd love a review and a double check (mainly paranoia from not 
wanting to mess up).

--

___
Python tracker 

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



[issue37661] venv activation scripts erroneously check if __VENV_PROMPT__ is defined

2019-07-24 Thread mental


Change by mental :


--
keywords: +patch
pull_requests: +14703
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14932

___
Python tracker 

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



[issue37666] urllib.requests.urlopen doesn't support cadata=

2019-07-24 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

Suggesting the use of context and deprecating `cafile=None, capath=None, 
cadefault=False` sounds like a good idea.

--

___
Python tracker 

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



[issue37668] Allow individual test to be specified by "#" or "."

2019-07-24 Thread Hasan Diwan


New submission from Hasan Diwan :

The attached patch allows for individual tests to be specified using a #. 

Existing tests still pass:

 == Tests result: SUCCESS ==

All 40 tests OK.

Total duration: 4 min 15 sec
Tests result: SUCCESS

--
components: Tests
files: python.pat
messages: 348377
nosy: Hasan Diwan
priority: normal
severity: normal
status: open
title: Allow individual test to be specified by "#" or "."
type: enhancement
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48502/python.pat

___
Python tracker 

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



[issue37661] venv activation scripts erroneously check if __VENV_PROMPT__ is defined

2019-07-24 Thread mental


mental  added the comment:

Brett, Vinay: mind if I handle this one? I'm looking for a good first issue to 
tackle.

In terms of solutions I propose adding short circuiting logic to the checks for 
custom prompts to test against the default case `({context.env_name})`

--
nosy: +mental

___
Python tracker 

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



[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> Another issue that I've encountered is that ASCII art becomes gets flagged.  
> Switching to a raw string then kills the unicode escape sequences.

If you already use escape sequences in your ASCII art, what is the problem of 
using them for backslashes?

> I think anyone who starts using 3.8 on a daily basis for non-toy examples 
> will constantly run into this.

What is a better solution? The deprecation warning was emitted starting from 
3.6. Deprecation warnings were silent by default in 3.6, but they become more 
visible in 3.7. This helped some projects (which give attention to warnings in 
they tests) to fix real bugs. But it was not enough, so other bugs are fixed 
only now, when the warnings become even more visible in 3.8. We see a value of 
warnings, they help to fix bugs. If we rollback this change, it will cause yet 
undiscovered bugs be hidden for more time.

In Python 3.0 we make many abrupt breaking changes at once. People complained. 
Here is an opposite example of very gradual change: two releases with a 
DeprecationWarning, few more (at least two) releases with a SyntaxWarning, and 
finally perhaps a SyntaxError.

--

___
Python tracker 

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



[issue35771] IDLE: Fix tooltip Hovertiptest failure

2019-07-24 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I had forgotten about this, but by coincidence, it occurred again today, on 
'x86 Windows7 3.7' after PR-14919 was merged.  This may be the same machine as 
I might have left '7' off 'Windows' in the original report.

The 'windows timer' is used for time.sleep.  From various web articles, I read 
that its resolution varies from 10 to 25, defaults to 15.8 milleseconds in Win7 
(this is the figure I knew years ago), and defaults to 35 microseconds in Win 
10.  (Not exactly agreement.) time.sleep is hardly accurate for small fractions 
of a second delays, and delays may be much longer.  I believe that root.after 
does better.

Zachery, what OS and version do you have?

--

___
Python tracker 

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