[issue45198] __set_name__ documentation not clear about its usage with non-descriptor classes

2021-09-17 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +26847
pull_request: https://github.com/python/cpython/pull/28444

___
Python tracker 

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



[issue45198] __set_name__ documentation not clear about its usage with non-descriptor classes

2021-09-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 94b462686b7dfabbd69cc9401037d736d71c4dc2 by Raymond Hettinger in 
branch 'main':
bpo-45198: __set_name__ documentation not clear about its usage with 
non-descriptor classes (GH-28439)
https://github.com/python/cpython/commit/94b462686b7dfabbd69cc9401037d736d71c4dc2


--

___
Python tracker 

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



[issue45235] argparse does not preserve namespace with subparser defaults

2021-09-17 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger
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



[issue45235] argparse does not preserve namespace with subparser defaults

2021-09-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset a18d52269ab6071a605d6c72f6af585a4c533ca4 by Miss Islington (bot) 
in branch '3.9':
bpo-45235: Fix argparse overrides namespace with subparser defaults (GH-28420) 
(GH-28443)
https://github.com/python/cpython/commit/a18d52269ab6071a605d6c72f6af585a4c533ca4


--

___
Python tracker 

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



[issue45235] argparse does not preserve namespace with subparser defaults

2021-09-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 6e4101add568910409294554c8e863226a66bb64 by Miss Islington (bot) 
in branch '3.10':
bpo-45235: Fix argparse overrides namespace with subparser defaults (GH-28420) 
(GH-28442)
https://github.com/python/cpython/commit/6e4101add568910409294554c8e863226a66bb64


--

___
Python tracker 

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



[issue45235] argparse does not preserve namespace with subparser defaults

2021-09-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26846
pull_request: https://github.com/python/cpython/pull/28443

___
Python tracker 

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



[issue45235] argparse does not preserve namespace with subparser defaults

2021-09-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset a6e8db5e8e6780411db749d404715dbe021647c7 by Adam Schwalm in 
branch 'main':
bpo-45235: Fix argparse overrides namespace with subparser defaults (GH-28420)
https://github.com/python/cpython/commit/a6e8db5e8e6780411db749d404715dbe021647c7


--
nosy: +rhettinger

___
Python tracker 

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



[issue45235] argparse does not preserve namespace with subparser defaults

2021-09-17 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +26845
pull_request: https://github.com/python/cpython/pull/28442

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-09-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Raymond, do you think we should also freeze the dependencies
> of runpy (so "python -m " also starts faster)?

Yes, please.  

The '-m' load option can be considered core startup functionality.  It is often 
the recommended way to launch command line tools outside of a virtual 
environment.

   python -m pip install some_package

--

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-09-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

> It would be nice to freeze argparse.py and its dependencies.  For 
> command-line tools, startup time is important.

I quickly checked, and argparse has at least these dependencies:

argparse
re
enum
types
operator
functools
collections
keyword
reprlib
sre_compile
sre_parse
sre_constants
copyreg
gettext

Raymond, do you think we should also freeze the dependencies of runpy (so 
"python -m " also starts faster)?

That would be

runpy
importlib
warnings
importlib.machinery
importlib.util
importlib._abc
contextlib
collections
keyword
operator
reprlib
functools
types

(I didn't dedupe this from the previous list.)

With all these modules frozen we'd probably run more risk of two things:

- frozen modules don't have a __file__ (and are missing a few other, less 
commonly used, attributes)
- editing a frozen module requires rebuilding, or running with -X 
frozen_modules=off

--

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread neonene


neonene  added the comment:

> (32-bit: "1.07", 64-bit: "1.14": "higher the slower" wrote neonene)

32-bit and 64-bit are in reverse. I compared b1 and a7 because this can be 
confirmed by anyone with official binary. If 7% of my patch has little to do 
with the gap, then I will be happy that 3.10 can be far faster.

>How can I build Python with PGO on Windows?

Try the following,

   PCbuild\build.bat -p x64 --no-tkinter --pgo

Before building, your object.h needs to replace
static inline int Py_ALWAYS_INLINE
with
static Py_ALWAYS_INLINE int 

In my case, pgo got stuck on linking with the object.h.


I'm waiting the reply from developercommunity.

--

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-09-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

It would be nice to freeze argparse.py and its dependencies.  For command-line 
tools, startup time is important.

--
nosy: +rhettinger

___
Python tracker 

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



[issue45178] Support linking unnamed temp files into filesystem on Linux

2021-09-17 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
stage:  -> test needed
title: Support for linking unnamed temporary files into filesystem on Linux -> 
Support linking unnamed temp files into filesystem on Linux
versions: +Python 3.11

___
Python tracker 

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



[issue45176] Many regtest failures on Windows with non-ASCII account name

2021-09-17 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue45198] __set_name__ documentation not clear about its usage with non-descriptor classes

2021-09-17 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue45183] Unexpected exception with zip importer

2021-09-17 Thread Brett Cannon


Brett Cannon  added the comment:

I decided that find_spec() saying something wasn't available in a finder made 
sense even though it was because a zip file no longer existed as the loader 
would still fail as appropriate.

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



[issue45183] Unexpected exception with zip importer

2021-09-17 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset e1bdecb6dc7ac33256d5fa875d45634512d2a90e by Brett Cannon in 
branch '3.10':
[3.10] bpo-45183: don't raise an exception when calling 
zipimport.zipimporter.find_spec() when the zip file is missing and the internal 
cache has been reset (GH-28435) (#28438)
https://github.com/python/cpython/commit/e1bdecb6dc7ac33256d5fa875d45634512d2a90e


--

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-09-17 Thread Eric Snow


Eric Snow  added the comment:

On Fri, Sep 17, 2021 at 4:22 PM Guido van Rossum  wrote:
> BTW, why does the script still run Programs/_freeze_module over all the 
> modules to be frozen? Isn't that up to the Makefile or its Windows equivalent?

Yeah, it used to matter but we probably don't need to do that any longer.

--

___
Python tracker 

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



[issue45237] Python subprocess not honoring append mode for stdout on Windows

2021-09-17 Thread Eryk Sun


Eryk Sun  added the comment:

In Windows, the C runtime's append mode doesn't use the native file append 
mode. The CRT just opens the file in read-write mode and seeks to the end, 
initially and before each write. 

subprocess.Popen() doesn't implement inheritance of file descriptors, so the 
CRT append mode gets lost, but the native file pointer is of course retained. 
After file.write_text('') in the parent overwrites the file, writes to stdout 
in the child process begin at the file pointer. Null values are written to the 
initial 11 bytes.

You could use os.spawnv() to inherit file descriptors. The C runtime uses 
reserved fields in the process STARTUPINFO in order to marshal the fd data to 
the child process. This depends on the child implementing a compatible scheme 
for C file descriptors, which of course is the case for applications that use 
MSVC. A downside is that this won't be thread-safe since you'll have to 
temporarily redirect stdout in the current process. For example:

old_stdout = os.dup(1)
with file.open(mode='a') as f:
os.dup2(f.fileno(), 1)
try:
os.spawnv(os.P_NOWAIT, sys.executable, ['python', 'sub.py'])
finally:
os.dup2(old_stdout, 1)

Alternatively, you could open the file with native append mode and wrap the OS 
handle in a file descriptor. For example:

import os
import msvcrt
from win32file import *
from ntsecuritycon import FILE_APPEND_DATA

h = CreateFile(os.fspath(file), FILE_APPEND_DATA, 
FILE_SHARE_READ | FILE_SHARE_WRITE, None, OPEN_EXISTING, 0, None)
fd = msvcrt.open_osfhandle(h.Detach(), 0)

with open(fd) as f:
popen = subprocess.Popen([sys.executable, 'sub.py'], stdout=f)

--
components: +Windows
nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8

___
Python tracker 

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



[issue45183] Unexpected exception with zip importer

2021-09-17 Thread Brett Cannon


Change by Brett Cannon :


--
pull_requests: +26843
pull_request: https://github.com/python/cpython/pull/28438

___
Python tracker 

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



[issue45183] Unexpected exception with zip importer

2021-09-17 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset 209b7035f714dcc41df054b0b023e0b955d7e1a2 by Brett Cannon in 
branch 'main':
bpo-45183: don't raise an exception when calling 
zipimport.zipimporter.find_spec() when the zip file is missing and the internal 
cache has been reset (GH-28435)
https://github.com/python/cpython/commit/209b7035f714dcc41df054b0b023e0b955d7e1a2


--

___
Python tracker 

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



[issue45183] Unexpected exception with zip importer

2021-09-17 Thread miss-islington


Change by miss-islington :


--
keywords: +patch
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +26842
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28437

___
Python tracker 

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



[issue44640] Fix punctuation in isinstance() error message

2021-09-17 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset f4813388b4506b2fafb0089848c5b11cd503758c by wyz23x2 in branch 
'main':
bpo-44640: Improve punctuation consistency in isinstance/issubclass error 
messages (GH-27144)
https://github.com/python/cpython/commit/f4813388b4506b2fafb0089848c5b11cd503758c


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue44640] Fix punctuation in isinstance() error message

2021-09-17 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +26841
pull_request: https://github.com/python/cpython/pull/28436

___
Python tracker 

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



[issue45183] Unexpected exception with zip importer

2021-09-17 Thread Brett Cannon


Brett Cannon  added the comment:

The proposed fix seems to be the right one based on my reading of the code.

--
keywords:  -patch
stage: patch review -> 

___
Python tracker 

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



[issue45183] Unexpected exception with zip importer

2021-09-17 Thread Brett Cannon


Change by Brett Cannon :


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

___
Python tracker 

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



[issue42038] Tracemalloc's format() doc contradictory

2021-09-17 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks! ✨ 🍰 ✨

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



[issue42038] Tracemalloc's format() doc contradictory

2021-09-17 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 6302701179c458da637d669d7e88734fabb79cf6 by Miss Islington (bot) 
in branch '3.9':
bpo-42038: fix description of returned list of lines (GH-27529) (GH-28429)
https://github.com/python/cpython/commit/6302701179c458da637d669d7e88734fabb79cf6


--

___
Python tracker 

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



[issue42038] Tracemalloc's format() doc contradictory

2021-09-17 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset bba2332303c60d7326f08aa639ff03a6b5d44d04 by Miss Islington (bot) 
in branch '3.10':
bpo-42038: fix description of returned list of lines (GH-27529) (GH-28428)
https://github.com/python/cpython/commit/bba2332303c60d7326f08aa639ff03a6b5d44d04


--

___
Python tracker 

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



[issue15870] PyType_FromSpec should take metaclass as an argument

2021-09-17 Thread Sebastian Berg


Sebastian Berg  added the comment:

I am still fighting with this (and the issues surrounding it) for NumPy.  The 
main point is that my new DTypes in NumPy are metaclasses that extend the 
(heap)type struct.
That just feels right and matches the structure perfectly, but seems to get 
awkward when you want (users) to dynamically create new MetaClass instances.


It also works fine: I could allow creating new instances from Python (although 
I don't need it now) and allow users to create static types (for this I have to 
fix the size of the additional fields for a stable ABI, but that is fine, I can 
allocate a new opaque slot).

But cython or heaptypes (stable API) seem not accessible without annoying 
hacks...


For this concrete issue, would it be acceptable to use the base classes to 
correctly find the metaclass and use its alloc?
I personally don't see why a new signature would be needed even if the 
metaclass was to be passed (I do not need this), it seems like you could pass a 
`Py_tp_meta` slot and not add a new function?


I have attached a potential patch (it is a bit large because it needs to move 
the `bases` discovery code to before the `res` allocation).


Doing this would allow to provide a `FromSpec` function which internally calls 
`PyType_FromSpec`.
That may not make things much neater for cython, but it feels like this is 
really just a bug fix?  Unless you want to consider any extension of the type 
struct an unofficial hack to begin with :).


(Python metaclasses won't get their `__new__` called, but that is already the 
case, presumably a metaclass author will provide their own `InitFromSpec` 
function that must be called immediately after type creation, or just create 
the type completely.  I can do the second even now probably, but this tiny 
change would make it a lot cleaner.)


Trying more desperate angles, I was even wondering today if I should instead 
petition for Python to "donate" a `tp_metaslot` type slot...  A single `void *` 
unused by `PyType_Type` but available to metatypes to use as they wish.

While a bit strange, that might even simplify some ABI concerns or cython 
compatibility ;).

--
nosy: +seberg
Added file: https://bugs.python.org/file50285/typeobject.patch

___
Python tracker 

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



[issue45120] Windows cp encodings "UNDEFINED" entries update

2021-09-17 Thread Eryk Sun

Eryk Sun  added the comment:

Rafael, I was discussing code_page_decode() and code_page_encode() both as an 
alternative for compatibility with other programs and also to explore how 
MultiByteToWideChar() and WideCharToMultiByte() work -- particularly to explain 
best-fit mappings, which do not roundtrip. MultiByteToWideChar() does not 
exhibit "best fit" behavior. I don't even know what that would mean in the 
context of decoding. 

With the exception of one change to code page 1255, the definitions that you're 
looking to add are just for the C1 controls and private use area codes, which 
are not meaningful. Windows uses these arbitrary definitions to be able to 
roundtrip between the system ANSI and Unicode APIs.

Note that Python's "mbcs" (i.e. "ansi") and "oem" encodings use the code-page 
codec. For example:

>>> _winapi.GetACP()
1252

>>> '\x81\x8d\x8f\x90\x9d'.encode('ansi')
b'\x81\x8d\x8f\x90\x9d'

Best-fit encode "α" in code page 1252 [1]:

>>> 'α'.encode('ansi', 'replace')
b'a'

In your PR, the change to code page 1255 to add b"\xca" <-> "\u05ba" is the 
only change that I think is really worthwhile because the unicode.org data has 
it wrong. You can get the proper character name for the comment using the 
unicodedata module:

>>> print(unicodedata.name('\u05ba'))
HEBREW POINT HOLAM HASER FOR VAV

I'm +0 in favor of leaving the mappings undefined where Windows completes 
legacy single-byte code pages by using C1 control codes and private use area 
codes. It would have been fine if Python's code-page encodings had always been 
based on the "WindowsBestFit" tables, but only the decoding MBTABLE, since it's 
reasonable. 

Ideally, I don't want anything to use the best-fit mappings in WCTABLE. I would 
rather that the 'replace' handler for code_page_encode() used the replacement 
character (U+FFFD) or system default character. But the world is not ideal; the 
system ANSI API uses the WCTABLE best-fit encoding. Back in the day with Python 
2.7, it was easy to demonstrate how insidious this is. For example, in 2.7.18:

>>> os.listdir(u'.')
[u'\u03b1']

>>> os.listdir('.')
['a']

---

[1] 
https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit1252.txt

--

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-09-17 Thread Eric Snow


Eric Snow  added the comment:


New changeset 090591636c4f03ce06a039079bd7716a5b23631e by Eric Snow in branch 
'main':
bpo-45020: Freeze os, site, and codecs. (gh-28398)
https://github.com/python/cpython/commit/090591636c4f03ce06a039079bd7716a5b23631e


--

___
Python tracker 

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



[issue42038] Tracemalloc's format() doc contradictory

2021-09-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26839
pull_request: https://github.com/python/cpython/pull/28429

___
Python tracker 

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



[issue42038] Tracemalloc's format() doc contradictory

2021-09-17 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +26838
pull_request: https://github.com/python/cpython/pull/28428

___
Python tracker 

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



[issue42038] Tracemalloc's format() doc contradictory

2021-09-17 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset aca0e08c5dcc11a8011697331931cde0b21270f2 by andrei kulakov in 
branch 'main':
bpo-42038: fix description of returned list of lines (GH-27529)
https://github.com/python/cpython/commit/aca0e08c5dcc11a8011697331931cde0b21270f2


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-09-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

BTW, why does the script still run Programs/_freeze_module over all the modules 
to be frozen? Isn't that up to the Makefile or its Windows equivalent?

--

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-09-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

(Ah, now I recall how the $(srcdir) mechanism works again. Generated files do 
*not* have a $(srcdir) prefix, since they are generated in the destination 
directory. Hence the fix for the buildbot failure a few days ago. I take back 
my skepticism about that.)

--

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread STINNER Victor


STINNER Victor  added the comment:

Can someone compare the main branch (commit 
e4044e9f893350b4623677c048d33414a77edf55) to the main branch + PR 28427 patch?

You can download the patch from:
https://patch-diff.githubusercontent.com/raw/python/cpython/pull/28427.patch

How can I build Python with PGO on Windows? Visual Studio has two profiles: 
PGinstrument and PGupdate.

I cannot find "PGO", "PGinstrument" or "PGupdate" in the 
https://devguide.python.org/

--

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread STINNER Victor


STINNER Victor  added the comment:

I created a draft PR to mark functions like Py_INCREF() and Py_IS_TYPE() with 
__forceinline: PR 28427.

--

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +26837
pull_request: https://github.com/python/cpython/pull/28427

___
Python tracker 

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



[issue45200] test_multiprocessing_fork: test_get() fails with timeout

2021-09-17 Thread STINNER Victor


STINNER Victor  added the comment:

When the test hangs, a background Python process starts to use 100% of my CPU.

This process is stuck in _thread.start_new_thread(). I opened the process in 
gdb.

(gdb) thread 1
[Switching to thread 1 (Thread 0x7fece33615c0 (LWP 132301))]
#0  __interceptor_pthread_create (thread=thread@entry=0x7ffe79cd6190, 
attr=attr@entry=0x7ffe79cd61b0, start_routine=start_routine@entry=0x6fed30 
, arg=arg@entry=0x60200019aed0)
at ../../../../libsanitizer/asan/asan_interceptors.cpp:245
245 while (atomic_load(¶m.is_registered, memory_order_acquire) == 0)
(gdb) where
#0  __interceptor_pthread_create (thread=thread@entry=0x7ffe79cd6190, 
attr=attr@entry=0x7ffe79cd61b0, start_routine=start_routine@entry=0x6fed30 
, arg=arg@entry=0x60200019aed0)
at ../../../../libsanitizer/asan/asan_interceptors.cpp:245
#1  0x006ff242 in PyThread_start_new_thread (func=func@entry=0x7f45d0 
, arg=arg@entry=0x604000e83c50) at Python/thread_pthread.h:287
(...)

(gdb) thread 2
[Switching to thread 2 (Thread 0x7fecd151c640 (LWP 132302))]
#0  __sanitizer::atomic_exchange<__sanitizer::atomic_uint32_t> 
(mo=__sanitizer::memory_order_acquire, v=2, a=0x64001b00) at 
../../../../libsanitizer/sanitizer_common/sanitizer_atomic_clang.h:62
62  inline typename T::Type atomic_exchange(volatile T *a,
(gdb) where
#0  __sanitizer::atomic_exchange<__sanitizer::atomic_uint32_t> 
(mo=__sanitizer::memory_order_acquire, v=2, a=0x64001b00) at 
../../../../libsanitizer/sanitizer_common/sanitizer_atomic_clang.h:62
#1  __sanitizer::BlockingMutex::Lock (this=this@entry=0x64001b00) at 
../../../../libsanitizer/sanitizer_common/sanitizer_linux.cpp:649
#2  0x7fece3914e15 in 
__sanitizer::GenericScopedLock<__sanitizer::BlockingMutex>::GenericScopedLock 
(mu=0x64001b00, this=) at 
../../../../libsanitizer/sanitizer_common/sanitizer_mutex.h:183
#3  
__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView>
 >::GetFromAllocator (this=this@entry=0x7fece3a13f00 <__asan::instance>, 
stat=stat@entry=0x7feccfb46c40, class_id=class_id@entry=36, 
chunks=chunks@entry=0x7feccfb42330, n_chunks=n_chunks@entry=8) at 
../../../../libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h:146
#4  0x7fece3914f41 in 
__sanitizer::SizeClassAllocator64LocalCache<__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView>
 > >::Refill (this=this@entry=0x7feccfb390e0, c=c@entry=0x7feccfb42320, 
allocator=allocator@entry=0x7fece3a13f00 <__asan::instance>, 
class_id=class_id@entry=36) at 
../../../../libsanitizer/sanitizer_common/sanitizer_allocator_local_cache.h:102
#5  0x7fece3915209 in 
__sanitizer::SizeClassAllocator64LocalCache<__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView>
 > >::Allocate (class_id=36, allocator=0x7fece3a13f00 <__asan::instance>, 
this=0x7feccfb390e0) at 
../../../../libsanitizer/sanitizer_common/sanitizer_allocator_local_cache.h:38
#6  
__sanitizer::CombinedAllocator<__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView>
 >, __sanitizer::LargeMmapAllocatorPtrArrayDynamic>::Allocate 
(this=this@entry=0x7fece3a13f00 <__asan::instance>, 
cache=0x7feccfb390e0, size=, size@entry=8192, 
alignment=alignment@entry=1) at 
../../../../libsanitizer/sanitizer_common/sanitizer_allocator_combined.h:69
#7  0x7fece39118f6 in __asan::QuarantineCallback::Allocate (size=8192, 
this=) at 
../../../../libsanitizer/asan/asan_allocator.cpp:869
#8  __sanitizer::QuarantineCache<__asan::QuarantineCallback>::Enqueue (size=32, 
ptr=0x6030005477d0, cb=..., this=0x7feccfb39060) at 
../../../../libsanitizer/sanitizer_common/sanitizer_quarantine.h:223
#9  __sanitizer::Quarantine<__asan::QuarantineCallback, __asan::AsanChunk>::Put 
(size=32, ptr=0x6030005477d0, cb=..., c=0x7feccfb39060, this=) 
at ../../../../libsanitizer/sanitizer_common/sanitizer_quarantine.h:105
#10 __asan::Allocator::QuarantineChunk (this=this@entry=0x7fece3a13f00 
<__asan::instance>, m=m@entry=0x6030005477d0, stack=stack@entry=0x7fecd151b360, 
ptr=0x6030005477e0) at ../../../../libsanitizer/asan/asan_allocator.cpp:666
#11 0x7fece3911ba5 in __asan::Allocator::Deallocate 
(alloc_type=__asan::FROM_MALLOC, stack=0x7fecd151b360, delete_alignment=0, 
delete_size=0, ptr=0x6030005477e0, this=0x7fece3a13f00 <__asan::instance>)
at ../../../../libsanitizer/asan/asan_allocator.cpp:714
#12 0x7fece3997618 in __interceptor_free (ptr=0x6030005477e0) at 
../../../../libsanitizer/asan/asan_malloc_linux.cpp:128
#13 0x7fece362f7a4 in pthread_getattr_np@GLIBC_2.2.5 () from 
/lib64/libc.so.6
#14 0x7fece39b142e in __sanitizer::GetThreadStackTopAndBottom 
(at_initialization=at_initialization@entry=false, 
stack_top=stack_top@entry=0x7fecd151bd10, 
stack_bottom=stack_bottom@entry=0x7fecd151bd18)
at ../../../../libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp:143
#15 0x7fece39b1778 in __sanitizer::Get

[issue45237] Python subprocess not honoring append mode for stdout on Windows

2021-09-17 Thread wolfgang kuehn


New submission from wolfgang kuehn :

On Windows, if you pass an existing file object in append mode to a subprocess, 
the subprocess does **not** really append to the file:

1. A file object with `Hello World` content is passed to the subprocess
2. The content is erased
3. The subprocess writes to the file
4. The expected output does not contain `Hello World`

Demo:

import subprocess, time, pathlib, sys
print(f'Caller {sys.platform=} {sys.version=}')

pathlib.Path('sub.py').write_text("""import sys, time
time.sleep(1)
print(f'Callee {sys.stdout.buffer.mode=}')""")

file = pathlib.Path('dummy.txt')
file.write_text('Hello World')
popen = subprocess.Popen([sys.executable, 'sub.py'], 
stdout=file.open(mode='a'))
file.write_text('')
time.sleep(2)
print(file.read_text())

Expected output on Linux

Caller sys.platform='linux' sys.version='3.8.6'
Callee sys.stdout.buffer.mode='wb'

Unexpected bad output on Windows

Caller sys.platform='win32' sys.version='3.8.6'
NULNULNULNULNULNULNULNULNULNULNULCallee sys.stdout.buffer.mode='wb'

Note that the expected output is given on Windows if the file is opened in the 
subprocess via `sys.stdout = open('dummy.txt', 'a')`. So it is definitely a 
subprocess thing.

--
components: IO
messages: 402096
nosy: wolfgang-kuehn
priority: normal
severity: normal
status: open
title: Python subprocess not honoring append mode for stdout on Windows
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



[issue45200] test_multiprocessing_fork: test_get() fails with timeout

2021-09-17 Thread STINNER Victor


STINNER Victor  added the comment:

> I'm able to reproduce the issue in a reliable way using attached bisect10 
> file and the command:

I'm talking about a Python built with Address Sanitizer:

$ ./configure --with-address-sanitizer --without-pymalloc
$ make

--

___
Python tracker 

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



[issue45200] test_multiprocessing_fork: test_get() fails with timeout

2021-09-17 Thread STINNER Victor


STINNER Victor  added the comment:

I'm able to reproduce the issue in a reliable way using attached bisect10 file 
and the command:

$ ./python -m test test_multiprocessing_fork --timeout=40 -v 
--matchfile=bisect10
(...)
test_fork (test.test_multiprocessing_fork.WithProcessesTestQueue) ... ok
test_get (test.test_multiprocessing_fork.WithProcessesTestQueue) ... 
Timeout (0:00:40)!
Thread 0x7fd0552025c0 (most recent call first):
  File "/home/vstinner/python/main/Lib/multiprocessing/synchronize.py", line 
261 in wait
  File "/home/vstinner/python/main/Lib/multiprocessing/synchronize.py", line 
349 in wait
  File "/home/vstinner/python/main/Lib/test/_test_multiprocessing.py", line 
1003 in test_get
(...)

bisect10 contains 68 tests.

--
Added file: https://bugs.python.org/file50284/bisect10

___
Python tracker 

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



[issue45236] pyperformance fails to build master

2021-09-17 Thread STINNER Victor


STINNER Victor  added the comment:

I think that I just fixed it with:

commit 41551ee7e24fb6c58846836d3655dbb212281206 (HEAD -> main, upstream/main)
Author: Victor Stinner 
Date:   Fri Sep 17 20:20:43 2021 +0200

bpo-45020: Fix build out of source tree (GH-28410)

* Makefile.pre.in: Add $(srcdir) when needed, remove it when it was
  used by mistake.
* freeze_modules.py tool uses ./Programs/_freeze_module if the
  executable doesn't exist in the source tree.

--

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread STINNER Victor


STINNER Victor  added the comment:

> If https://bugs.python.org/file50280/310rc2_benchmarks.txt is correct, this 
> means that we have a 7% slowdown in Windows PGO builds for 3.10, which I 
> don't think is acceptable.

What I understood is that the https://bugs.python.org/msg401743 patch makes 
1.07x faster.

But https://bugs.python.org/issue45116#msg401143 compares Python 3.10b1 to 
Python 3.10a7: Python 3.10b1 is slower (32-bit: "1.07", 64-bit: "1.14": "higher 
the slower" wrote neonene).

--

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e4044e9f893350b4623677c048d33414a77edf55 by Victor Stinner in 
branch 'main':
bpo-45116: Py_DEBUG ignores Py_ALWAYS_INLINE (GH-28419)
https://github.com/python/cpython/commit/e4044e9f893350b4623677c048d33414a77edf55


--

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

If https://bugs.python.org/file50280/310rc2_benchmarks.txt is correct, this 
means that we have a 7% slowdown in Windows PGO builds for 3.10, which I don't 
think is acceptable.

I am marking this as a release blocker until there is some agreement. I remind 
you that if an agreement cannot be reached, you may reach the Steering Council 
for help reaching some conclusion.

--

___
Python tracker 

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



[issue45236] pyperformance fails to build master

2021-09-17 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

In the main branch, pyperformance fails to build due to something regarding the 
freeze module:

2021-09-17 00:03:46,170: /home/pablogsal/cpython_cron/Programs/_freeze_module 
importlib._bootstrap /home/pablogsal/cpython_cron/Lib/importlib/_bootstrap.py 
/home/pablogsal/cpython_cron/Python/frozen_modules/importlib__bootstrap.h
2021-09-17 00:03:46,170: make[3]: 
/home/pablogsal/cpython_cron/Programs/_freeze_module: Command not found
2021-09-17 00:03:46,170: Makefile:766: recipe for target 
'Python/frozen_modules/importlib__bootstrap.h' failed
2021-09-17 00:03:46,171: make[3]: *** 
[Python/frozen_modules/importlib__bootstrap.h] Error 127
2021-09-17 00:03:46,171: make[3]: Leaving directory 
'/home/pablogsal/bench_tmpdir_cron/build'
2021-09-17 00:03:46,171: Makefile:535: recipe for target 
'build_all_generate_profile' failed
2021-09-17 00:03:46,172: make[2]: *** [build_all_generate_profile] Error 2
2021-09-17 00:03:46,172: make[2]: Leaving directory 
'/home/pablogsal/bench_tmpdir_cron/build'
2021-09-17 00:03:46,172: Makefile:509: recipe for target 'profile-gen-stamp' 
failed
2021-09-17 00:03:46,172: make[1]: *** [profile-gen-stamp] Error 2
2021-09-17 00:03:46,172: make[1]: Leaving directory 
'/home/pablogsal/bench_tmpdir_cron/build'
2021-09-17 00:03:46,172: Makefile:520: recipe for target 'profile-run-stamp' 
failed
2021-09-17 00:03:46,172: make: *** [profile-run-stamp] Error 2
2021-09-17 00:03:46,173: Command make profile-opt failed with exit code 2
2021-09-17 00:03:46,188: Command /home/pablogsal/venv_cron/bin/python -m 
pyperformance compile /home/pablogsal/simple.conf 
fdc6b3d9316501d2f0068a1bf4334debc1949e62 master failed with exit code 11
2021-09-17 00:03:46,188: Benchmark exit code: 11
2021-09-17 00:03:46,188: FAILED: master-fdc6b3d9316501d2f0068a1bf4334debc1949e62

The performance server has been failing from some time due to this problem :(

--
messages: 402089
nosy: eric.snow, pablogsal, vstinner
priority: normal
severity: normal
status: open
title: pyperformance fails to build master

___
Python tracker 

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



[issue45027] Allow basicConfig to configure any logger, not just root

2021-09-17 Thread Greg Werbin


Greg Werbin  added the comment:

> Users certainly don't need an API change to prevent that, should they wish 
> to. The following simple call will suffice (using 'gnupg' just as an example):
>
> logging.getLogger('gnupg').setLevel(logging.CRITICAL + 1)

This selectively _disables_ a logger. That isn't the same thing as selectively 
_enabling_ only the loggers you want to enable.

Something like this would be equivalent to this proposal:

logging.basicConfig(format='...', level=logging.CRITICAL + 1)
logging.getLogger('my_app').setLevel(logging.INFO)

> My point was, they don't need to configure non-root loggers (in terms of 
> adding handlers) because the root logger's handlers will normally be used for 
> all loggers.

That's fair enough, but why make people do the above (which is somewhat 
unintuitive), when they could instead just do this:

basicConfig(format='...'. level=logging.INFO, logger='my_app')

Moreover, what if you want multiple different formatters and handlers for 
different sub-loggers?

Sure, you could use dictConfig(), but why force people to do this:

logging.dictConfig({
'formatters': {
'format1': {'format': '...'},
'format2': {'format': '...'},
'format3': {'format': '...'},
},
'handlers': 
'handler1': {'class': 'logging.StreamHandler', 'formatter': 
'format1'},
'handler2': {'class': 'logging.StreamHandler', 'formatter': 
'format2'},
'handler3': {'class': 'logging.StreamHandler', 'formatter': 
'format3'},
},
'loggers': {
'my_app': {'level': 'WARNING', 'handlers': ['handler1']},
'my_app.client': {'level': 'INFO', 'handlers': ['handler2']},
'my_app.parser': {'level': 'INFO', 'handlers': ['handler3']},
}
})

When they could instead do this:

basicConfig(format='...', level=logging.WARNING, logger='my_app')
basicConfig(format='...', level=logging.INFO, logger='my_app.client')
basicConfig(format='...', level=logging.INFO, logger='my_app.parser')

Not to mention the confusing bug-trap that is the `incremental` option in 
dictConfig().

> As you can see, it's not needed for the purpose you described (avoiding 
> messages from third-party loggers).

Not "needed", of course. Plenty of people have been logging in Python for years 
without it!

But IMO it's a _better_ way to do it compared to the current solutions.

I believe that this proposal could even become the "one obvious way to do it": 
run `basicConfig(logger=my_logger)` on the top-level logger in your application.

My perspective is one of being an application developer, ad-hoc "script 
developer", and being active helper in many Python forums and chatrooms. I've 
seen ugly misuse of logging in serious application developed by serious 
organizations, by people who are not full-time Python devs, that would have 
been largely avoided by having an "easy" entry point like this. And I've seen 
countless newbies intimidated and scared away from logging "properly" in Python 
because of the complexity and non-obviousness of the existing interfaces.

I'm open to alternative suggestions of course. But I maintain that the current 
dictConfig() is not a suitable alternative, nor is selectively disabling 
loggers.

I am very aware of the high maintenance burden on the Python stdlib already, so 
I understand the resistance to adding new functionality. From my perspective, 
this is a very simple addition, can be tested with a small number of additional 
test assertions, and can be easily covered by in the type stubs.

I could also publish this as a separate package on PyPI. If you think this 
proposal places an undue burden on Python implementation developers, then I'll 
happily drop the PR and publish my own thing. But why reinvent the wheel, 
especially for something so small?

--

___
Python tracker 

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



[issue45231] make regen-all changes files on Linux

2021-09-17 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue45120] Windows cp encodings "UNDEFINED" entries update

2021-09-17 Thread Rafael Belo


Rafael Belo  added the comment:

Eryk 

Regarding the codecsmodule.c i don't really know its inner workings and how it 
is connected to other modules, and as of it, changes on that level for this use 
case are not critical. But it is nice to think and evaluate on that level too, 
since there might be some tricky situations on windows systems because of that 
grey zone. 

My proposal really aims to enhance the Lib/encodings/ module. And as Marc-Andre 
Lemburg advised, to only change those mappings in case of official corrections 
on the standard itself. Now i think that really following those standards 
"strictly" seems to be a good idea. 

On top of that, adding them under different naming seems like a better idea 
anyway, since those standards can be seen as different if you take a strict 
look at the Unicode definitions. Adding them would suffice for the needs that 
might arise, would still allow for catching mismatched encodings, and can even 
be "backported" to older python versions.

I will adjust the PR accordingly to these comments, thanks for the feedback!

--

___
Python tracker 

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



[issue42389] test_multiprocessing: @requires_hashdigest() prevents test discovery

2021-09-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Fixed in issue45042.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Many multiprocessing tests are silently skipped since 3.9

___
Python tracker 

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



[issue45200] test_multiprocessing_fork: test_get() fails with timeout

2021-09-17 Thread STINNER Victor


STINNER Victor  added the comment:

Sometimes, WithProcessesTestProcess.test_error_on_stdio_flush_1() hangs.

--

___
Python tracker 

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



[issue45187] Some tests in test_socket are not run

2021-09-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 6c50f23ae085ec66f320a26a3f0a6c60d7f2b29d by Miss Islington (bot) 
in branch '3.9':
bpo-45187: Fix dangling threads in test_socket.CreateServerFunctionalTest 
(GH-28422) (GH-28424)
https://github.com/python/cpython/commit/6c50f23ae085ec66f320a26a3f0a6c60d7f2b29d


--

___
Python tracker 

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



[issue14408] Support ./python -m unittest in test_socket

2021-09-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It has been done in issue45187. The problem with reaping threads was solved by 
using setUpModule() and addModuleCleanup().

Matt's patch contains also replacing calls of concrete class __init__s with 
using super(). It can be applied.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue42560] Improve Tkinter Documentation

2021-09-17 Thread E. Paine


E. Paine  added the comment:

> Thoughts

Is it possible to make non-widget specific methods more obvious (the first one 
that caught my eye was bind_class)? I'm thinking something like using italic 
with a key at the top noting that is what it means. I like the 'aka' thing, 
though. Thanks Mark!

--

___
Python tracker 

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



[issue16968] Fix test discovery for test_concurrent_futures.py

2021-09-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

test_concurrent_futures was made discoverable by Victor Stinner in issue37421. 
It used tearDownModule() to run threading_cleanup() and reap_children().

--
status: open -> pending

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-09-17 Thread Eric Snow


Eric Snow  added the comment:

Thanks for fixing that, Victor!

--

___
Python tracker 

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



[issue38063] Modify test_socket.py to use unittest test discovery

2021-09-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I has merged similar PR in issue45187. Although it required to fix some 
existing bugs first.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue45036] turtle.onrelease() event doesn't get triggered sometimes

2021-09-17 Thread E. Paine


E. Paine  added the comment:

> Sometimes it doesn't pendown when I drag

Sorry, I can't think why this would be. Maybe ask on Stack Overflow? For now, 
though, I doubt it's a bug with turtle so IMO this issue should be closed.

--

___
Python tracker 

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



[issue45187] Some tests in test_socket are not run

2021-09-17 Thread miss-islington


miss-islington  added the comment:


New changeset 21711d53411e0da5976a9af591cd6ca97033f712 by Miss Islington (bot) 
in branch '3.10':
bpo-45187: Fix dangling threads in test_socket.CreateServerFunctionalTest 
(GH-28422)
https://github.com/python/cpython/commit/21711d53411e0da5976a9af591cd6ca97033f712


--

___
Python tracker 

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



[issue45229] Always use unittest for collecting tests in regrtests

2021-09-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you Zachary, I almost forgot about that issue.

The goal of this issue is to make regrtests using test discovery instead of 
manually composed lists of test classes. Of course it requires that tests 
should be discoverable. And most of them already are, thanks to issue16748 and 
similar.

--

___
Python tracker 

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



[issue45200] test_multiprocessing_fork failws with timeout

2021-09-17 Thread STINNER Victor


STINNER Victor  added the comment:

test_multiprocessing_fork also failed on the GitHub Action "Address sanitizer" 
job:
https://github.com/python/cpython/pull/28419

test_get (test.test_multiprocessing_fork.WithProcessesTestQueue) ... Timeout 
(0:20:00)!
Thread 0x7f732679bbc0 (most recent call first):
  File "/home/runner/work/cpython/cpython/Lib/multiprocessing/synchronize.py", 
line 261 in wait
  File "/home/runner/work/cpython/cpython/Lib/multiprocessing/synchronize.py", 
line 349 in wait
  File "/home/runner/work/cpython/cpython/Lib/test/_test_multiprocessing.py", 
line 1001 in test_get

--
nosy: +vstinner

___
Python tracker 

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



[issue45200] test_multiprocessing_fork: test_get() fails with timeout

2021-09-17 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_multiprocessing_fork failws with timeout -> 
test_multiprocessing_fork: test_get() fails with timeout

___
Python tracker 

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



[issue45187] Some tests in test_socket are not run

2021-09-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26836
pull_request: https://github.com/python/cpython/pull/28424

___
Python tracker 

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



[issue45187] Some tests in test_socket are not run

2021-09-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26835
pull_request: https://github.com/python/cpython/pull/28423

___
Python tracker 

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



[issue45187] Some tests in test_socket are not run

2021-09-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 51ebb7f4f5e9bdcf8279a1d91be9569706f6bead by Serhiy Storchaka in 
branch 'main':
bpo-45187: Fix dangling threads in test_socket.CreateServerFunctionalTest 
(GH-28422)
https://github.com/python/cpython/commit/51ebb7f4f5e9bdcf8279a1d91be9569706f6bead


--

___
Python tracker 

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



[issue21627] Concurrently closing files and iterating over the open files directory is not well specified

2021-09-17 Thread Dan Snider


Dan Snider  added the comment:

On Android, if os.close_range closes the file descriptor of the scandir 
iterator, the interpreter immediately crashes eg:

>>> import os
>>> os.scandir()

>>> os.closerange(3,)
fdsan: attempted to close file descriptor 3, expected to be unowned, actually 
owned by DIR* 0x7263390290
Aborted
$

Sorry if this isn't an appropriate place to add this, but the title matched the 
concept I think and I don't know enough to judge whether this is something that 
needs to be fixed.

--
nosy: +bup

___
Python tracker 

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



[issue43232] Prohibit previously deprecated operations on asyncio.trsock.TransportSocket

2021-09-17 Thread John Snow


John Snow  added the comment:

Without sendmsg(), is there any other way to send SCM_RIGHTS ancillary messages 
over an asyncio-managed UNIX socket?

(Is there a better place to discuss this? Kindly point me in the right 
direction if so.)

--
nosy: +jnsnow

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread STINNER Victor


STINNER Victor  added the comment:

Raymond: "Please do as Steve asked  and revert back to the previous stable, 
reliable code."

Is this issue really about Py_INCREF() being a static inline macro? Or is it 
more about the increased size of the _PyEval_EvalFrameDefault() function?

neonene's analyzis seems to show that the the PGO optimizer of the MSC compiler 
has thresholds depending on the function size, and _PyEval_EvalFrameDefault() 
crossed these thresholds. Py_INCREF() static inline function only seems to be 
the top of the iceberg, it's more a "side effect" than the root issue, no?

neonene showed in msg401743 that even adding *dead code* changes Python 
performance. So for me, it sounds weird to decide to change Py_INCREF() 
implementation only based on this analysis. Or maybe I missed something.

neonene's analyzis starts with the commit 
28d28e053db6b69d91c2dfd579207cd8ccbc39e7 of PR 25244. Are you suggesting to 
revert this change? Mark Shannon is pushing many changes in ceval.c and the 
frame object. Multiple changes have been pushed on top of it since this commit, 
I don't think that this commit can be easily reverted.

What I understood is that adding __forceinline on some static inline functions 
can make the performance regression of the commit 
28d28e053db6b69d91c2dfd579207cd8ccbc39e7 less bad. But I would prefer to 
validate that, since neonene's comparisons are not what I'm looking for: 
compare main to main+Py_ALWAYS_INLINE.

--

___
Python tracker 

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



[issue45187] Some tests in test_socket are not run

2021-09-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +26834
pull_request: https://github.com/python/cpython/pull/28422

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-09-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 41551ee7e24fb6c58846836d3655dbb212281206 by Victor Stinner in 
branch 'main':
bpo-45020: Fix build out of source tree (GH-28410)
https://github.com/python/cpython/commit/41551ee7e24fb6c58846836d3655dbb212281206


--

___
Python tracker 

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



[issue45231] make regen-all changes files on Linux

2021-09-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c5a677da9e7b2b2aa43b0b6dfb3813c0212379c0 by Victor Stinner in 
branch 'main':
bpo-45231: update_file.py preserves end of line (GH-28411)
https://github.com/python/cpython/commit/c5a677da9e7b2b2aa43b0b6dfb3813c0212379c0


--

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread Ken Jin


Ken Jin  added the comment:

> How severe is the regression?

OP provided pyperformance of current 3.10 vs their patched version at 
https://bugs.python.org/file50280/310rc2_benchmarks.txt. The patch is at 
https://bugs.python.org/msg401743.

--

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Pablo, should this be a release blocker?

How severe is the regression? If is severe enough we can mark it as a release 
blocker, but a conclusion needs to be reached ASAP because I don't want to 
change a fundamental macro a few days before the release

--

___
Python tracker 

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



[issue45103] IDLE: make configdialog font page survive font failures

2021-09-17 Thread E. Paine


E. Paine  added the comment:

https://core.tcl-lang.org/tk/tktview/0338867c742


IMO this should be closed as third-party, since there is very little we can / 
should do (yes we could remove the offending characters from the preview if the 
user has the font installed, but this is a lot of extra code for a very rare 
issue).

--

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

FWIW: Back in the days of Python 1.5.2, the ceval loop was too big for CPU 
caches as well and one of the things I experimented with at the time was 
rearranging the opcodes based on how often they were used and splitting the 
whole switch statement we had back then in two parts. This results in a 10-20% 
speedup.

CPU caches have since gotten much larger, but the size of the loop still is 
something to keep in mind and optimize for, as more and more logic gets added 
to the inner loop of Python.

IMO, we should definitely keep forced inlines / macros where they are used 
inside hot loops, perhaps even in all of the CPython code, since the conversion 
to inline functions is mostly for hiding internals from extensions, not to hide 
them from CPython itself.

@neonene: Could you provide more details about the CPU you're using to run the 
tests ?

BTW: Perhaps the PSF could get a few sponsors to add more hosts to 
speed.python.org, to provide a better overview. It looks as if the system is 
only compiling on Ubuntu 14.04 and running on an 11 year old system 
(https://speed.python.org/about/). If that's the case, the system uses a server 
CPU with 12MB cache 
(https://www.intel.com/content/www/us/en/products/sku/47916/intel-xeon-processor-x5680-12m-cache-3-33-ghz-6-40-gts-intel-qpi/specifications.html).

--

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Pablo, should this be a release blocker?

--
nosy: +lemburg, pablogsal

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Right now, I'm not sure. The heuristic to decide
> if a function is inlined or not seems to depend
> a lot on the compiler and the compiler options.

That is exactly correct.  And it is why we should
use the macro form which is certain to be inlined. 

Please do as Steve asked  and revert back to the
previous stable, reliable code.

--

___
Python tracker 

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



[issue45232] ascii codec is used by default when LANG is not set

2021-09-17 Thread Eryk Sun


Eryk Sun  added the comment:

Python 3.7+ doesn't need to explicitly enable UTF-8 mode in this case on POSIX 
systems. If the locale encoding is the "POSIX" or "C" locale, and "C" locale 
coercion is not disabled via LC_ALL or PYTHONCOERCECLOCALE=0, the interpreter 
tries to coerce the LC_CTYPE locale to "C.UTF-8", "C.utf8", or "UTF-8". If 
these attempts fail, or if coercion is disabled, the interpreter will 
automatically enable UTF-8 mode, unless that's also explicitly disabled. For 
example:

$ unset LANG
$ unset LC_ALL
$ unset PYTHONCOERCECLOCALE
$ unset PYTHONUTF8 
$ python -c 'import locale; print(locale.getpreferredencoding())'
UTF-8

$ PYTHONCOERCECLOCALE=0 python -c 'import locale; 
print(locale.getpreferredencoding())'
UTF-8

$ PYTHONUTF8=0 python -c 'import locale; 
print(locale.getpreferredencoding())'
UTF-8

$ PYTHONCOERCECLOCALE=0 PYTHONUTF8=0 python -c 'import locale; 
print(locale.getpreferredencoding())'
ANSI_X3.4-1968

--
nosy: +eryksun

___
Python tracker 

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



[issue45234] copy_file raises FileNotFoundError when src is a directory

2021-09-17 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Alex: thanks for the report!

I've added a PR that should fix this.

--

___
Python tracker 

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



[issue45234] copy_file raises FileNotFoundError when src is a directory

2021-09-17 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
keywords: +patch
nosy: +andrei.avk
nosy_count: 1.0 -> 2.0
pull_requests: +26833
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28421

___
Python tracker 

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



[issue45235] argparse does not preserve namespace with subparser defaults

2021-09-17 Thread Adam Schwalm


Change by Adam Schwalm :


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

___
Python tracker 

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



[issue45232] ascii codec is used by default when LANG is not set

2021-09-17 Thread Marc-Andre Lemburg


Change by Marc-Andre Lemburg :


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



[issue45235] argparse does not preserve namespace with subparser defaults

2021-09-17 Thread Adam Schwalm


New submission from Adam Schwalm :

The following snippet demonstrates the problem. If a subparser flag has a 
default set, argparse will override the existing value in the provided 
'namespace' if the flag does not appear (e.g., if the default is used):

import argparse
parser = argparse.ArgumentParser()
sub = parser.add_subparsers()
example_subparser = sub.add_parser("example")
example_subparser.add_argument("--flag", default=10)
print(parser.parse_args(["example"], argparse.Namespace(flag=20)))

This should return 'Namespace(flag=20)' because 'flag' already exists in the 
namespace, but instead it returns 'Namespace(flag=10)'. This intended behavior 
is described and demonstrated in the second example here: 
https://docs.python.org/3/library/argparse.html#default

Lib's behavior is correct for the non-subparser cause.

--
components: Library (Lib)
messages: 402060
nosy: ALSchwalm
priority: normal
severity: normal
status: open
title: argparse does not preserve namespace with subparser defaults
type: behavior
versions: Python 3.10, Python 3.11, 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



[issue45232] ascii codec is used by default when LANG is not set

2021-09-17 Thread Olivier Delhomme

Olivier Delhomme  added the comment:

>> Hi Marc-Andre,
>>
>> Please note that setting PYTHONUTF8 with "export PYTHONUTF8=1":
>>
>> * Is external to the program and user dependent
>> * It does not seems to work on my use case:
>>
>>$ unset LANG
>>$ export PYTHONUTF8=1
>>$ python3
>>Python 3.6.4 (default, Jan 11 2018, 16:45:55)
>>[GCC 4.8.5] on linux
>>Type "help", "copyright", "credits" or "license" for more information.
>>>>> machaine='help me if you can'
>>   File "", line 0
>>  
>> ^
>> SyntaxError: 'ascii' codec can't decode byte 0xc3 in position 10: 
>> ordinal not in range(128)
> 
> UTF-8 mode is only supported in Python 3.7 and later:
> 
> https://docs.python.org/3/whatsnew/3.7.html#whatsnew37-pep540

Oh. Thanks.

$ unset LANG
$ export PYTHONUTF8=1
$ python3
Python 3.7.5 (default, Dec 24 2019, 08:52:13)
[GCC 4.8.5] on linux
Type "help", "copyright", "credits" or "license" for more information.
 >>> machaine='help me if you can'
 >>>

 From the code point of view:

$ unset LANG
$ unset PYTHONUTF8
$ python3
Python 3.7.5 (default, Dec 24 2019, 08:52:13)
[GCC 4.8.5] on linux
Type "help", "copyright", "credits" or "license" for more information.
 >>> import os
 >>> os.environ['PYTHONUTF8'] = '1'
 >>> machaine='help me if you can'
 >>>

Even better:

$ unset LANG
$ unset PYTHONUTF8
$ python3
Python 3.7.5 (default, Dec 24 2019, 08:52:13)
[GCC 4.8.5] on linux
Type "help", "copyright", "credits" or "license" for more information.
 >>> machaine='help me if you can'
 >>>

Works as expected. Thank you very much. You can close this bug report.

Regards,

Olivier.

--

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +26831
pull_request: https://github.com/python/cpython/pull/28419

___
Python tracker 

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



[issue45232] ascii codec is used by default when LANG is not set

2021-09-17 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

On 17.09.2021 15:45, Olivier Delhomme wrote:
> 
> Olivier Delhomme  added the comment:
> 
> Hi Marc-Andre,
> 
> Please note that setting PYTHONUTF8 with "export PYTHONUTF8=1":
> 
> * Is external to the program and user dependent
> * It does not seems to work on my use case:
> 
>   $ unset LANG
>   $ export PYTHONUTF8=1
>   $ python3 
>   Python 3.6.4 (default, Jan 11 2018, 16:45:55) 
>   [GCC 4.8.5] on linux
>   Type "help", "copyright", "credits" or "license" for more information.
>   >>> machaine='help me if you can'
>  File "", line 0
> 
>^
>SyntaxError: 'ascii' codec can't decode byte 0xc3 in position 10: ordinal 
> not in range(128)

UTF-8 mode is only supported in Python 3.7 and later:

   https://docs.python.org/3/whatsnew/3.7.html#whatsnew37-pep540
-- 
Marc-Andre Lemburg
eGenix.com

--

___
Python tracker 

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



[issue45234] copy_file raises FileNotFoundError when src is a directory

2021-09-17 Thread Alex Grund


New submission from Alex Grund :

After https://bugs.python.org/issue43219 was resolved the function now shows 
faulty behavior when the source is a directory:

`copy_file('/path/to/dir', '/target')` throws a FileNotFoundError while 
previously it was a IsADirectoryError which is clearly correct.

See https://github.com/python/cpython/pull/27049#issuecomment-921647431

--
components: Library (Lib)
messages: 402057
nosy: Alex Grund
priority: normal
severity: normal
status: open
title: copy_file raises FileNotFoundError when src is a directory
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue43413] tuple subclasses allow arbitrary kwargs

2021-09-17 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Oh, and I see now Serhiy has proposed a change that looks reasonable.

--

___
Python tracker 

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



[issue43413] tuple subclasses allow arbitrary kwargs

2021-09-17 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

>> Subclass of set can now define
> Is there any use case for this?

Is your concern about a use-case for the general concept or for set 
specifically?

I appreciate that Serhiy has taken the time to evaluate the specific concern I 
raised and extrapolate it to the implications for most/all built-in types. It 
seems worthwhile to me that built-in types have consistent behaviors. Moreover, 
it seems preferable to provide the intuitive behavior (allowing simply 
overriding `__new__`) without the baggage of needing to define `__init__`. I'd 
not be surprised if there was a real-world use-case in which `set.__new__` was 
overridden in a subclass and the user was forced to add an `__init__` just to 
bypass "set() takes no keyword arguments". Interestingly, searching the web for 
that exact error doesn't emit any results, so if someone has encountered it, it 
wasn't posted with the error message.

After exploring this some, I'm convinced there may not be a strong case for 
this behavior.

Raymond, if this new behavior was removed, how would you propose to rewrite the 
test (specifically 
https://github.com/python/cpython/blob/778b07565e38cc94aa90318eb47b9cd09716756a/Lib/test/test_set.py#L665-L673)?

--

___
Python tracker 

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



[issue45232] ascii codec is used by default when LANG is not set

2021-09-17 Thread Olivier Delhomme

Olivier Delhomme  added the comment:

Hi Marc-Andre,

Please note that setting PYTHONUTF8 with "export PYTHONUTF8=1":

* Is external to the program and user dependent
* It does not seems to work on my use case:

  $ unset LANG
  $ export PYTHONUTF8=1
  $ python3 
  Python 3.6.4 (default, Jan 11 2018, 16:45:55) 
  [GCC 4.8.5] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> machaine='help me if you can'
 File "", line 0

   ^
   SyntaxError: 'ascii' codec can't decode byte 0xc3 in position 10: ordinal 
not in range(128)


Regards,

Olivier.

--

___
Python tracker 

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



[issue45229] Always use unittest for collecting tests in regrtests

2021-09-17 Thread Zachary Ware


Zachary Ware  added the comment:

See also bpo-16748

--
nosy: +zach.ware

___
Python tracker 

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



[issue30511] shutil.make_archive should not need to chdir (alternatively: make shutil.make_archive thread-safe)

2021-09-17 Thread Filipe Laíns

Change by Filipe Laíns :


--
nosy: +FFY00
nosy_count: 8.0 -> 9.0
pull_requests: +26830
pull_request: https://github.com/python/cpython/pull/28271

___
Python tracker 

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



[issue45187] Some tests in test_socket are not run

2021-09-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue45212] Dangling threads in skipped tests in test_socket

2021-09-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue45212] Dangling threads in skipped tests in test_socket

2021-09-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 54a1760cde7bb01e5574734c389c0746762218fd by Serhiy Storchaka in 
branch 'main':
bpo-45212: Add a comment for time.sleep() in tests (GH-28414)
https://github.com/python/cpython/commit/54a1760cde7bb01e5574734c389c0746762218fd


--

___
Python tracker 

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



[issue45232] ascii codec is used by default when LANG is not set

2021-09-17 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Yes, this is intended. ASCII is used as fallback in case Python
cannot determine the I/O encoding to use during startup. This is
also the reason why later changes to the environment have no
affect on this - the determination of the encoding has already
been applied.

You can force UTF-8 by enabling the UTF-8 mode:

export PYTHONUTF8=1

This will then have Python use UTF-8 regardless of the LANG
env var setting.

--
nosy: +lemburg

___
Python tracker 

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



[issue10611] sys.exit() in a test causes a test run to die

2021-09-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests:  -26829

___
Python tracker 

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



  1   2   >