[issue43310] Method __del__ with callable

2021-02-23 Thread Andrey Petukhov


New submission from Andrey Petukhov :

Is it possible to use callable to replace __del__ method of class?

if so, how to get self variable?

class A(object):
"""A."""


class C(object):
"""Callable."""
def __call__(self, *args, **kwargs):
print("call", args, kwargs)


def func_del(*args, **kwargs):
"""Method."""
print("func", args, kwargs)


def del_function():
"""
Test del.

('func', (<__main__.A object at 0x7f8ae5a82750>,), {})
('call', (), {})
"""
c = C()
A.__del__ = func_del
a = A()
del a
A.__del__ = c
a = A()
del a

--
components: Interpreter Core
messages: 387609
nosy: andribas404
priority: normal
severity: normal
status: open
title: Method __del__ with callable
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



[issue43297] bz2.open modes behaving differently than standard open() modes

2021-02-23 Thread Philipp Freyer


Philipp Freyer  added the comment:

I understand and accept that but I would recommend highlighting this difference 
in the documentation a bit more since this information can be easily skipped 
when reading the documentation.

I still find it important to hint to this stronger since I've seen countless 
code snippets and answers on Stackoverflow that either tell the user to use "r" 
for text mode and "rb" for binary or - if listing file open modes do not 
mention the "*t" modes at all.

If you can point me to where to suggest a change (or pull request) for the 
documentation, I am happy to propose a change myself :-)

--

___
Python tracker 

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



[issue36094] When using an SMTP SSL connection,, get ValueError.

2021-02-23 Thread Gert Burger


Change by Gert Burger :


--
nosy: +gertburger

___
Python tracker 

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



[issue43297] bz2.open modes behaving differently than standard open() modes

2021-02-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I concur with Josh and will mark this as closed.

It is unfortunate, but the time to get an API right is before it lands, not 
years after people have come to depend on it.

--
nosy: +rhettinger
resolution:  -> wont fix
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



[issue38119] resource tracker destroys shared memory segments when other processes should still have valid access

2021-02-23 Thread keven wang


keven wang  added the comment:

Agree w/ PR here to remove resource tracker unlinking as a quick fix: 
https://github.com/python/cpython/pull/15989

This will at least make the unlink behavior more controllable, which is not the 
case currently (on mac and linux).

Would love to have this merged.

--
nosy: +keven425

___
Python tracker 

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



[issue43297] bz2.open modes behaving differently than standard open() modes

2021-02-23 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

All of the compression modules (gzip, lzma) have this behavior, not just bz2; 
it's consistent in that sense. Changing it now, after literally decades with 
the old behavior, would needlessly break existing programs. As you say, it's 
documented clearly, I'm not seeing a gain to be had strong enough to violate 
the existing documentation.

--
nosy: +josh.r

___
Python tracker 

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



[issue43209] system cannot find the file specified in subprocess.py

2021-02-23 Thread Josh Rosenberg


Change by Josh Rosenberg :


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



[issue41841] idlelib/NEWS.txt for 3.10.0 and backports

2021-02-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 653e17b2cb35e6cd48e2bdca0c1b27b38bed7170 by Terry Jan Reedy in 
branch '3.8':
[3.8] bpo-41841: prepare for 3.8.9 (GH-24635)
https://github.com/python/cpython/commit/653e17b2cb35e6cd48e2bdca0c1b27b38bed7170


--

___
Python tracker 

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



[issue41841] idlelib/NEWS.txt for 3.10.0 and backports

2021-02-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset d81a20454eae1868059e45d54e0270e3b4d2e409 by Terry Jan Reedy in 
branch '3.9':
[3.9] bpo-41841: revise header (GH-24634)
https://github.com/python/cpython/commit/d81a20454eae1868059e45d54e0270e3b4d2e409


--

___
Python tracker 

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



[issue42151] Pure Python xml.etree.ElementTree is missing default attribute values

2021-02-23 Thread Dong-hee Na


Dong-hee Na  added the comment:

@obfusk
Thank you Felix for reporting and contributing!

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



[issue42151] Pure Python xml.etree.ElementTree is missing default attribute values

2021-02-23 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 1f433406bd46fbd00b88223ad64daea6bc9eaadc by Felix C. Stegerman in 
branch 'master':
bpo-42151: don't set specified_attributes=1 in pure Python ElementTree 
(GH-22987)
https://github.com/python/cpython/commit/1f433406bd46fbd00b88223ad64daea6bc9eaadc


--

___
Python tracker 

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



[issue41841] idlelib/NEWS.txt for 3.10.0 and backports

2021-02-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset b9fe16a02717e89a2141311de1e36161af4de9a9 by Terry Jan Reedy in 
branch 'master':
bpo-41841: Revise header (GH-24633)
https://github.com/python/cpython/commit/b9fe16a02717e89a2141311de1e36161af4de9a9


--

___
Python tracker 

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



[issue41841] idlelib/NEWS.txt for 3.10.0 and backports

2021-02-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Everything before x.y.0 is in one section. Multiple sections thereafter are a 
nuisance.  Idea: Put everything thereafter in one also.  So file is set once 
header revised after 3.x.0 is released.

 Thought of 'x.y.z: date' separator, with one line above and below, but not 
many users update each bugfix or so and we would be back to same problem.

--

___
Python tracker 

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



[issue41841] idlelib/NEWS.txt for 3.10.0 and backports

2021-02-23 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +23419
pull_request: https://github.com/python/cpython/pull/24635

___
Python tracker 

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



[issue41841] idlelib/NEWS.txt for 3.10.0 and backports

2021-02-23 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +23418
pull_request: https://github.com/python/cpython/pull/24634

___
Python tracker 

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



[issue41841] idlelib/NEWS.txt for 3.10.0 and backports

2021-02-23 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +23417
pull_request: https://github.com/python/cpython/pull/24633

___
Python tracker 

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



[issue43283] IDLE: Explain print slowness and speedup method

2021-02-23 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue43283] IDLE: Explain print slowness and speedup method

2021-02-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset bdf0fece5bbc2fc9fffbf0f314c7022e24e747df by Miss Islington (bot) 
in branch '3.8':
bpo-43283: Add IDLE doc paragraph about print speed (GH-24615) (GH-24632)
https://github.com/python/cpython/commit/bdf0fece5bbc2fc9fffbf0f314c7022e24e747df


--

___
Python tracker 

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



[issue43098] tarfile list() method does not show file type

2021-02-23 Thread Ethan Furman


Change by Ethan Furman :


--
assignee:  -> ethan.furman
nosy: +ethan.furman

___
Python tracker 

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



[issue43283] IDLE: Explain print slowness and speedup method

2021-02-23 Thread miss-islington


miss-islington  added the comment:


New changeset e202f1e4dbe02fbcae9f6afed863b7221b39c984 by Miss Islington (bot) 
in branch '3.9':
bpo-43283: Add IDLE doc paragraph about print speed (GH-24615)
https://github.com/python/cpython/commit/e202f1e4dbe02fbcae9f6afed863b7221b39c984


--

___
Python tracker 

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



[issue43209] system cannot find the file specified in subprocess.py

2021-02-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Steve, should this be closed as 'not a bug'?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue43283] IDLE: Explain print slowness and speedup method

2021-02-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23416
pull_request: https://github.com/python/cpython/pull/24632

___
Python tracker 

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



[issue43283] IDLE: Explain print slowness and speedup method

2021-02-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23415
pull_request: https://github.com/python/cpython/pull/24631

___
Python tracker 

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



[issue43283] IDLE: Explain print slowness and speedup method

2021-02-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 2827e8a177c2a6584fada594bca6829c53a2872f by Terry Jan Reedy in 
branch 'master':
bpo-43283: Add IDLE doc paragraph about print speed (GH-24615)
https://github.com/python/cpython/commit/2827e8a177c2a6584fada594bca6829c53a2872f


--

___
Python tracker 

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



[issue43309] str.replace() TypeError exception message backward

2021-02-23 Thread bland328


bland328  added the comment:

Dumb misunderstanding on my part--didn't realize replace() would actually work 
on a bytes-type object, so *I* had it backwards.

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



[issue43309] str.replace() TypeError exception message backward

2021-02-23 Thread bland328


New submission from bland328 :

Attempting to replace a character in a bytes string literal results in an 
exception saying that "a bytes-like object is required, not 'str'", when 
(unless I'm missing something) it should say the opposite.

To repro:

>>> x=b'abc'
>>> x.replace('a','z')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: a bytes-like object is required, not 'str'

--
messages: 387593
nosy: bland328
priority: normal
severity: normal
status: open
title: str.replace() TypeError exception message backward
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



[issue43263] threading module unable to run

2021-02-23 Thread twoone3


twoone3 <3197653...@qq.com> added the comment:

After my test, when the exe calls the dll, the dll calls Python. If the Python 
code involves multiple threads, the process will be stuck.

--
Added file: https://bugs.python.org/file49831/test.zip

___
Python tracker 

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



[issue43229] freeze searches libpython3.9.so in /usr/lib instead /usr/lib/x86_64-linux-gnu

2021-02-23 Thread Ned Deily


Change by Ned Deily :


--
nosy: +doko

___
Python tracker 

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



[issue43146] 3.10a5 regression: AttributeError: 'NoneType' object has no attribute '__suppress_context__' in traceback.py

2021-02-23 Thread Irit Katriel


Change by Irit Katriel :


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



[issue43251] [sqlite3] sqlite3_column_name() failures should raise MemoryError

2021-02-23 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Larry Brasfield's comment https://sqlite.org/forum/forumpost/6430fc589d?t=h 
aligns with https://bugs.python.org/issue43251#msg387428

I'll think twice before posting there again, though.

--

___
Python tracker 

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



[issue43263] threading module unable to run

2021-02-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

[twoone3]

> Have you been studying this problem?

Not personally, no. Sorry, but I'm afraid this really isn't an actionable bug 
report as it stands: we still don't have an effective way to reproduce, and 
it's far from clear that this is actually a bug in CPython as opposed to a bug 
somewhere in the BDSpyrunner code.

If you're able to produce (and attach to this issue) a minimal self-contained 
C++ file that exhibits the issue, that could help increase the chances that we 
can confirm the existence of a CPython bug. Even better, if you're able to 
diagnose the issue yourself to the point where there's a clear CPython bug to 
report, that's much more likely to lead to a fix. (And those two actions - 
producing a minimal example, and diagnosis, should be largely compatible.)

--

___
Python tracker 

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



[issue43308] subprocess.Popen leaks file descriptors opened for DEVNULL or PIPE stdin/stdout/stderr arguments

2021-02-23 Thread cptpcrd


New submission from cptpcrd :

TL;DR: subprocess.Popen's handling of file descriptors opened for DEVNULL or 
PIPE inputs/outputs has serious problems, and it can be coerced into leaking 
file descriptors in several ways. This can cause issues related to resource 
exhaustion.

# The basic problem

As part of its setup, Popen.__init__() calls Popen._get_handles(), which looks 
at the given stdin/stdout/stderr arguments and returns a tuple of 6 file 
descriptors (on Windows, file handles) indicating how stdin/stdout/stderr 
should be redirected. However, these file descriptors aren't properly closed if 
exceptions occur in certain cases.

# Variant 1: Bad argument errors (introduced in 3.9)

The first variant of this bug is shockingly easy to reproduce (note that this 
only works on platforms with /proc/self/fd, like Linux):

```
import os, subprocess

def show_fds():
for entry in os.scandir("/proc/self/fd"):
print(entry.name, "->", os.readlink(entry.path))

print("Before:")
show_fds()

try:
subprocess.Popen(["ls"], stdin=subprocess.PIPE, user=1.0)
except TypeError as e:  # "User must be a string or an integer"
print(e)

print("After:")
show_fds()
```

This produces something like:

```
Before:
0 -> /dev/pts/1
1 -> /dev/pts/1
2 -> /dev/pts/1
3 -> /proc/12345/fd
User must be a string or an integer
After:
0 -> /dev/pts/1
1 -> /dev/pts/1
2 -> /dev/pts/1
3 -> pipe:[1234567]
3 -> pipe:[1234567]
5 -> /proc/12345/fd
```

The process never got launched (because of the invalid `user` argument), but 
the (unused) pipe created for piping to stdin is left open! Substituting 
DEVNULL for PIPE instead leaves a single file descriptor open to `/dev/null`.

This happens because the code that validates the `user`, `group`, and 
`extra_groups` arguments [1] was added to Popen.__init__() *after* the call to 
Popen._get_handles() [2], and there isn't a try/except that closes the file 
descriptors if an exception gets raised during validation (which can easily 
happen).

# Variant 2: Error opening file descriptors (seems to have been around in 
`subprocess` forever)

Within Popen._get_handles() (on Windows [3] or POSIX [4]), previously opened 
file descriptors are not closed if an error occurs while opening later file 
descriptors.

For example, take the case where only one more file descriptor can be opened 
without hitting the limit on the number of file descriptors, and 
`subprocess.Popen(["ls"], stdin=subprocess.DEVNULL, stdout=supbrocess.PIPE)` is 
called. subprocess will be able to open `/dev/null` for stdin, but trying to 
creating a `pipe()` for stdout will fail with EMFILE or ENFILE. Since 
Popen._get_handles() doesn't handle exceptions from `pipe()` (or when opening 
`/dev/null`), the `/dev/null` file descriptor opened for stdin will be be left 
open.

This variant is most easily triggered by file descriptor exhaustion, and it 
makes that problem worse by leaking even *more* file descriptors.

Here's an example that reproduces this by monkey-patching `os` to force an 
error:

```
import os, subprocess

def show_fds():
for entry in os.scandir("/proc/self/fd"):
print(entry.name, "->", os.readlink(entry.path))

print("Before:")
show_fds()

# Trigger an error when trying to open /dev/null
os.devnull = "/NOEXIST"

try:
subprocess.Popen(["ls"], stdin=subprocess.PIPE, stdout=subprocess.DEVNULL)
except FileNotFoundError as e:  # "User must be a string or an integer"
print(e)

print("After:")
show_fds()
```

Output:

```
Before:
0 -> /dev/pts/1
1 -> /dev/pts/1
2 -> /dev/pts/1
3 -> /proc/12345/fd
[Errno 2] No such file or directory: '/dev/null'
After:
0 -> /dev/pts/1
1 -> /dev/pts/1
2 -> /dev/pts/1
3 -> pipe:[1234567]
4 -> pipe:[1234567]
5 -> /proc/12345/fd
```

Again, the pipe is left open.

# Paths to fix.

Variant 1 can be fixed by simply reordering code in Popen.__init__() (and 
leaving comments warning about the importance of maintaining the order!). I've 
attached a basic patch that does this.

Variant 2 might take some more work -- especially given the shared 
Popen._devnull file descriptor that needs to be accounted for separately -- and 
may require significant changes to both Popen.__init__() and 
Popen._get_handles() to fix.

[1]: https://github.com/python/cpython/blob/master/Lib/subprocess.py#L872
[2]: https://github.com/python/cpython/blob/master/Lib/subprocess.py#L840
[3]: https://github.com/python/cpython/blob/master/Lib/subprocess.py#L1251
[4]: https://github.com/python/cpython/blob/master/Lib/subprocess.py#L1581

--
components: Library (Lib)
files: subprocess-validation-fd-leak.patch
keywords: patch
messages: 387589
nosy: cptpcrd
priority: normal
severity: normal
status: open
title: subprocess.Popen leaks file descriptors opened for DEVNULL or PIPE 
stdin/stdout/stderr arguments
type: resource usage
versions: Python 3.10, Python 3.8, Python 3.9
Added file: 
https://bugs.python.org/file49830/subprocess-validation-fd-leak.patch


[issue43115] locale.getlocale fails if locale is set

2021-02-23 Thread Eryk Sun


Eryk Sun  added the comment:

> All getlocale is used for in _strptime.py is comparing the value 
> returned to the previous value returned.

Which is why _strptime should be calling setlocale(LC_TIME), the same as the 
calendar module. That's not to say that I don't think getlocale() and 
normalize() need to be fixed. But returning None for the encoding when there's 
no codeset, while it works for a few cases, doesn't address many other cases.

For example, normalize() and getlocale() will often be wrong in many cases when 
an encoding is guessed, such as normalize('en_US') -> 'en_US.ISO8859-1' and 
normalize('ja_JP') -> 'ja_JP.eucJP'. The encoding is wrong, plus no encoding 
except UTF-8 is allowed in a BCP-47 locale, so setlocale() will fail. 

In all but four cases, classic ucrt "language_country.codepage" locales such as 
"Japanese_Japan.932" are parsed in a 'benignly' incorrect way (i.e. not as RFC 
1766 language tags), which at least roundtrips with setlocale(). It simply 
splits out the codeset, e.g. ('Japanese_Japan', '932'). The four misbehaving 
cases are actually the ones for which getlocale() works as documented because 
the locale_alias mapping has an entry for them.

* "French_France.1252" -> ('fr_FR', 'cp1252')
* "German_Germany.1252" -> ('de_DE', 'cp1252')
* "Portuguese_Brazil.1252" -> ('pt_BR', 'cp1252')
* "Spanish_Spain.1252" -> ('es_ES', 'cp1252')

The problem is that the parsed tuples don't roundtrip because normalize() keeps 
the encoding, complete with the 'cp' prefix, and only UTF-8 is allowed in a 
BCP-47 locale. For example:

>>> locale.setlocale(locale.LC_CTYPE, 'French_France.1252')
'French_France.1252'
>>> locale.getlocale()
('fr_FR', 'cp1252')
>>> locale.normalize(locale._build_localename(locale.getlocale()))
'fr_FR.cp1252'
>>> try: locale.setlocale(locale.LC_CTYPE, locale.getlocale())
... except locale.Error as e: print(e)
...
unsupported locale setting

I suppose normalize() could be special cased in Windows to look for a BCP-47 
locale and omit the encoding if it's not UTF-8. I suppose _parse_localename() 
could be special cased to use None for the encoding if there's no codeset. But 
this just leaves me feeling unsettled and disappointed that we could be doing a 
better job of providing the documented behavior of getlocale() and normalize() 
by implementing them separately for Windows using the tools that the OS 
provides.

FYI, I've commented on this problem across a few issues, including bpo-20088 
and bpo-23425 in early 2015, and then extensively in bpo-37945 in mid 2019. 
Plus my latest comments in msg387256 in this issue. The latter suggestions 
could be combined with something like the mapping that's generated by the code 
in msg235937 in bpo-23425, in order to parse a classic ucrt locale string such 
as "Japanese_Japan.932" properly as ("ja_JP", "cp932"), and then build and 
normalize it back as "Japanese_Japan.932".

--

___
Python tracker 

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



[issue43146] 3.10a5 regression: AttributeError: 'NoneType' object has no attribute '__suppress_context__' in traceback.py

2021-02-23 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset b798ab06937f8bb24b444a49dd42e11fff15e654 by Irit Katriel in 
branch 'master':
bpo-43146: fix None-handling in single-arg traceback.print_exception(None) 
(GH-24629)
https://github.com/python/cpython/commit/b798ab06937f8bb24b444a49dd42e11fff15e654


--

___
Python tracker 

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



[issue43146] 3.10a5 regression: AttributeError: 'NoneType' object has no attribute '__suppress_context__' in traceback.py

2021-02-23 Thread Irit Katriel


Irit Katriel  added the comment:

The new PR makes it print `NoneType: None`, which is at least consistent with 
what the same functions do without the Issue26389 shortcut.

--

___
Python tracker 

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



[issue43146] 3.10a5 regression: AttributeError: 'NoneType' object has no attribute '__suppress_context__' in traceback.py

2021-02-23 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +23414
pull_request: https://github.com/python/cpython/pull/24629

___
Python tracker 

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



[issue43307] Sync site.py and sysconfig.py with PyPy

2021-02-23 Thread mattip


Change by mattip :


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

___
Python tracker 

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



[issue42994] Missing MIME types for opus, AAC, 3gpp and 3gpp2

2021-02-23 Thread Nathan Beals


Nathan Beals  added the comment:

As per the instructions on the contributing guide, I'm "pinging" this issue 
after 30 days.

--

___
Python tracker 

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



[issue43307] Sync site.py and sysconfig.py with PyPy

2021-02-23 Thread mattip


New submission from mattip :

PyPy added some enhancements to sysconfig.py to deal with multiple 
implementations. site.py copies parts of sysconfig.py to save time when 
importing. It would be nice to backport these enhamncements, maybe other 
implementations could reuse them.

--
components: Installation
messages: 387583
nosy: mattip
priority: normal
severity: normal
status: open
title: Sync site.py and sysconfig.py with PyPy
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



[issue43146] 3.10a5 regression: AttributeError: 'NoneType' object has no attribute '__suppress_context__' in traceback.py

2021-02-23 Thread Irit Katriel


Irit Katriel  added the comment:

> So the remaining question is what to do for print_exception(None)? 

Yes.

> Honestly the current (new) behavior of printing `NoneType: None` seems fine.

That's not the current behaviour - I removed that fix from the PR till we agree 
what to do. Currently we get the AttributeError.

--

___
Python tracker 

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



[issue43146] 3.10a5 regression: AttributeError: 'NoneType' object has no attribute '__suppress_context__' in traceback.py

2021-02-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

So the remaining question is what to do for print_exception(None)? Honestly
the current (new) behavior of printing `NoneType: None` seems fine.

--

___
Python tracker 

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



[issue43146] 3.10a5 regression: AttributeError: 'NoneType' object has no attribute '__suppress_context__' in traceback.py

2021-02-23 Thread Irit Katriel


Irit Katriel  added the comment:

The PR just merged fixes the issue that was reported by Florian (what I broke). 
That impacted pre-3.10 APIs so was an actual regression.

The issue with traceback.print_exception(None) is new to 3.10, and was 
introduced in issue 26389.

--

___
Python tracker 

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



[issue43146] 3.10a5 regression: AttributeError: 'NoneType' object has no attribute '__suppress_context__' in traceback.py

2021-02-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

So the PR just merged fixes that, right? Color me confused.

--

___
Python tracker 

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



[issue37736] asyncio.wait_for is still confusing

2021-02-23 Thread Andrew Borba


Andrew Borba  added the comment:

> The key word here is "misbehaving". Cooperative concurrency does require 
> cooperation.

Your stance makes sense in an ideal environment where we control every Task 
that our application deals with. However, there are some cases in which busted 
Task cancellation logic is out of our control to fix, and in some cases it may 
be critical to strictly enforce a timeout regardless of what a Task does. If 
wait_for is only to be used as a best effort, then we need a nuclear option as 
well.

--
nosy: +andrewborba

___
Python tracker 

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



[issue43306] Error in multiprocessing.Pool's initializer doesn't stop execution

2021-02-23 Thread Dávid Nemeskey

New submission from Dávid Nemeskey :

There is an inconsistency in how multiprocessing.Pool handles exceptions thrown 
in the workers:
- exceptions raised by the mapped function stop execution right away
- exceptions raised in an initializer are ignored and the pool continues 
spawning new workers indefinitely, each of them failing.

I believe the behavior should be the same in both cases, and of the two, the 
first one is preferable (especially since that's what people are used to).

The documentation doesn't cover how exceptions are handled in pools, either.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 387577
nosy: docs@python, nemeskeyd
priority: normal
severity: normal
status: open
title: Error in multiprocessing.Pool's initializer doesn't stop execution
type: behavior
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



[issue43229] freeze searches libpython3.9.so in /usr/lib instead /usr/lib/x86_64-linux-gnu

2021-02-23 Thread Christian Bachmaier


Change by Christian Bachmaier :


--
type:  -> compile error

___
Python tracker 

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



[issue43229] freeze searches libpython3.9.so in /usr/lib instead /usr/lib/x86_64-linux-gnu

2021-02-23 Thread Christian Bachmaier


Christian Bachmaier  added the comment:

The same situation in Ubuntu development branch's package python3.9.2-0ubuntu2 .

Inserting the follwing

if sysconfig.get_config_var('MULTIARCH'):
masd = sysconfig.get_config_var('multiarchsubdir')
if masd.startswith(os.sep):
masd = masd[len(os.sep):]
libdir = os.path.join(libdir, masd)

directly after line ~ 247 in freeze.py

libdir = sysconfig.get_config_var('LIBDIR')

seems to fix the first problem.

--

___
Python tracker 

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



[issue43146] 3.10a5 regression: AttributeError: 'NoneType' object has no attribute '__suppress_context__' in traceback.py

2021-02-23 Thread Irit Katriel


Irit Katriel  added the comment:

The other thing is not related to the one reported here, but I found it while 
writing the test for this. 

We have a new API in 3.10, where you can do traceback.print_exception(ex)   (so 
you don't need to give the whole type,val,tb triplet).

But:

>>> traceback.print_exception(None)
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Users\User\src\cpython-dev\lib\traceback.py", line 110, in 
print_exception
value, tb = _parse_value_tb(exc, value, tb)
  File "C:\Users\User\src\cpython-dev\lib\traceback.py", line 94, in 
_parse_value_tb
return exc, exc.__traceback__
AttributeError: 'NoneType' object has no attribute '__traceback__'

--

___
Python tracker 

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



[issue43146] 3.10a5 regression: AttributeError: 'NoneType' object has no attribute '__suppress_context__' in traceback.py

2021-02-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

Are you going to create a separate PR or a new issue for the other thing? (And 
what exactly *is* the other thing? Please summarize.)

--

___
Python tracker 

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



[issue43146] 3.10a5 regression: AttributeError: 'NoneType' object has no attribute '__suppress_context__' in traceback.py

2021-02-23 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 26f18b8540b49d592af66361f8df1a03953d1768 by Irit Katriel in 
branch 'master':
bpo-43146: fix regression in traceback.print_exception(None) (GH-24463)
https://github.com/python/cpython/commit/26f18b8540b49d592af66361f8df1a03953d1768


--
nosy: +gvanrossum

___
Python tracker 

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



[issue43263] threading module unable to run

2021-02-23 Thread twoone3


twoone3 <3197653...@qq.com> added the comment:

Have you been studying this problem?

--

___
Python tracker 

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



[issue43292] xml.ElementTree iterparse filehandle left open

2021-02-23 Thread Tom Dougherty


Tom Dougherty  added the comment:

"erase all files"

--
nosy: +dtom9424
type: crash -> security

___
Python tracker 

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



[issue43305] A typo in /Modules/_io/bufferedio.c

2021-02-23 Thread Ma Lin

New submission from Ma Lin :

654PyErr_Fetch(, , );
655if (v == NULL || !PyErr_GivenExceptionMatches(v, PyExc_BlockingIOError)) 
{
 ↑  this should be t
https://github.com/python/cpython/blob/v3.10.0a5/Modules/_io/bufferedio.c#L654-L655

Does this need a test case?

--
components: IO
messages: 387570
nosy: malin
priority: normal
severity: normal
status: open
title: A typo in /Modules/_io/bufferedio.c
type: behavior
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



[issue42151] Pure Python xml.etree.ElementTree is missing default attribute values

2021-02-23 Thread mattip


mattip  added the comment:

PyPy issue https://foss.heptapod.net/pypy/pypy/-/issues/3181 shows another 
problem with the pure-python ElementTree implementation, that again is not 
reflected in the C implementation. Is there a code owner for this stdlib module?

--

___
Python tracker 

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



[issue37198] _parse_localename fail to parse 'en_IL'

2021-02-23 Thread Eryk Sun


Change by Eryk Sun :


--
Removed message: https://bugs.python.org/msg345454

___
Python tracker 

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



[issue17441] Do not cache re.compile

2021-02-23 Thread abcdenis


abcdenis  added the comment:

JFYI.
regex library now supports avoiding cache:

https://bitbucket.org/mrabarnett/mrab-regex/issues/387/compilaton-flag-to-avoid-storing-compiled#comment-59117125

--
nosy: +abcdenis

___
Python tracker 

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



[issue43251] [sqlite3] sqlite3_column_name() failures should raise MemoryError

2021-02-23 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Sure! Here it is: https://sqlite.org/forum/forumpost/574c6bc66c

--

___
Python tracker 

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



[issue43251] [sqlite3] sqlite3_column_name() failures should raise MemoryError

2021-02-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Could you please give a link to the discussion?

--

___
Python tracker 

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



[issue43251] [sqlite3] sqlite3_column_name() failures should raise MemoryError

2021-02-23 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

After discussing the matter briefly on the SQLite forum, I'm no longer 100% 
certain about this. There seems to be uncertainty about which other conditions 
can produce NULL, although memory error seems to be the most probable. I 
consider closing both this issue and the PR and just leave the code as it is.

--

___
Python tracker 

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



[issue43239] PyCFunction_New is not exported with PyAPI_FUNC

2021-02-23 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset 7bb1cafa4e3d648669212ea4c6d11d6eafc6da23 by Petr Viktorin in 
branch 'master':
bpo-43239: Export PyCFunction_New with PyAPI_FUNC (GH-24551)
https://github.com/python/cpython/commit/7bb1cafa4e3d648669212ea4c6d11d6eafc6da23


--

___
Python tracker 

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



[issue42627] urllib.request.getproxies() misparses Windows registry proxy settings

2021-02-23 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue43298] Windows build cannot detect missing Windows SDK

2021-02-23 Thread Kevin Thomas


Kevin Thomas  added the comment:

Hi Steve actually there was none installed which was strange as I had Visual 
Studio installed but it was not checked by default.  After selecting it and 
installing it, everything works as expected.  Updating the error message in 
some way might be helpful.

--

___
Python tracker 

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



[issue43304] THONNY 3.3.0 failing to install package MULTIPROCESSING

2021-02-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

Closing as third-party. But for the record, I suspect the problem here is 
arising from confusion between standard library modules and third-party 
packages: the multiprocessing package is not a 3rd party package like NumPy 
(for example): instead, it's part of Python's standard library.

So multiprocessing doesn't need to be listed in your requirements file and 
doesn't need to be installed from PyPI: just do an "import multiprocessing" in 
your script and away you go.

--
nosy: +mark.dickinson
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue22673] document the special features (eg: fdclose=False) of the standard streams

2021-02-23 Thread Eryk Sun


Change by Eryk Sun :


--
components: +IO
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5

___
Python tracker 

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



[issue22976] multiprocessing Queue empty() is broken on Windows

2021-02-23 Thread Eryk Sun


Change by Eryk Sun :


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



[issue22961] ctypes.WinError & OSError

2021-02-23 Thread Eryk Sun


Change by Eryk Sun :


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



[issue43298] Windows build cannot detect missing Windows SDK

2021-02-23 Thread Steve Dower


Steve Dower  added the comment:

> I did not have the latest installed which is Win10SDK_10.0.18362, therefore 
> it did trigger that original error in msg387518.

Did you have any other version installed? It should include one by 
default, which is why we don't mention it in the quick instructions, but 
I think you can remove it at install time.

--

___
Python tracker 

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



[issue42800] Traceback objects allow accessing frame objects without triggering audit hooks

2021-02-23 Thread Steve Dower


Steve Dower  added the comment:

Thanks for the ping. I'll try and check in later this week to finish it up.

--

___
Python tracker 

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



[issue43261] Python 3.9 repair on Windows do not recover pip module

2021-02-23 Thread Steve Dower


Steve Dower  added the comment:

Thanks! Interestingly, it seems like it ought to have re-run, but 
decided not to. I wonder if there's been some change to how Windows 
Installer deals with using registry keys to control custom actions?

Unfortunately, MSI is an incredibly complicated installer, which is why 
I like the Store package so much better (and one day, hopefully we can 
distribute the packages directly, but right now they require admin so I 
don't want to).

I'll have to dig into the options for the pip.wxs file in our installer 
to see whether we can just force it to re-run on repair.

To force restore it yourself, open an admin prompt and run "python.exe 
-m ensurepip". That's all the installer is going to do.

--

___
Python tracker 

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



[issue43115] locale.getlocale fails if locale is set

2021-02-23 Thread Anders Munch


Anders Munch  added the comment:

>> What does use getlocale is time.strptime and datetime.datetime.strptime, so 
>> when getlocale fails, strptime fails.

> Would they work with getlocale() returning None for the encoding ?

Yes. All getlocale is used for in _strptime.py is comparing the value returned 
to the previous value returned.

I expect changing _strptime._getlang to return the unnormalized value 
locale._setlocale(locale.LC_TIME, None) would work as well and more robustly.

--

___
Python tracker 

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



[issue43304] THONNY 3.3.0 failing to install package MULTIPROCESSING

2021-02-23 Thread Andre Roberge


Andre Roberge  added the comment:

Thonny has its own discussion site where you can report such problems: 
https://groups.google.com/g/thonny

--
nosy: +aroberge

___
Python tracker 

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



[issue35056] Test leaks of memory not managed by Python allocator

2021-02-23 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue22299] resolve() on Windows makes some pathological paths unusable

2021-02-23 Thread Eryk Sun


Eryk Sun  added the comment:

ntpath.realpath() has since been implemented, and it addresses the problem by 
keeping the extended (verbatim) path prefix in the result if the input argument 
has it, and otherwise removing the prefix if the final path resolves correctly 
without it.

--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue43303] ASAN : Memory leak in compilation

2021-02-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

To run the address sanitizer you need to deactivate pymalloc and pass some of 
the asan flags to avoid false positives. Check our our buildbot configuration 
for it:

https://github.com/python/buildmaster-config/blob/master/master/custom/factories.py#L223

This looks like a false positive to me.

--

___
Python tracker 

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



[issue43261] Python 3.9 repair on Windows do not recover pip module

2021-02-23 Thread Svyatoslav


Svyatoslav  added the comment:

Attached logs created right before I created this post.

--
Added file: https://bugs.python.org/file49829/Temp.zip

___
Python tracker 

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



[issue33376] [pysqlite] Duplicate rows can be returned after rolling back a transaction

2021-02-23 Thread Ma Lin


Change by Ma Lin :


--
nosy: +erlendaasland

___
Python tracker 

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