[issue43074] Unable to use system proxy with HTTPS connection on Windows

2021-01-29 Thread 双草酸酯

New submission from 双草酸酯 :

On Windows you can only set a "host:port" http proxy as system proxy.
```
PS > Get-ItemProperty -Path 
'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' | findstr 
ProxyServer
ProxyServer  : 127.0.0.1:7890
```

But in Python, it assumes that this proxy supports both http and https on the 
same port:

```
>>> import urllib
>>> urllib.request.getproxies()
{'http': 'http://127.0.0.1:7890', 'https': 'https://127.0.0.1:7890', 'ftp': 
'ftp://127.0.0.1:7890'}
```

On Python 3.8.x it works but on 3.9.x it keeps failing to handshake on https 
traffic.

3.8.x:

```
> .\python38.exe
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib, requests
>>> urllib.request.getproxies()
{'http': 'http://127.0.0.1:7890', 'https': 'https://127.0.0.1:7890', 'ftp': 
'ftp://127.0.0.1:7890'}
>>> requests.get("http://www.google.com";)

>>> requests.get("https://www.google.com";)

```

```
> python3
Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec  7 2020, 17:08:21) [MSC v.1927 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib, requests
>>> urllib.request.getproxies()
{'http': 'http://127.0.0.1:7890', 'https': 'https://127.0.0.1:7890', 'ftp': 
'ftp://127.0.0.1:7890'}
>>> requests.get("http://www.google.com";)

>>> requests.get("https://www.google.com";)
Traceback (most recent call last):
  File "C:\Python39\lib\site-packages\urllib3\connectionpool.py", line 696, in 
urlopen
self._prepare_proxy(conn)
  File "C:\Python39\lib\site-packages\urllib3\connectionpool.py", line 964, in 
_prepare_proxy
conn.connect()
  File "C:\Python39\lib\site-packages\urllib3\connection.py", line 359, in 
connect
conn = self._connect_tls_proxy(hostname, conn)
  File "C:\Python39\lib\site-packages\urllib3\connection.py", line 496, in 
_connect_tls_proxy
return ssl_wrap_socket(
  File "C:\Python39\lib\site-packages\urllib3\util\ssl_.py", line 432, in 
ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)
  File "C:\Python39\lib\site-packages\urllib3\util\ssl_.py", line 474, in 
_ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock)
  File "C:\Python39\lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
  File "C:\Python39\lib\ssl.py", line 1040, in _create
self.do_handshake()
  File "C:\Python39\lib\ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1123)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python39\lib\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
  File "C:\Python39\lib\site-packages\urllib3\connectionpool.py", line 755, in 
urlopen
retries = retries.increment(
  File "C:\Python39\lib\site-packages\urllib3\util\retry.py", line 573, in 
increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.google.com', 
port=443): Max retries exceeded with url: / (Caused by SSLError(SSLEOFError(8, 
'EOF occurred in violation of protocol (_ssl.c:1123)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python39\lib\site-packages\requests\api.py", line 76, in get
return request('get', url, params=params, **kwargs)
  File "C:\Python39\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
  File "C:\Python39\lib\site-packages\requests\sessions.py", line 542, in 
request
resp = self.send(prep, **send_kwargs)
  File "C:\Python39\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
  File "C:\Python39\lib\site-packages\requests\adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.google.com', 
port=443): Max retries exceeded with url: / (Caused by SSLError(SSLEOFError(8, 
'EOF occurred in violation of protocol (_ssl.c:1123)')))
```

--
components: Windows
messages: 385973
nosy: admin3, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Unable to use system proxy with HTTPS connection on Windows
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue42647] Unable to use concurrent.futures in atexit hook

2021-01-29 Thread Kyle Stanley


Kyle Stanley  added the comment:

Thanks for bringing attention to this, Julien. 

While the regression is definitely unfortunate, I'm uncertain about whether the 
behavior is *correct* to allow in the first place. Specifically, allowing the 
registration of an atexit hook which uses a ThreadPoolExecutor within it means 
that the finalization of the executor will be done *after* thread finalization 
occurs, leaving dangling threads which will have to be abruptly killed upon 
interpreter exit instead of being safely joined. From my perspective at least, 
this doesn't seem like something to be encouraged.

Is there a real-world situation where it's specifically necessary or even 
beneficial to utilize ThreadPoolExecutor at this point after thread 
finalization rather than earlier in the program? Not that it doesn't exist, but 
to me it intuitively seems very odd to utilize an executor within an atexit 
hook, which are intended to just be resource finalization/cleanup functions 
called at interpreter shutdown. Assuming there is a genuine use case I'm not 
seeing, it may be worth weighing against the decision to convert the executors 
to not use daemon threads, as I presently don't think there's a way to (safely) 
allow that behavior without reverting back to using daemon threads.

That said, I'll admit that I'm more than a bit biased as the author of the 
commit which introduced the regression, so I'll CC Antoine Pitrou (active 
expert for threading and concurrent.futures) to help make the final decision.

--
nosy: +pitrou

___
Python tracker 

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



[issue42115] Caching infrastructure for the evaluation loop: specialised opcodes

2021-01-29 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks!

The loop overhead is presumably dramatic in that example. I think I measured a 
somewhat bigger speedup using timeit, which IIRC subtracts the cost of an empty 
loop. But you're right that 5% on a micro-benchmark is not very exciting.

I wonder if there are cases where the speedup is larger, e.g. in a class with 
__slots__ where the method is defined in a base class (also with __slots__). In 
that case LOAD_METHOD would require two dict lookups, both of which we'd avoid 
here.

This could be relevant if we had a hidden class mechanism (I'm playing with 
that but it's too soon to show anything). Let's keep your patch around for that.



Has anyone looked at storing the cache literally inline? If we had a way to 
rewrite bytecode that allowed us to move code (requiring us to fix up jumps) 
the cache data could be stored inline in the bytecode array (I guess that's why 
they call it "inline cache" :-). So e.g. LOAD_METHOD could have a layout like 
this:

LOAD_METHOD opcode
oparg
(padding)
optimized
type
tp_version_tag
meth

This would avoid the pointer chasing needed to find the opcache struct, and 
increase memory locality. Obviously the bytecode would have to be copied to 
mutable memory.

We could even make it so that "LOAD_METHOD with opcache entry" is a new opcode, 
so there would be less overhead for unoptimized code (and for optimized code 
:-).

We'd have to do something funky for concurrent invocations of the same function 
(due to threading or recursion), but that can be dealt with; e.g., the frame 
could hold a pointer to the bytecode array in use.

--

___
Python tracker 

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



[issue40455] GCC 10 compiler warnings

2021-01-29 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal
nosy_count: 5.0 -> 6.0
pull_requests: +23200
pull_request: https://github.com/python/cpython/pull/24384

___
Python tracker 

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



[issue43073] Adding a ctypes.Union to a ctypes.BigEndianStructure results in an error

2021-01-29 Thread Eric Poulsen


New submission from Eric Poulsen :

Placing a ctypes.Union inside of a ctypes.BigEndianStructure results in 
"TypeError: This type does not support other endian".  I believe this is a 
similar problem to issue #4376 (https://bugs.python.org/issue4376)

Minimum repro test case:

import ctypes as ct

class U(ct.Union):
_pack_=True
_fields_=[
('a', ct.c_int),
('b', ct.c_int),
]

class S(ct.BigEndianStructure):
_pack_=True
_fields_=[
('x', ct.c_int),
('y', U),
]

I believe the fix is similar to that issue, though I admit I don't know enough 
about this code to be sure.

diff --git a/Lib/ctypes/_endian.py b/Lib/ctypes/_endian.py
index 37444bd6a7..525c5e58c9 100644
--- a/Lib/ctypes/_endian.py
+++ b/Lib/ctypes/_endian.py
@@ -18,6 +18,9 @@ def _other_endian(typ):
 # if typ is structure
 if issubclass(typ, Structure):
 return typ
+# if typ is union:
+if issubclass(typ, Union):
+return typ
 raise TypeError("This type does not support other endian: %s" % typ)
 
 class _swapped_meta(type(Structure)):

--
components: ctypes
messages: 385970
nosy: MrSurly
priority: normal
severity: normal
status: open
title: Adding a ctypes.Union to a ctypes.BigEndianStructure results in an error
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



[issue43072] Memory Leak when using Thread

2021-01-29 Thread akshat goyal


New submission from akshat goyal :

when using Thread and allocating memory resource usage is not down as opposed 
to when using Process or directly calling function as can be seen in the 
attached script.

To replicate:
start the script with the three functions one by one and see the memory usage 
of the script.
Thread has the highest of all three.

--
components: Library (Lib)
files: simple.py
messages: 385969
nosy: goyalakshat14
priority: normal
severity: normal
status: open
title: Memory Leak when using Thread
type: resource usage
versions: Python 3.6, Python 3.8
Added file: https://bugs.python.org/file49777/simple.py

___
Python tracker 

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



[issue43071] IDLE: Windows 7 - Trackpad two-finger vertical scrolling is not recognized

2021-01-29 Thread Greg


New submission from Greg :

Up/down scrolling is not possible with a two-finger swipe on a trackpad. I'm 
using Lenovo's notably bad UltraNav drivers on Windows 7. Horizontal scrolling 
works just fine. PgUp and PgDn both behave as normal, as does ctrl + arrow keys.

I'm having this issue with IDLE for 3.8.7, and 3.7.9, but not 2.7.3 (which just 
happens to be the last version I had installed).

--
assignee: terry.reedy
components: IDLE
messages: 385968
nosy: Kritzy, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: Windows 7 - Trackpad two-finger vertical scrolling is not 
recognized
type: behavior
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



[issue42115] Caching infrastructure for the evaluation loop: specialised opcodes

2021-01-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I am attaching to this issue a patch with PR 23503 restricted to only classes 
without dict. I can measure a speedup but is super small (5%) in a function 
that keeps calling a method for a builtin:

def foo(obj):
for _ in range(1):
res = obj.index(42)
return res

--
Added file: https://bugs.python.org/file49776/patch

___
Python tracker 

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



[issue42115] Caching infrastructure for the evaluation loop: specialised opcodes

2021-01-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> What am I missing? Why is the hash of the name needed?

To speed up the call to get the method from the dictionary using 
_PyDict_GetItem_KnownHash. The reason I was not caching the method is that as 
you mention there could still be an overriding value in the dictionary.

> But what if we only did this for classes without an instance dict? 

This is an interesting idea. For PR23503 seems that the machinery was too 
costly that it was killing the advantages, but maybe we could simplify this for 
classes without dictionaries so we can still gain overall.

--

___
Python tracker 

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



[issue42927] Inline cache for slots

2021-01-29 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +23199
pull_request: https://github.com/python/cpython/pull/24383

___
Python tracker 

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



[issue42927] Inline cache for slots

2021-01-29 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed

___
Python tracker 

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



[issue42927] Inline cache for slots

2021-01-29 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 5c5a938573ce665f00e362c7766912d9b3f3b44e by Guido van Rossum in 
branch 'master':
bpo-42927: Inline cache for attributes defined with '__slots__' (#24216)
https://github.com/python/cpython/commit/5c5a938573ce665f00e362c7766912d9b3f3b44e


--

___
Python tracker 

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



[issue43070] Control keys stop working after pressing Ctrl-C Escape Enter

2021-01-29 Thread Trey Hunner


Trey Hunner  added the comment:

Thank you Steve and Tadek for confirming that this is a readline feature and 
for pointing me to the readline manual. The note about an ~/.inputrc file lead 
me to discover (happily) that I could override this behavior by creating a 
~/.inputrc file with the following line in it:

"\e\C-M": abort Stop Esc Enter from entering vi mode in Python REPL


I'm closing this as "not a bug".

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



[issue43070] Control keys stop working after pressing Ctrl-C Escape Enter

2021-01-29 Thread Tadek Kijkowski


Tadek Kijkowski  added the comment:

This is readline library feature. ESC-enter swithes it to vi mode. Press ESC-e 
to switch is back to emacs mode. See man readline.

--
nosy: +monkeyman79

___
Python tracker 

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



[issue38631] Replace Py_FatalError() with regular Python exceptions

2021-01-29 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ba7a99ddb52a45c8dec1f7e9f1648add0ace82ab by Victor Stinner in 
branch 'master':
bpo-38631: Replace compiler fatal errors with exceptions (GH-24369)
https://github.com/python/cpython/commit/ba7a99ddb52a45c8dec1f7e9f1648add0ace82ab


--

___
Python tracker 

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



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2021-01-29 Thread STINNER Victor


STINNER Victor  added the comment:

> test_nextafter fails on PPC64 AIX 3.x (build 749).

It pass again in build 788, so I close the issue:
https://buildbot.python.org/all/#/builders/438/builds/788

It would be great if the AIX libm could be fixed, but I wanted to fix the AIX 
buildbots, to be abl to detect other Python regressions.

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



[issue43070] Control keys stop working after pressing Ctrl-C Escape Enter

2021-01-29 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Ctrl-C is a red-herring here. Esc-Enter alone is sufficient to switch control 
processing.

Tested in Python 2.7 and 3.9 using xfce4-terminal in Fedora:

1. Ctrl-L clears the terminal window;
2. Type Esc-Enter;
3. Ctrl-L now inserts an actual ^L (chr(12) linefeed) instead of being captured 
by the terminal and clearing the screen.

I am 80% sure this is a *terminal feature* not a Python bug, to allow you to 
insert control characters into the command line, but I can't reproduce it in 
bash or find a way to revert back to normal processing.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue42604] EXT_SUFFIX too short on FreeBSD and AIX

2021-01-29 Thread STINNER Victor


STINNER Victor  added the comment:

> It seems like Python no long builds on PPC64 AIX 3.x buildbot:
> https://buildbot.python.org/all/#/builders/438/builds/753

Sorry, it was unrelated to this issue. I fixed it with:

New changeset 0837f99d3367ecf200033bbddfa05d061ae9f483 by Victor Stinner in 
branch 'master':
bpo-42323: Fix math.nextafter() on AIX (GH-24381)

> This is bpo-42979: "_zoneinfo: zoneinfomodule_exec() doesn't check for 
> PyDateTime_IMPORT failure".

_zoneinfo has also been fixed.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue43070] Control keys stop working after pressing Ctrl-C Escape Enter

2021-01-29 Thread Trey Hunner


Trey Hunner  added the comment:

I got some help investigating via a Twitter thread on this topic: 
https://twitter.com/treyhunner/status/1355280273399664642

Here's more context: that combination of keys seems to put readline into vi 
mode, though it only does so in Python and not inside my system shell.

If I type start to type a line of code (say "2+2") and hit Escape and then type 
vi commands like 0 or $, the cursor will navigate to the beginning/end of the 
line as expected in vi mode.

Ctrl-Alt-L clears the screen and typing "Ctrl-A e" enters back into Emacs 
readline mode.

I can understand how "Ctrl-A v" would cause the Python REPL to enter vi mode, 
but I don't understand why "Ctrl-C Escape Enter" would cause that.

--

___
Python tracker 

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



[issue43070] Control keys stop working after pressing Ctrl-C Escape Enter

2021-01-29 Thread Trey Hunner


New submission from Trey Hunner :

On Ubuntu Linux 18.04 when I run Python from within a terminal, control keys 
such as Ctrl-L, Ctrl-A, Ctrl-E, and Ctrl-K work as expected.

However, if I type Ctrl-C Escape Enter (^C followed by Esc followed by Return), 
control keys stop working as expected. Ctrl-C still causes KeyboardInterrupt to 
be printed, but pressing Ctrl-L causes "^L" to be shown and Ctrl-A shows "^A".

This happens in Gnome Terminal as well as XTerm both on Ubuntu Linux 18.04. It 
happens in zsh, bash, tcsh, and sh.

I've reproduced this issue in Python 2.7, 3.6, 3.7, 3.8, 3.9, and 3.10. Some of 
these Python versions I installed via pyenv, some came from the deadsnakes PPA, 
and some were preinstalled with Ubuntu.

--
messages: 385957
nosy: trey
priority: normal
severity: normal
status: open
title: Control keys stop working after pressing Ctrl-C Escape Enter
type: behavior
versions: Python 3.10, 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



[issue43063] zipfile.Path / importlib.resources raises KeyError if a file wasn't found

2021-01-29 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

The change to error handling for zipp.Path was added in 
https://github.com/jaraco/zipp/issues/46 and released as 
[3.1.0](https://zipp.readthedocs.io/en/latest/history.html#v3-1-0). Probably 
that change was incorporated into CPython shortly thereafter with bpo-40564, as 
you observed.

I agree with you, backporting these as bugfixes doesn't feel appropriate. It is 
a change in behavior. On the other hand, it's a change within the documented 
scope of the API (that is, it was never stipulated what the behavior would be). 
My slight preference is to leave the CPython version alone and to recommend the 
use of the backports to get Python 3.10 compatibility.

It really comes down to the judgment of the release manager. Łukasz, how do you 
feel about changing the exception that's raised when a directory or file 
doesn't exist from a KeyError to a more-appropriate OSError for future 
compatibility?

--
nosy: +lukasz.langa

___
Python tracker 

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



[issue43069] Python fails to read a script whose path is `/dev/fd/X`

2021-01-29 Thread Ciprian Dorin Craciun


New submission from Ciprian Dorin Craciun :

Sometimes (especially from wrapper scripts) one would like to call Python with 
a script that should be read from a file-descriptor, like `python3 /dev/fd/9`;  
most likely the backing is a file in `TMPDIR` (perhaps unlinked, like `bash`'s 
"here documents").

However on OSX (I've tried it on `10.15.7` and `10.13.6`), for some reason if 
that script is too "large" (more than a couple of characters) it just bails 
out, even if that file-descriptor is in fact backed by a file.

For example:

echo 'print("1234567890")' >/tmp/x.py && python3 /dev/fd/9 9/tmp/x.py && python3 /dev/fd/9 9

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



[issue43056] Use of dicts in 4.2 and 4.7 of Python tutorial a bit confusing

2021-01-29 Thread Jesse Silverman


Jesse Silverman  added the comment:

Agreed with the exception that I'd like to review whether the forward reference 
to dict in the tutorial might be better suited to people working thru the 
tutorial than the current forward reference to the real docs.

I got to take a look at Eric Matthes' excellent "Python Crash Course".  He 
avoids this by treating function definitions only after introducing both tuples 
and dicts, rather than together with simple control flow within a function.  
That would clearly be a re-org that is way out of scope of a bug report.

So, if someone compares the potential forward reference to the dict section of 
the tutorial rather than the current forward reference to the language 
reference in light of where the tutorial audience is expected to be at when 
reading this section, I am good with closing it.

--

___
Python tracker 

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



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2021-01-29 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0837f99d3367ecf200033bbddfa05d061ae9f483 by Victor Stinner in 
branch 'master':
bpo-42323: Fix math.nextafter() on AIX (GH-24381)
https://github.com/python/cpython/commit/0837f99d3367ecf200033bbddfa05d061ae9f483


--

___
Python tracker 

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



[issue43034] Python tutorial misleads users about floor division behavior

2021-01-29 Thread Jesse Silverman


Jesse Silverman  added the comment:

I understand and agree with both comments.
I will confirm that a substantial number of people think -17 // 3 yields -5.0, 
so when I saw this I wondered if it reinforced that common misconception.

I was curious enough to not just confirm in the actual docs not only that -17 
// 3 == -6.0 but learned why it does so.

I would be happy to see any of Terry's three suggestions added, with the first 
one adding the most bang for the buck (if someone is surprised to see -6.0 
there, they can go look up why).

--

___
Python tracker 

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



[issue40070] GCC crashed on AMD64 RHEL7 LTO + PGO 3.7 (compiler bug)

2021-01-29 Thread STINNER Victor


STINNER Victor  added the comment:

I didn't see the compiler bug recently, and Python 3.7 no longer accept bug 
fixes anymore.

--
resolution:  -> out of date
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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2021-01-29 Thread STINNER Victor


STINNER Victor  added the comment:

> I reopen the issue. This change caused a regression in attached 
> interned_bug.py.

Fixed by:

commit c8a87addb1fa35dec79ed8f227eba3694fc36234
Author: Mohamed Koubaa 
Date:   Mon Jan 4 08:34:26 2021 -0600

bpo-1635741: Port pyexpat to multi-phase init (PEP 489) (GH-2)

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue43048] Printing RecursionError results in RecursionError

2021-01-29 Thread Vladimir Feinberg


Vladimir Feinberg  added the comment:

I agree with both the duplicate classification and am glad the fix works in 
3.10. Thanks all for the responses.

Given the issue can be triggered with a fairly benign setup (pandas triggers 
such an error, and logger.exception is idiomatic), I do think backport should 
be worth consideration, but maybe I'm overindexing on the frequency of such 
exceptions in the wild.

--

___
Python tracker 

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



[issue43042] Delete or merge redundant tutorial sentence.

2021-01-29 Thread Jesse Silverman


Jesse Silverman  added the comment:

Yes, your takeaway was what precisely what I was getting at.  I sounded unsure 
because I was unsure.  In reality, it doesn't matter whether a different 
function is being called or one is calling itself, the current wording suggests 
that it might.

--

___
Python tracker 

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



[issue41013] test_os.test_memfd_create() fails on AMD64 FreeBSD Shared 3.x

2021-01-29 Thread STINNER Victor


STINNER Victor  added the comment:

test_os pass again on FreeBSD Shared 3.x, I close the issue.

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



[issue43068] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x

2021-01-29 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +koobs

___
Python tracker 

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



[issue41282] Deprecate and remove distutils

2021-01-29 Thread Steve Dower


Steve Dower  added the comment:


New changeset 62949f697fdefbf0c8bbba7a8354b9376afa35ba by Steve Dower in branch 
'master':
bpo-41282: Add deprecation warning and docs for distutils (PEP 632) (GH-24355)
https://github.com/python/cpython/commit/62949f697fdefbf0c8bbba7a8354b9376afa35ba


--

___
Python tracker 

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



[issue43068] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x

2021-01-29 Thread STINNER Victor


New submission from STINNER Victor :

https://buildbot.python.org/all/#/builders/483/builds/758

FAIL: test_specific_shell (test.test_subprocess.POSIXProcessTestCase)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_subprocess.py",
 line 2286, in test_specific_shell
self.assertEqual(p.stdout.read().strip(), bytes(sh, 'ascii'))
AssertionError: b'' != b'/usr/local/bin/bash'

AMD64 FreeBSD Shared 3.9 is also affected:
https://buildbot.python.org/all/#/builders/151/builds/283

And AMD64 FreeBSD Shared 3.8:
https://buildbot.python.org/all/#/builders/555/builds/197

--
components: Tests
messages: 385945
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x
versions: Python 3.10, 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



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2021-01-29 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +23198
pull_request: https://github.com/python/cpython/pull/24381

___
Python tracker 

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



[issue42982] Update suggested number of iterations for pbkdf2_hmac()

2021-01-29 Thread Illia Volochii


Illia Volochii  added the comment:

> FWIW, OnePass uses 100,000.  https://support.1password.com/pbkdf2/

There is a history section on that page. And current 100,000 is ten times more 
than 1Password used in 2013 when the suggestion was added to the documentation.

> Also, I don't think an additional time factor of 2.5x would make substantial 
> difference in security, but it may make a noticeable difference in user 
> authentication time.

2.5x difference can be substantial if x is hours, days, or years :)

--

___
Python tracker 

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



[issue42596] aarch64 Fedora Rawhide LTO + PGO 3.8 fails to build Python: /usr/bin/ld: error adding symbols: bad value

2021-01-29 Thread STINNER Victor


STINNER Victor  added the comment:

The worker is back to green: 
https://buildbot.python.org/all/#/builders/528/builds/299

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



[issue42966] argparse: customizable help formatter

2021-01-29 Thread Tadek Kijkowski


Tadek Kijkowski  added the comment:

This is just repackaging old ideas into nice box. Instead of creating lambdas 
or generator function for each particular case, there is one easy to use, 
universal class. It will be finally written in official documentation how to 
change indentation.

--

___
Python tracker 

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



[issue43056] Use of dicts in 4.2 and 4.7 of Python tutorial a bit confusing

2021-01-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

For 4.2, the point is the '.copy()' versus the 'active_users' copy.  I think a 
real beginner would, or should, ignore any other details not immediately 
familiar.  

4.7.2 Keyword arguments.  It is simply a fact that including the full 
discussion here requires the forward references.  I think splitting the 
discussion and moving this part somewhere later would be worse.  Some will not 
be able to "follow the tutorial in sequence".  It is not a novel.

I think you should close this.  It makes observations but does not have any 
concrete suggestions for improvements, and unlike your other posts, I don't see 
that it might lead to any.

--
nosy: +terry.reedy
title: Use of dicts in sections 4.2 and 4.7 of Python tutorial a bit confusing 
-> Use of dicts in 4.2 and 4.7 of Python tutorial a bit confusing

___
Python tracker 

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



[issue43067] inspect.signature(bytes.hex) raises ValueError "builtin has invalid signature"

2021-01-29 Thread Борис Верховский

New submission from Борис Верховский :

On Python 3.9

>>> import inspect
>>> inspect.signature(bytes.hex)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.9/inspect.py", line 3118, in signature
return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
  File "/usr/lib/python3.9/inspect.py", line 2867, in from_callable
return _signature_from_callable(obj, sigcls=cls,
  File "/usr/lib/python3.9/inspect.py", line 2322, in _signature_from_callable
return _signature_from_builtin(sigcls, obj,
  File "/usr/lib/python3.9/inspect.py", line 2135, in _signature_from_builtin
return _signature_fromstr(cls, func, s, skip_bound_arg)
  File "/usr/lib/python3.9/inspect.py", line 2005, in _signature_fromstr
raise ValueError("{!r} builtin has invalid signature".format(obj))
ValueError:  builtin has invalid signature


This is also true for memoryview.hex and bytearray.hex . This happens because

>>> bytes.hex.__text_signature__
'($self, /, sep=, bytes_per_sep=1)'

when it would make more sense for it to return

'($self, /, sep='', bytes_per_sep=1)'

or at least sep=None

--
components: Library (Lib)
messages: 385940
nosy: boris
priority: normal
severity: normal
status: open
title: inspect.signature(bytes.hex) raises ValueError "builtin has invalid 
signature"
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue42982] Update suggested number of iterations for pbkdf2_hmac()

2021-01-29 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

FWIW, OnePass uses 100,000.  https://support.1password.com/pbkdf2/

Also, I don't think an additional time factor of 2.5x would make substantial 
difference in security, but it may make a noticeable difference in user 
authentication time.

--
nosy: +rhettinger

___
Python tracker 

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



[issue43048] Printing RecursionError results in RecursionError

2021-01-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

With 3.9, exc.py produces for me

Traceback (most recent call last):
  File "F:\Python\a\tem3.py", line 3, in f
raise ValueError('hello')
ValueError: hello

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:\Python\a\tem3.py", line 3, in f
raise ValueError('hello')
ValueError: hello
...
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:\Python\a\tem3.py", line 11, in 
f()
  File "F:\Python\a\tem3.py", line 5, in f
f()
  File "F:\Python\a\tem3.py", line 5, in f
f()
  File "F:\Python\a\tem3.py", line 5, in f
f()
  [Previous line repeated 992 more times]
  File "F:\Python\a\tem3.py", line 3, in f
raise ValueError('hello')
RecursionError: maximum recursion depth exceeded while calling a Python object

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Programs\Python310\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
  File "C:\Programs\Python310\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
  File "F:\Python\a\tem3.py", line 14, in 
print_exception(exc_info[0], exc_info[1], exc_info[2], None)
  File "C:\Programs\Python310\lib\traceback.py", line 113, in print_exception
for line in TracebackException(
  File "C:\Programs\Python310\lib\traceback.py", line 503, in __init__
context = TracebackException(
  File "C:\Programs\Python310\lib\traceback.py", line 503, in __init__
context = TracebackException(
  File "C:\Programs\Python310\lib\traceback.py", line 503, in __init__
context = TracebackException(
  [Previous line repeated 494 more times]
RecursionError: maximum recursion depth exceeded

This ends the same way as in #42848.


The patch in #42848 will appear in 3.10.0a5 in March.  Guido and Irit decided 
not to backport at the patch is as much a refactoring as a fix.

On a fresh repository build, exc.py ends with 

Traceback (most recent call last):
  File "f:\python\a\tem3.py", line 3, in f
raise ValueError('hello')
ValueError: hello

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "f:\python\a\tem3.py", line 11, in 
f()
  File "f:\python\a\tem3.py", line 5, in f
f()
  File "f:\python\a\tem3.py", line 5, in f
f()
  File "f:\python\a\tem3.py", line 5, in f
f()
  [Previous line repeated 995 more times]
  File "f:\python\a\tem3.py", line 3, in f
raise ValueError('hello')
RecursionError: maximum recursion depth exceeded while calling a Python object
got to the finish line!

I believe this is the expected improvement.

--
nosy: +terry.reedy
stage:  -> resolved
status: pending -> closed
type:  -> behavior
versions: +Python 3.10 -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



[issue31212] datetime: min date (0001-01-01 00:00:00) can't be converted to local timestamp

2021-01-29 Thread Sam Kagan

Sam Kagan  added the comment:

I encountered this issue in Python 3.8. I consider it to be a bug because it's 
an instance of a class-defined constant (datetime.min) not working with a 
method of that class (timestamp) when all other values that the class could 
take work with the method AND the constant works with all of the class' other 
methods. And it has practical implications: As belopolsky said above, "a 
reasonable design can use datetime.min/max as placeholders for unknown times 
far in the past/future compensating for the lack [of] datetime ±inf."

Since datetime.min lies so close to the edges of datetime's value-space, 
perhaps it should be made offset-aware and placed in UTC so that it stops 
breaking timestamp() when the user is in the wrong timezone. Alternatively, 
there could be a note in the documentation for datetime.timestamp() about this 
edge case. Assuming similarly bizarre behavior happens at datetime.max for one 
or more datetime methods (and for consistency's sake), it should probably be 
put in UTC as well.

--
nosy: +skagan_NRAO
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue43039] tempfile.TemporaryDirectory() name string is incorrect

2021-01-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

I've been thinking about this some more, and I agree with Terry. Changing str() 
seems dangerous, and __fspath__ wouldn't be backwardly compatible. If you want 
the name, use .name. So I'm going to close this.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue43042] Delete or merge redundant tutorial sentence.

2021-01-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The sentence you quoted ends a paragraph that begins with a sentences saying 
the same thing even more clearly.  "The execution of a function introduces a 
new symbol table used for the local variables of the function."  I think the 
ending sentence could be deleted as redundant.  Or it could be merged into the 
initial sentence with "When a function is called, the execution of that 
function ... ."  What do you think?

The me, the confusion of 'other function' is that it leaves open the 
possibility of 'same function' having a different result, as in languages with 
tail recursion conversion.  But this is not true of python, which cares nothing 
about the caller.

--
nosy: +terry.reedy
stage:  -> needs patch
title: tutorial ambiguous about creation of local symbol table for recursive 
calls -> Delete or merge redundant tutorial sentence.
versions: +Python 3.10 -Python 3.9

___
Python tracker 

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



[issue43066] Zipfile with leading slashes

2021-01-29 Thread Garrison Taylor


New submission from Garrison Taylor :

Currently the zipfile library allows you to create invalid zip files. The 
following code is an example:

from zipfile import ZipFile
import tempfile
temporary_file = tempfile.NamedTemporaryFile()
my_zip = ZipFile(temporary_file.name, 'w')
my_zip.writestr('/some_folder/some_file.txt', 'Some content')
my_zip.close()

The generated zipfile contains "/some_folder/some_file.txt". However, according 
to the specification for zip files, this is invalid. See below, from the .ZIP 
File Format Specification version 6.3.9:

   4.4.17.1 The name of the file, with optional relative path.
   The path stored MUST NOT contain a drive or
   device letter, or a leading slash.  All slashes
   MUST be forward slashes '/' as opposed to
   backwards slashes '\' for compatibility with Amiga
   and UNIX file systems etc.  If input came from standard
   input, there is no file name field.  

This is significant because the default Windows Explorer zip file extractor 
cannot handle zip files that contain a leading slash, producing an error that 
"The compressed (zipped) folder is invalid."

--
components: Library (Lib)
messages: 385934
nosy: garrison.taylor
priority: normal
severity: normal
status: open
title: Zipfile with leading slashes
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue43064] Cannot clear signal handler set with loop.add_signal_handler in forked process with signal.signal

2021-01-29 Thread Selim Belhaouane


Change by Selim Belhaouane :


--
title: Impossible to override signal handler set with add_signal_handler in 
forked process -> Cannot clear signal handler set with loop.add_signal_handler 
in forked process with signal.signal

___
Python tracker 

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



[issue43039] tempfile.TemporaryDirectory() name string is incorrect

2021-01-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Making str(td) == td.name does not seem useful.  I think this should be closed 
as 'Not a bug', because it isn't.  If changed to an enhancement request, reject 
as insufficiently warranted against the likely breakage.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue43034] Python tutorial misleads users about floor division behavior

2021-01-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

-17/3 = -5.667 = -6.0 + .333.  It is the latter 
fraction that gets discarded.

However, this is a frequent source of confusion.  How about adding 

>>> -17 // 3
-6
>>> -17 % 3
1
>>> -6 * 3 + 1
-17

to illustrate what we mean, without footnote or additional text.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue43065] 'concurrent.futures' stucks in 3.9.1

2021-01-29 Thread doublex


New submission from doublex :

Works with python 3.8
Fails with 3.9.1 (tested on CentOS 7 and Ubuntu 2004)
Yes, sometimes is does not stuck...

Command-line: 
python3.9 stuck.py

--
components: Interpreter Core
files: stuck.py
messages: 385931
nosy: doublex
priority: normal
severity: normal
status: open
title: 'concurrent.futures' stucks in 3.9.1
type: resource usage
versions: Python 3.9
Added file: https://bugs.python.org/file49775/stuck.py

___
Python tracker 

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



[issue43029] unittest: Add assertUniqeIn

2021-01-29 Thread Denis Roussel


Denis Roussel  added the comment:

Of course. Wanted a shortcut. Can close it if you want.

--

___
Python tracker 

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



[issue43029] unittest: Add assertUniqeIn

2021-01-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I think you meant assertEqual(len(alist), len(set(alist))).  I agree with 
others.

--
nosy: +terry.reedy
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed
type:  -> enhancement
versions: +Python 3.10

___
Python tracker 

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



[issue43006] Changed behaviour of inspect.signature() in Python 3.10

2021-01-29 Thread jack1142


Change by jack1142 :


--
nosy: +jack1142

___
Python tracker 

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



[issue43064] Impossible to override signal handler set with add_signal_handler in forked process

2021-01-29 Thread Selim Belhaouane

New submission from Selim Belhaouane :

Cannot clear signal handler set with loop.add_signal_handler in forked process 
with signal.signal

# Context

I'm running an async web server with uvicorn[1] and have background processes 
(using multiprocessing) doing CPU-bound work. uvicorn install signal handlers 
with loop.add*signal_handler, if available[2]. It also implements the common 
"attempt graceful shutdown on the first signal, and forcefully shutdown on the 
second (or more) signal" pattern. The problem I noticed was: when \_forking* at 
least one process, the server never gracefully shuts down, **even if I install 
new signal handlers in the subprocesses**.

# Problem

Signal handlers installed with loop.add*signal_handler cannot be cleared in 
forked processes with `signal.signal` (see Experiment 1), \_unless* using 
`signal.SIG_DFL` or `signal.SIG_IGN` in the forked processes (see Experiment 3).

For the record:

- When installing signal handlers in the parent process with signal.signal, 
this is not a problem (see Experiment 2).
- When using multiprocessing with the "spawn" method, this is not a problem. 
Unsurprising, since signal handlers are not inherited from the parent process 
when using "spawn" (see Experiment 4).
- When install signal handlers in the child proceess with 
loop.add_signal_handler, this is not a problem (see Experiment 5).

# Experiments

You'll find a minimal `exp.py` file in the attached archive. There's a few 
tweakable parameters at the top. I just run this with `python3.X exp.py`, wait 
a second or two, and hit Ctrl+C.
`results.txt` shows the results of a few experiments with different set of 
parameters.
Note that the point at which I hit Ctrl+C is indicated by the ♥ (heart) symbol, 
due to some terminal weirdness, although this is quite useful in this case!
The subsections below detail what happens when Ctrl+C is hit.
You guys probably know this already, but Ctrl+C basically sends SIGINT to all 
processes in the process tree.

## Experiment 1

- Installs a signal handler in the parent process with loop.add_signal_handler
- Starts 3 subprocesses with "fork"
- The subprocesses install a new signal handler with signal.signal

Outcome: both the parent handler and child handlers get called (3 calls to 
handle_sig_worker, 4 calls to handle_sig_main)

**Expected**: I would expect a single call to handle_sig_main, and 3 calls to 
handle_sig_worker, as in Experiment 2 (which uses signal.signal instead of 
loop.add_signal_handler) or Experiment 4 (which uses "spawn" instead of "fork") 
or Experiment 5 ()

## Experiment 2

As Experiment 1, but signal handlers are installed in the parent process with 
signal.signal

Outcome: the parent handler gets called once, and the child handlers get called 
3 times

## Experiment 3

Same as Experiment 1, but this time using `signal.SIG_DFL` as the callback in 
the child processes.

Outcome: the child processes immediately terminate, thanks to SIG_DFL, and the 
parent handler gets called only once!

## Experiment 4

Same as Experiment 1, but this time using "spawn" as the multiprocessing start 
method.

Outcome: same as Experiment 2: parent handlers gets called once, child handlers 
get called 3 times

## Experiment 5

Same as Experiment 1, but this time installing signal handlers in the child 
processes with loop.add_signal_handler.

Outcome: Same as Experiment 2.

# Environment

I was able to replicate the issue with python 3.7, 3.8, 3.9 and 3.10 (didn't 
even try 3.6) on Ubuntu 20.04. I obtained python via `apt`.

[1]: https://www.uvicorn.org/
[2]: 
https://github.com/encode/uvicorn/blob/61a6cabb4580e1c923df396eac264803f599412c/uvicorn/server.py#L281

--
components: asyncio
files: python-async-signal-bug.zip
messages: 385928
nosy: asvetlov, selimb, yselivanov
priority: normal
severity: normal
status: open
title: Impossible to override signal handler set with add_signal_handler in 
forked process
type: behavior
versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49774/python-async-signal-bug.zip

___
Python tracker 

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



[issue42966] argparse: customizable help formatter

2021-01-29 Thread Tadek Kijkowski


Change by Tadek Kijkowski :


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

___
Python tracker 

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



[issue43060] Convert _decimal C API from pointer array to struct

2021-01-29 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy:  -rhettinger

___
Python tracker 

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



[issue43062] Non-integer values in collections.Counter

2021-01-29 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the report, but there isn't anything that can be done about this.  
The core design concept for Counter was to be a regular dictionary augmented by 
a few capabilities that made it suitable for counting.  It isn't closed-off in 
any way.  On the plus side, that makes it versatile and make it fit well the 
other parts of the Python ecosystem that work with dictionaries.  On the minus, 
there is nothing to keep out data that doesn't make sense in the context of 
counting.

FWIW, there is a multiset package on PyPi that offers a closed-off 
implementation that has an internal dictionary that can only be accessed by 
methods that prevent negative counts or non-integer values.

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



[issue43008] IDLE ignores sys.excepthook in normal, subprocess mode

2021-01-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset bf782b2636880dd634281f905ae43b8555450ee2 by Miss Islington (bot) 
in branch '3.9':
bpo-43008: Add 'Patch by Ken Hilton' (GH-24370) (#24374)
https://github.com/python/cpython/commit/bf782b2636880dd634281f905ae43b8555450ee2


--

___
Python tracker 

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



[issue43008] IDLE ignores sys.excepthook in normal, subprocess mode

2021-01-29 Thread miss-islington


miss-islington  added the comment:


New changeset cf883827496d0fbe2c5fe39e4778cd7525f6f7bc by Miss Islington (bot) 
in branch '3.8':
bpo-43008: Add 'Patch by Ken Hilton' (GH-24370)
https://github.com/python/cpython/commit/cf883827496d0fbe2c5fe39e4778cd7525f6f7bc


--

___
Python tracker 

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



[issue42628] binascii doesn't work on some base64

2021-01-29 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue43008] IDLE ignores sys.excepthook in normal, subprocess mode

2021-01-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23196
pull_request: https://github.com/python/cpython/pull/24375

___
Python tracker 

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



[issue43008] IDLE ignores sys.excepthook in normal, subprocess mode

2021-01-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 11d75ec807f05eff1148c049e38b808d11c23b8a by Terry Jan Reedy in 
branch 'master':
bpo-43008: Add 'Patch by Ken Hilton' (GH-24370)
https://github.com/python/cpython/commit/11d75ec807f05eff1148c049e38b808d11c23b8a


--

___
Python tracker 

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



[issue43008] IDLE ignores sys.excepthook in normal, subprocess mode

2021-01-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23195
pull_request: https://github.com/python/cpython/pull/24374

___
Python tracker 

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



[issue38905] venv python reports wrong sys.executable in a subprocess on Windows

2021-01-29 Thread Alexander Stepanov


Alexander Stepanov  added the comment:

Another victim of this change in `venv` behavior is Ray, which hangs forever 
because the workers fail to register as parent does not recognize their PIDs.
https://github.com/ray-project/ray/issues/13794

--
nosy: +nirvana-msu

___
Python tracker 

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



[issue43008] IDLE ignores sys.excepthook in normal, subprocess mode

2021-01-29 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +23194
pull_request: https://github.com/python/cpython/pull/24370

___
Python tracker 

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



[issue42115] Caching infrastructure for the evaluation loop: specialised opcodes

2021-01-29 Thread Guido van Rossum


Guido van Rossum  added the comment:

I had a simpler idea for an inline cache for LOAD_METHOD than GH-23503. The 
essential part goes like this (sorry for the hybrid C/Python):

if :
if type == lm->type and type->tp_version_tag == lm->tp_version_tag:
meth = lm->meth
SET_TOP(meth)
PUSH(obj)
DISPATCH()

name = GETITEM(names, oparg)
meth_found = _PyObject_GetMethod(obj, name, &meth)


if meth_found:
SET_TOP(meth)
PUSH(obj)
if :
lm = ...
lm->type = type
lm->meth = meth



What am I missing? Why is the hash of the name needed?


Oh, it's probably because there could still be an overriding value in 
obj.__dict__. But certainly we could check for type == lm->type before the 
other checks (HasFeature and tp_version_tag).

But what if we only did this for classes without an instance dict? That could 
work for things like list.append and str.find.

--

___
Python tracker 

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



[issue42628] binascii doesn't work on some base64

2021-01-29 Thread Kent Watsen


Kent Watsen  added the comment:

I see.  There are two issues:

1) my `base64` and `openssl` CLI commands were flipped, as you point out, 
giving a false positive - oops ;)

2) more importantly, the base64 value "ue==" is invalid (there is no binary 
input that could possibly generate it) and none of the implementations issued a 
warning or error, which is reasonable IMO.

Thank you for your help.  Please close this issue.

--

___
Python tracker 

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



[issue43063] zipfile.Path / importlib.resources raises KeyError if a file wasn't found

2021-01-29 Thread Florian Bruhin


Florian Bruhin  added the comment:

Whoops, I was mistaken about Python 3.8 not being affected. I thought it 
wouldn't be because importlib.resources.files was added in 3.9, but 
zipfile.Path was added in 3.8.

With that in mind, I guess changing the behavior of 3.9 would be rather 
confusing, though I wonder what others think.

(Also, "arguably a backwards-compatible change" in my previous message should 
say *incompatible* - sorry about that!)

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



[issue38631] Replace Py_FatalError() with regular Python exceptions

2021-01-29 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +23193
pull_request: https://github.com/python/cpython/pull/24369

___
Python tracker 

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



[issue43063] zipfile.Path / importlib.resources raises KeyError if a file wasn't found

2021-01-29 Thread Florian Bruhin


New submission from Florian Bruhin :

When a package is installed as an egg, importlib.resources.files returns a 
zipfile.Path rather than a pathlib.Path (maybe it returns other things too, 
seeing that it's documented to return a importlib.abc.Traversable - I didn't 
check).

However, those two have a rather odd inconsistency when it comes to reading 
files which don't actually exist. In that case, zipfile.Path raises KeyError 
rather than FileNotFoundError. After a "zip tmp/test.zip somefile":

>>> import zipfile
>>> p = zipfile.Path('tmp/test.zip')
>>> (p / 'helloworld').read_text()
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.9/zipfile.py", line 2318, in read_text
with self.open('r', *args, **kwargs) as strm:
  File "/usr/lib/python3.9/zipfile.py", line 2306, in open
stream = self.root.open(self.at, zip_mode, pwd=pwd)
  File "/usr/lib/python3.9/zipfile.py", line 1502, in open
zinfo = self.getinfo(name)
  File "/usr/lib/python3.9/zipfile.py", line 1429, in getinfo
raise KeyError(
KeyError: "There is no item named 'helloworld' in the archive"

Note that the "zipp" backport (used by the "importlib_resources" backport) does 
raise FileNotFoundError instead:

>>> import zipp
>>> p2 = zipp.Path('tmp/test.zip')
>>> (p2 / 'helloworld').read_text()
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.9/site-packages/zipp.py", line 267, in read_text
with self.open('r', *args, **kwargs) as strm:
  File "/usr/lib/python3.9/site-packages/zipp.py", line 250, in open
raise FileNotFoundError(self)
FileNotFoundError: tmp/test.zip/helloworld

And of course, so does pathlib.Path:

>>> import pathlib
>>> p3 = pathlib.Path('tmp')
>>> (p3 / 'helloworld').read_text()
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.9/pathlib.py", line 1255, in read_text
with self.open(mode='r', encoding=encoding, errors=errors) as f:
  File "/usr/lib/python3.9/pathlib.py", line 1241, in open
return io.open(self, mode, buffering, encoding, errors, newline,
  File "/usr/lib/python3.9/pathlib.py", line 1109, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: 'tmp/helloworld'

When using `importlib.resources.files`, this can be very surprising - 
especially because during testing, the package might not be installed as an 
egg, so this never turns up until users complain about it (which is what 
happened in my case - no bad feelings though!).

This seems to have been fixed by jaraco in 
ebbe8033b1c61854c4b623aaf9c3e170d179f875, by introducing an explicit:

if not self.exists() and zip_mode == 'r':
raise FileNotFoundError(self)

in open(), as part of what seems like an unrelated change (bpo-40564 / 
GH-22371).

While this is arguably a backwards-compatible change between 3.9 and 3.10, it 
might be a good idea to either adjust Python 3.9 to have the same behavior 
(perhaps with a new exception which inherits from both KeyError and 
FileNotFoundError?). At the very least, I feel like this should be documented 
prominently in the importlib.resources.files, importlib.abc.Traversable and 
zipfile.Path documentation for 3.9.

As an aside, the error message when using `.iterdir()` is similarly confusing, 
though that's at least consistent between the stdlib and the zipp backport:

>>> (p / 'helloworld').iterdir()
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.9/zipfile.py", line 2342, in iterdir
raise ValueError("Can't listdir a file")
ValueError: Can't listdir a file

>>> (p2 / 'helloworld').iterdir()
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.9/site-packages/zipp.py", line 291, in iterdir
raise ValueError("Can't listdir a file")
ValueError: Can't listdir a file

>>> list((p3 / 'helloworld').iterdir())
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.9/pathlib.py", line 1149, in iterdir
for name in self._accessor.listdir(self):
FileNotFoundError: [Errno 2] No such file or directory: 'tmp/helloworld'

--
components: Library (Lib)
messages: 385919
nosy: The Compiler, alanmcintyre, brett.cannon, jaraco, serhiy.storchaka, 
twouters
priority: normal
severity: normal
status: open
title: zipfile.Path / importlib.resources raises KeyError if a file wasn't found
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue42380] Build windows binaries with MS VS2019 16.8+ / MSVC 19.28+

2021-01-29 Thread h-vetinari


h-vetinari  added the comment:

PPS. Also, the compiler implementation reference uses 19.x for MSVC: 
https://en.cppreference.com/w/cpp/compiler_support, which was the link I was 
trying to make, now that I'm looking at it.

--

___
Python tracker 

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



[issue42380] Build windows binaries with MS VS2019 16.8+ / MSVC 19.28+

2021-01-29 Thread h-vetinari


h-vetinari  added the comment:

PS.
> Judging from the link you posted to version numbering
https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering
 the first line should have 'MSVC 14.28' the middle column title should be 'MS 
Visual Studio'.

The wiki page was refactored quite extensively it seems, this is what I had 
been referring to: 
https://en.wikipedia.org/w/index.php?title=Microsoft_Visual_C%2B%2B&oldid=997067123.
 But I'll happily admit that I don't understand the reasons behind (the 
differences between) the various version numbers: MSVC++, _MSC_VER, etc.

--

___
Python tracker 

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



[issue42974] tokenize reports incorrect end col offset and line string when input ends without explicit newline

2021-01-29 Thread Guido van Rossum


Guido van Rossum  added the comment:

Do you still need my opinion? I can't say that I have one ATM.

--

___
Python tracker 

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



[issue43062] Non-integer values in collections.Counter

2021-01-29 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +rhettinger

___
Python tracker 

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



[issue30744] Local variable assignment is broken when combined with threads + tracing + closures

2021-01-29 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.10 -Python 2.7, 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



[issue43061] subprocess: feature request: Get only the stdout of the last shell command

2021-01-29 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue42979] _zoneinfo: zoneinfomodule_exec() doesn't check for PyDateTime_IMPORT failure

2021-01-29 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a6192635f1e62af2bb8a435487ebb51800edd671 by Victor Stinner in 
branch 'master':
bpo-42979: Use _Py_CheckSlotResult() to check slots result (GH-24356)
https://github.com/python/cpython/commit/a6192635f1e62af2bb8a435487ebb51800edd671


--

___
Python tracker 

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



[issue39232] asyncio crashes when tearing down the proactor event loop

2021-01-29 Thread Pandu E POLUAN


Change by Pandu E POLUAN :


--
nosy: +pepoluan

___
Python tracker 

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



[issue36470] dataclasses.replace raises an exception if InitVar with default argument is not provided.

2021-01-29 Thread Cosimo Lupo


Cosimo Lupo  added the comment:

any updates on this? Would be great if any of the two candidate PRs was merged. 
It's basically impossible to use replace() with default InitVars..
Thank you in advace

--
nosy: +anthrotype

___
Python tracker 

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



[issue43062] Non-integer values in collections.Counter

2021-01-29 Thread HuangFuSL


Change by HuangFuSL :


--
components: +Library (Lib) -Extension Modules

___
Python tracker 

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



[issue43062] Non-integer values in collections.Counter

2021-01-29 Thread HuangFuSL


New submission from HuangFuSL :

When I am creating a counter object provided by `collections.Counter` using a 
mapping object like a dictionary, it seems that Python will not check the 
validity of the values in the mapping object.

I've checked the following Python script could be successfully executed using 
Python 3.9.0 on Windows.

```python
>>> from collections import Counter
>>> a = Counter({'0': '0'})
>>> a.elements()

```

`a.elements()` returns a iterator, iterating through it will normally get the 
records counted by the `Counter`, but with a `str` object inside, iterating 
through it will make a `TypeError` raised.

```python
>>> for i in a.elements():
... pass
...
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'str' object cannot be interpreted as an integer
```

Meanwhile, if the counter contains values that cannot be compared such as 
`False` and `''`, `most_common()` method will fail.

```python
>>> b = Counter({'0': False, '1': ''})
>>> b.most_common()
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python39\lib\collections\__init__.py", line 610, in most_common
return sorted(self.items(), key=_itemgetter(1), reverse=True)
TypeError: '<' not supported between instances of 'bool' and 'str'
```

The `sys.version` variable of my Python interpreter is as follows:

```
>>> import sys
>>> sys.version
'3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)]'
>>>
```

I'm not sure whether the result is intentionally designed, but I think such 
execution results may lead to confusion.

--
components: Extension Modules
messages: 385913
nosy: HuangFuSL
priority: normal
severity: normal
status: open
title: Non-integer values in collections.Counter
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue43061] subprocess: feature request: Get only the stdout of the last shell command

2021-01-29 Thread R. David Murray


R. David Murray  added the comment:

This has nothing to do with python other than the fact that you are using it to 
capture stdout.  You have to figure out how to get the output you want to be 
what shows up on stdout, python has no knowledge of what commands you put in 
your shell script, and it *cannot* have any knowledge of that.  I think you 
need to learn more about basic shell scripting and unix pipelines and how 
stdout works.

Also note that making people nosy on an issue is not a good idea if you are not 
part of the triage team.  You should leave that for the bug triage people to 
do, as they know who's attention on the issue will be most useful.  In the 
future when you open an issue please simply wait a while for a response.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed
versions:  -Python 3.10

___
Python tracker 

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



[issue43061] subprocess: feature request: Get only the stdout of the last shell command

2021-01-29 Thread Christian Heimes


Change by Christian Heimes :


--
components: +Library (Lib)
versions: +Python 3.10 -Python 3.8

___
Python tracker 

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



[issue43061] subprocess: feature request: Get only the stdout of the last shell command

2021-01-29 Thread Christian Heimes


Christian Heimes  added the comment:

Please provide all information for your feature request in this ticket. We like 
to keep and archive all steps of the decision process in the same place. We 
also don't do stackoverflow-driven development.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue43061] subprocess: feature request: Get only the stdout of the last shell command

2021-01-29 Thread Kyle Altendorf


Kyle Altendorf  added the comment:

I'm not sure why I got added...  but as mentioned in the SO response, this 
isn't how stuff works.  Python isn't monitoring what subprocesses are created 
in the tree below the one Python itself creates nor does it have any way to 
know which line of which subprocess is creating any given output.

--

___
Python tracker 

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



[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-01-29 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +23192
pull_request: https://github.com/python/cpython/pull/24368

___
Python tracker 

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



[issue43061] subprocess: feature request: Get only the stdout of the last shell command

2021-01-29 Thread Riccardo La Marca


Change by Riccardo La Marca :


--
nosy: +altendky, paul.moore, serhiy.storchaka, steve.dower, tim.golden, 
vstinner, zach.ware

___
Python tracker 

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



[issue43061] subprocess: feature request: Get only the stdout of the last shell command

2021-01-29 Thread Riccardo La Marca


Change by Riccardo La Marca :


--
nosy: +monkeyman79, paul.j3, r.david.murray, v+python

___
Python tracker 

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



[issue43061] subprocess: feature request: Get only the stdout of the last shell command

2021-01-29 Thread Riccardo La Marca


New submission from Riccardo La Marca :

This is a link with some examples of the required functionality:
https://stackoverflow.com/questions/65952314

--
messages: 385909
nosy: Riccardo La Marca
priority: normal
severity: normal
status: open
title: subprocess: feature request: Get only the stdout of the last shell 
command
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



[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-29 Thread Tadek Kijkowski


Change by Tadek Kijkowski :


--
pull_requests: +23190
pull_request: https://github.com/python/cpython/pull/24367

___
Python tracker 

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



[issue14191] argparse doesn't allow optionals within positionals

2021-01-29 Thread Tadek Kijkowski


Change by Tadek Kijkowski :


--
pull_requests: +23191
pull_request: https://github.com/python/cpython/pull/24367

___
Python tracker 

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



[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-01-29 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset d6c33fbd346765c6a8654dccacb2338006bf2b47 by Mark Shannon in 
branch 'master':
bpo-42990: Introduce 'frame constructor' struct to simplify API for 
PyEval_CodeEval and friends (GH-24298)
https://github.com/python/cpython/commit/d6c33fbd346765c6a8654dccacb2338006bf2b47


--

___
Python tracker 

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



[issue25166] Windows AllUsers installation places uninstaller in user profile

2021-01-29 Thread James Russell


James Russell  added the comment:

I have been reviewing the Install process as we need to start installing / 
patching Python and I have seen the same issue as mentioned below however the 
difference for me is I am running the install on a Silent command line.  

I cannot seem to override "AllUsers" Property using the command line as WiX 
logs the following: "Ignoring attempt to set non-overridable variable: 
'AllUsers'."  If this parameter was made overridable I believe this would then 
allow the Bootstrapper to be listed under all users Uninstall area rather than 
the current user (or in my case it gets written to HKEY_USERS\.Default\... 
(which is really unhelpful) as the installer is being run under the system 
context).

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



[issue43060] Convert _decimal C API from pointer array to struct

2021-01-29 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +facundobatista, mark.dickinson, rhettinger, skrah

___
Python tracker 

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



[issue43020] str.lower method with "İ" character

2021-01-29 Thread Emir

Emir  added the comment:

Thanks for the answer. I will keep that in mind when posting another
"issue" instead of naming them as "bug".

Steven D'Aprano , 25 Oca 2021 Pzt, 13:22 tarihinde
şunu yazdı:

>
> Steven D'Aprano  added the comment:
>
> This is not a bug, but an issue with the way the Unicode standard defines
> the lowercase of dotted I.
>
> See #34723
>
> Fortunately, Unicode will (hopefully!) fix this in revision 14.0, which is
> scheduled to be included in Python 3.10.
>
> Until then, perhaps the simplest way to solve this is that if you are
> processing Turkish text, change your call to .lower() to .replace('İ',
> 'I').lower()
>
> --
> nosy: +steven.daprano
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue39010] ProactorEventLoop raises unhandled ConnectionResetError

2021-01-29 Thread robbiecares


Change by robbiecares :


--
nosy: +robbiecares

___
Python tracker 

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



[issue43029] unittest: Add assertUniqeIn

2021-01-29 Thread Denis Roussel


Denis Roussel  added the comment:

Indeed, can do 
assertNotEquals(len(the_list), len(set(the_list))

--

___
Python tracker 

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



[issue42380] Build windows binaries with MS VS2019 16.8+ / MSVC 19.28+

2021-01-29 Thread h-vetinari


h-vetinari  added the comment:

Hey Terry

I had asked about this on discuss 
(https://discuss.python.org/t/toolchain-upgrade-on-windows/6377/2), and Steve 
provided some very valuable input.

In particular, building with the newer VS (that supports C11) should stay 
ABI-compatible with everything that has been built on Visual Studio 2015, 2017 
and 2019:
> This is different from all previous Visual C++ versions, as they each had 
> their own distinct runtime files, not shared with other versions.

(from 
https://docs.microsoft.com/en-gb/cpp/windows/universal-crt-deployment?view=msvc-160&viewFallbackFrom=vs-2019),
 due to the way the (now-)universal runtime is designed.

Thanks

--

___
Python tracker 

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



[issue43009] Port curses capi pointer array to a struct

2021-01-29 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

FYI: I've opened bpo-43060 for the decimal module.

--

___
Python tracker 

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



[issue43009] Port curses capi pointer array to a struct

2021-01-29 Thread hai shi


hai shi  added the comment:

> The _decimal API is also just an array of pointers. Should we change that to 
> a struct as well?

Hi, victor. Do you have suggestion about it :)

--

___
Python tracker 

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



[issue43060] Convert _decimal C API from pointer array to struct

2021-01-29 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
type:  -> enhancement

___
Python tracker 

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



  1   2   >