[issue29971] Lock.acquire() not interruptible on Windows

2021-03-20 Thread Eryk Sun


Change by Eryk Sun :


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

___
Python tracker 

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



[issue29971] Lock.acquire() not interruptible on Windows

2021-03-20 Thread Eryk Sun


Change by Eryk Sun :


--
components: +Extension Modules, Interpreter Core
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7

___
Python tracker 

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



[issue29178] Adding bytes.frombuffer(byteslike) constructor

2021-03-20 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7

___
Python tracker 

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



[issue30374] Make win_add2path.py take effect without having to log off

2021-03-20 Thread Eryk Sun


Change by Eryk Sun :


--
components:  -ctypes
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7

___
Python tracker 

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



[issue43566] Docs say int('010', 0) is not legal, but it is

2021-03-20 Thread Chris Wilson


Chris Wilson  added the comment:

Actually, octal is not a legal literal in Python 3, sorry.

--
resolution:  -> rejected

___
Python tracker 

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



[issue43566] Docs say int('010', 0) is not legal, but it is

2021-03-20 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue30405] build.bat: register binaries for py launcher

2021-03-20 Thread Eryk Sun


Change by Eryk Sun :


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

___
Python tracker 

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



[issue27602] Enable py launcher to launch repository Python.

2021-03-20 Thread Eryk Sun


Eryk Sun  added the comment:

See also bpo-30405, which has more discussion about supporting PEP 514 in the 
launcher.

--

___
Python tracker 

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



[issue30405] build.bat: register binaries for py launcher

2021-03-20 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7

___
Python tracker 

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



[issue29996] Use terminal width by default in pprint

2021-03-20 Thread Eryk Sun


Change by Eryk Sun :


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

___
Python tracker 

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



[issue29996] Use terminal width by default in pprint

2021-03-20 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7

___
Python tracker 

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



[issue28166] WindowsConsoleIO misbehavior when Ctrl+C is ignored

2021-03-20 Thread Eryk Sun


Change by Eryk Sun :


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

___
Python tracker 

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



[issue28166] WindowsConsoleIO misbehavior when Ctrl+C is ignored

2021-03-20 Thread Eryk Sun


Change by Eryk Sun :


--
components: +Interpreter Core -Library (Lib)
versions: +Python 3.10 -Python 3.7

___
Python tracker 

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



[issue37871] Windows: WindowsConsoleIO produces mojibake for strings longer than 32 KiB

2021-03-20 Thread Eryk Sun


Change by Eryk Sun :


--
stage:  -> needs patch
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7

___
Python tracker 

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



[issue43535] Make str.join auto-convert inputs to strings.

2021-03-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Vedran, it is not what strong typing means. Strong typing means that '2'+3 is 
an error instead of '23' or 5. str.join() expects an iterable of strings. If 
some of items is not a string, it is a sign of programming error. I prefer to 
get an exception rather of silently conversion of unexpected value to string 
'None', '[]' or ''.

So if you want such feature, it should be separate method or function.

But there is other consideration. Of 721 uses of the join() method (excluding 
os.path.join()) in the stdlib, only 10 need forceful stringification with 
map(str, ...). For tests it is 842 to 20, and for Doc/venv/ it is 1388 to 30. I 
am sure the same ratio is for any other large volume of code. So that feature 
would actually have very small use - 1-2% of use of str.join().

Specially to Raymond, map(str, ...) is good opportunity to teach about 
iterators and introduce to itertools.

--

___
Python tracker 

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



[issue29996] Use terminal width by default in pprint

2021-03-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Closing then. I'll just add my implementation in my .pythonrc.py.

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



[issue29178] Adding bytes.frombuffer(byteslike) constructor

2021-03-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am more warm to this feature now (+0). Not because it would allow to write 
some code shorter, but because it can be in line with other type-strict 
alternate constructors, like int.fromnumber() and int.parse(). But questions 
about parameters and subclasses still stay.

--

___
Python tracker 

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



[issue43556] fix attr names for ast.expr and ast.stmt

2021-03-20 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 2.0 -> 3.0
pull_requests: +23701
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24940

___
Python tracker 

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



[issue43520] Make Fraction(string) handle non-ascii slashes

2021-03-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It would be nice to have an utility function in unicodedata to convert Unicode 
characters to their ASCII equivalents (if they exist). It would allow to 
explicitly convert all slashes to / (and all digits to 0-9) before passing 
string to Fraction constructor.

AFAIK there is a special Unicode document and tables for this.

--
components: +Unicode
nosy: +serhiy.storchaka, vstinner

___
Python tracker 

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



[issue43520] Make Fraction(string) handle non-ascii slashes

2021-03-20 Thread Mark Dickinson


Mark Dickinson  added the comment:

Carl: can you say more about the problem that motivated this issue?

--

___
Python tracker 

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



[issue43502] [C-API] Convert obvious unsafe macros to static inline functions

2021-03-20 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Based on the feedback, I'm closing this. The PyUnicode_* macros, or the 
callers, can be fixed in a separate issue.

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



[issue43526] Programmatic management of BytesWarning doesn't work for native triggers.

2021-03-20 Thread Xavier Morel

Xavier Morel  added the comment:

> In normal circumstances you should never deal with BytesWarning. The -b 
> option is only used for testing your program for some possible bugs caused by 
> migration from Python 2. If your program always worked only with Python 3, 
> the -b option has no use for you.

That's technically true for perfect programs, but practically if the program is 
not tested enough it's possible for it to contain unexpected instances of 
stringifying bytes which pass by mostly unnoticed, just with garbage bits of 
output which may or may not get reported.

Noticing such cases in an existing codebase is exactly what prompted me to try 
and enable BytesWarning (and then try and filter them to just conversion 
warnings, as the category is quite noisy with somewhat uninteresting warnings), 
and then spend a while trying to understand why programmatically enabling 
BytesWarning didn't do anything.

As noted in the last paragraph it's fine if `-b` is required to enable the 
feature, I'd just like to know if it could be documented clearly as it's 
somewhat frustrating to pore over the documentation of `warnings`, 
`BytesWarning`, and `-b`, diff the state of the filters configuration, etc… and 
end up finding out from a bpo comment whether the behaviour you're observing is 
intentional or not.

--

___
Python tracker 

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



[issue43567] regen.vcxproj cannot regenerate some necessary files

2021-03-20 Thread Jiaxin Peng


New submission from Jiaxin Peng :

I tried to modify Grammar/python.gram, Grammar/Tokens, Parser/Python.asdl, to 
add a new token to the grammar. And when using `build.bat --regen`, only 
parser.c is newly generated. Other files, as mentioned in 
https://devguide.python.org/grammar/ that should be updated:ast.c, Python-ast.h 
etc.
regen.vcxproj is now not capable for the new PEG parser. So an update is need.

--
components: Build
messages: 389155
nosy: pjx206
priority: normal
severity: normal
status: open
title: regen.vcxproj cannot regenerate some necessary files
type: compile error
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



[issue43563] Use dedicated opcodes to speed up calls/attribute lookups with super() as receiver

2021-03-20 Thread Mark Shannon


Mark Shannon  added the comment:

Why?

Do you have any evidence that the overhead of super() is significant in real 
programs, or that the proposed change actually speeds up anything beyond your 
micro-benchmark?

--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue43568] Drop support for Mac OS X < 10.3 module linking

2021-03-20 Thread Joshua Root


New submission from Joshua Root :

The `-undefined dynamic_lookup` option can only be used in LDSHARED on Mac OS X 
10.3 and later. There is a fallback to explicitly linking with the framework 
for 10.2 and earlier. I'm pretty sure that currently supported Python versions 
don't build on 10.2 or older for several other reasons (I happen to know that 
even building on 10.5 requires a little patching.) So it's probably reasonable 
to just drop this code path.

There is a closely related check in distutils, though you would only know it's 
related if you looked through the history as I did. It errors out if you try to 
build a module for an older MACOSX_DEPLOYMENT_TARGET than Python was configured 
with. The purpose of that is to prevent using the wrong LDSHARED flags for the 
target platform. If 10.2 support is dropped, that check can be removed entirely.

I am aware that distutils is deprecated, going away, etc., and I am submitting 
a PR to setuptools as well. But setuptools does not yet override the stdlib 
distutils with its own by default, so bugs in the stdlib copy are still 
relevant.

If it's decided to keep 10.2 support, the check in distutils should still be 
relaxed to error only if the current MDT is < 10.3 and the configured MDT is >= 
10.3. I can easily put together a PR for that if needed.

Either way, the approach taken in setuptools will depend on how LDSHARED is 
handled here.

--
components: Build, Distutils, macOS
messages: 389157
nosy: dstufft, eric.araujo, jmr, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Drop support for Mac OS X < 10.3 module linking
type: enhancement
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue43568] Drop support for Mac OS X < 10.3 module linking

2021-03-20 Thread Joshua Root


Change by Joshua Root :


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

___
Python tracker 

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



[issue24505] shutil.which wrong result on Windows

2021-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue28188] os.putenv should support bytes arguments on Windows

2021-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue32865] os.pipe creates inheritable FDs with a bad internal state on Windows

2021-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue32862] os.dup2(fd, fd, inheritable=False) behaves inconsistently

2021-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue29971] Lock.acquire() not interruptible on Windows

2021-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue30405] build.bat: register binaries for py launcher

2021-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue37871] Windows: WindowsConsoleIO produces mojibake for strings longer than 32 KiB

2021-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue43520] Make Fraction(string) handle non-ascii slashes

2021-03-20 Thread STINNER Victor

STINNER Victor  added the comment:

Usually, constructors try to accept format returned by repr(obj), or even 
str(obj). It's the case for Fraction:

>>> str(fractions.Fraction(1, 2))
'1/2'
>>> fractions.Fraction("1/2")
Fraction(1, 2)

It works as expected.

I dislike the idea of trying to handle more Unicode characters which "look 
like" "/", or characters like "⅔". It sounds like a can of worm, and I don't 
think that such feature belongs to the stdlib. You can easily write your helper 
function accepting string and returning a fraction.

If someone is motivated to accept more character, I would prefer to have an 
unified proposition covering all Python number types (int, float, Fraction, 
complex, etc.) and listing all characters. Maybe a PEP would make sense.

--

___
Python tracker 

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



[issue43552] Add locale.get_locale_encoding() and locale.get_current_locale_encoding()

2021-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

Python uses GetACP(), the ANSI code page of the operating system, for years. 
What is the advantage of using a different encoding? In my experience, most 
applications use the ANSI code page because they use the ANSI flavor of the 
Windows API.

What is the use case for using ___lc_codepage()? Is it a different encoding?

--

___
Python tracker 

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



[issue43569] test_importlib failed on installed Python

2021-03-20 Thread STINNER Victor


New submission from STINNER Victor :

Example on aarch64 Fedora Stable Clang Installed 3.x:
https://buildbot.python.org/all/#/builders/14/builds/804

==
ERROR: test_open_binary (test.test_importlib.test_open.OpenDiskNamespaceTests)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang-installed/build/target/lib/python3.10/test/test_importlib/test_open.py",
 line 67, in setUp
from . import namespacedata01
ImportError: cannot import name 'namespacedata01' from 'test.test_importlib' 
(/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang-installed/build/target/lib/python3.10/test/test_importlib/__init__.py)

==
ERROR: test_open_binary_FileNotFoundError 
(test.test_importlib.test_open.OpenDiskNamespaceTests)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang-installed/build/target/lib/python3.10/test/test_importlib/test_open.py",
 line 67, in setUp
from . import namespacedata01
ImportError: cannot import name 'namespacedata01' from 'test.test_importlib' 
(/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang-installed/build/target/lib/python3.10/test/test_importlib/__init__.py)

==
ERROR: test_open_text_FileNotFoundError 
(test.test_importlib.test_open.OpenDiskNamespaceTests)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang-installed/build/target/lib/python3.10/test/test_importlib/test_open.py",
 line 67, in setUp
from . import namespacedata01
ImportError: cannot import name 'namespacedata01' from 'test.test_importlib' 
(/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang-installed/build/target/lib/python3.10/test/test_importlib/__init__.py)

==
ERROR: test_open_text_default_encoding 
(test.test_importlib.test_open.OpenDiskNamespaceTests)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang-installed/build/target/lib/python3.10/test/test_importlib/test_open.py",
 line 67, in setUp
from . import namespacedata01
ImportError: cannot import name 'namespacedata01' from 'test.test_importlib' 
(/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang-installed/build/target/lib/python3.10/test/test_importlib/__init__.py)

==
ERROR: test_open_text_given_encoding 
(test.test_importlib.test_open.OpenDiskNamespaceTests)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang-installed/build/target/lib/python3.10/test/test_importlib/test_open.py",
 line 67, in setUp
from . import namespacedata01
ImportError: cannot import name 'namespacedata01' from 'test.test_importlib' 
(/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang-installed/build/target/lib/python3.10/test/test_importlib/__init__.py)

==
ERROR: test_open_text_with_errors 
(test.test_importlib.test_open.OpenDiskNamespaceTests)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang-installed/build/target/lib/python3.10/test/test_importlib/test_open.py",
 line 67, in setUp
from . import namespacedata01
ImportError: cannot import name 'namespacedata01' from 'test.test_importlib' 
(/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang-installed/build/target/lib/python3.10/test/test_importlib/__init__.py)

==
ERROR: test_is_dir (test.test_importlib.test_reader.MultiplexedPathTest)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang-installed/build/target/lib/python3.10/test/test_importlib/test_reader.py",
 line 48, in test_is_dir
self.assertEqual(MultiplexedPath(self.folder).is_dir(), True)
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.clang-installed/build/target/lib/python3.10/importlib/readers.py",
 line 63, in __init__
raise NotADirectoryError('MultiplexedPath only supports directories')
Not

[issue43569] test_importlib failed on installed Python

2021-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like tests were added by:

commit 67148254146948041a77d8a2989f41b88cdb2f99
Author: Jason R. Coombs 
Date:   Thu Mar 4 13:43:00 2021 -0500

bpo-42129: Add support for resources in namespaces (GH-24670)

* Unify behavior in ResourceReaderDefaultsTests and align with the behavior 
found in importlib_resources.
* Equip NamespaceLoader with a NamespaceReader.
* Apply changes from importlib_resources 5.0.4

--

___
Python tracker 

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



[issue11354] argparse: nargs could accept range of options count

2021-03-20 Thread Alex Kanitz


Alex Kanitz  added the comment:

Given that people were asking for real-world use cases, here's one: 
high-throughput sequencing, e.g., in RNA-Seq 
(https://en.wikipedia.org/wiki/RNA-Seq), typically yields either one or two 
output files, depending on the type of the sequencing library. As the 
processing of these library types is very similar, bioinformatics tools dealing 
with these inputs thus typically have APIs that take exactly 1 or 2 files as 
inputs. As there is quite a wide range of tools for dealing with such inputs, 
several of which implemented in Python, I believe there is indeed an interest 
in this functionality. On a more conceptual note: it is also consistent with 
similar and often-used functionality in regexes, from which, I suppose, the '+' 
and '*' notation is borrowed.

Currently implementing such a tool, I ran into the argparse limitation 
described here: either I (a) use a positional param with nargs=1 for the first 
file and define an optional param for the second file (inconsistent, 
non-intuitive and semantically incorrect API, because if there IS a second 
file, it is not really optional), (b) use nargs='+', do the admittedly simple 
post-processing/validation and either ignore keep the auto-generated usage 
string(wrong/misleading), hardcode the correct usage string (maintenance burden 
because of several optional params) or apply this patch (or just the auto-usage 
generation function), which seems rather expensive, or (c) have the user pass 
the second file in one string, separated by a comma or similar (also not very 
intuitive and needs some checks to ensure that the filename/s don't actually 
include commas).

--
nosy: +uniqueg

___
Python tracker 

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



[issue42129] Support resources in namespace packages

2021-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

Please see bpo-43569: "test_importlib failed on installed Python" regression 
introduced by commit 67148254146948041a77d8a2989f41b88cdb2f99.

--
nosy: +vstinner

___
Python tracker 

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



[issue42129] Support resources in namespace packages

2021-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

I reopen the issue.

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

___
Python tracker 

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



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

2021-03-20 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +23703
pull_request: https://github.com/python/cpython/pull/24944

___
Python tracker 

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



[issue43481] PyEval_EvalCode() namespace issue not observed in Python 2.7.

2021-03-20 Thread Chris Morton


Chris Morton  added the comment:

Hi Terry, The reason why your code does not reproduce the issue is because you 
first execute the code in a global context which then puts the definition of c 
in that context. Subsequent calling in the local context then works. If you 
remove the first exec call (no need for the Class lines either), you will now 
see the issue in 3.8.
This issue is reproducible for other containers such as lists and sets, instead 
of dictionary, in this case. Replacing range(len(c)) with range(4) also shows 
the same error. The error relates to the use of the indexing operator []. The 
same error is observed with other sequences such as:

c={1,2,3,4} 

or

c='1234'

--

___
Python tracker 

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



[issue23948] Deprecate os.kill() on Windows

2021-03-20 Thread John Ehresman


John Ehresman  added the comment:

The original idea was to not use kill on win32 because developers often assume 
it will work like it does on unix-like OS's -- my claim is while kill could be 
improved on win32, it still won't support all the things kill can do elsewhere. 
 

I don't think this idea has much, if any support so I suggest closing this bug 
and opening other specific bugs to improve it on win32 for the ideas mentioned 
in the comments.

--

___
Python tracker 

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



[issue43536] 3.9.2 --without-pymalloc --with-pydebug --with-valgrind: test failed: test_posix

2021-03-20 Thread Ned Deily


Ned Deily  added the comment:

Please report the verbose results from the failing test cases; otherwise we are 
just guessing at what the exact failure is.  Use the -w or -v options to 
test.regrtest.

--
nosy: +ned.deily

___
Python tracker 

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



[issue43563] Use dedicated opcodes to speed up calls/attribute lookups with super() as receiver

2021-03-20 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Currently, super() is decoupled from the core language.  It is just a builtin 
that provides customized attribute lookup.  This PR makes super() more tightly 
integrated with the core language, treating it as if it were a keyword and part 
of the grammar.  Also note, users can currently create their own versions of 
super(), shadowing the builtin super().

--
nosy: +rhettinger

___
Python tracker 

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



[issue43570] pyspecific.py > AuditEvent mess with translations

2021-03-20 Thread Julien Palard

New submission from Julien Palard :

In case an `.. audit-event::` has a content, Sphinx gets confused:

It will provide both "auto-generated" and the content in po files, for 
interactivehook for example we have:

#: library/sys.rst:953
msgid ""
"Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` 
"
"with argument ``hook``."
msgstr ""

#: library/sys.rst:955
msgid ""
"Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` 
"
"with the hook object as the argument when the hook is called on startup."
msgstr ""
"Lève un :ref:`évènement d'audit ` 
``cpython.run_interactivehook`` "
"avec l'objet de point d'entrée comme argument lorsqu'il est appelé au "
"démarrage."

Which is not needed as only the content is used to render the doc, but it's the 
least issue. The issue is that Sphinx will then check the used one (content) 
against the translation of the auto-generated one leading it to trigger a 
warning on case the :ref: used don't match, typically for:


.. audit-event:: sys.unraisablehook hook,unraisable sys.unraisablehook

   Raise an auditing event ``sys.unraisablehook`` with arguments
   ``hook``, ``unraisable`` when an exception that cannot be handled occurs.
   The ``unraisable`` object is the same as what will be passed to the hook.
   If no hook has been set, ``hook`` may be ``None``.


Sphinx will compare the auto-generated one:

Raises an :ref:`auditing event ` ``sys.unraisablehook`` with 
arguments ``hook``, ``unraisable``.

Against our translated one (Lève un évènement d'audit ...).

Issue is, as in "Raise an auditing event" there's no :ref:, but as we 
translated "Raises an :ref:`auditing event `" we used one, Sphinx 
whines about inconsistent term references.

As far as I understand it, it's related, or near, the:

if self.content:
self.state.nested_parse(self.content, self.content_offset, pnode)
else:
n, m = self.state.inline_text(text, self.lineno)
pnode.extend(n + m)

part of pyspecific.py.

--
assignee: docs@python
components: Documentation
messages: 389169
nosy: docs@python, mdk, steve.dower
priority: normal
severity: normal
status: open
title: pyspecific.py >  AuditEvent mess with translations
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



[issue43571] Add option to create MPTCP sockets

2021-03-20 Thread Rui Cunha


Change by Rui Cunha :


--
components: Extension Modules
nosy: RuiCunhaM, ncoghlan, petr.viktorin
priority: normal
severity: normal
status: open
title: Add option to create MPTCP sockets
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue43535] Make str.join auto-convert inputs to strings.

2021-03-20 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue43570] pyspecific.py > AuditEvent mess with translations

2021-03-20 Thread Julien Palard


Change by Julien Palard :


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

___
Python tracker 

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



[issue43571] Add option to create MPTCP sockets

2021-03-20 Thread Rui Cunha


Change by Rui Cunha :


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

___
Python tracker 

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



[issue43535] Make str.join auto-convert inputs to strings.

2021-03-20 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Of 721 uses of the join() method (excluding os.path.join()) 
> in the stdlib, only 10 need forceful stringification with 
> map(str, ...)

Thanks for looking a real world code.  I'm surprised that the standard library 
stats aren't representative of my experience, perhaps because I tend to write 
numeric code and do more output formatting than is used internally.

--

___
Python tracker 

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



[issue43535] Make str.join auto-convert inputs to strings.

2021-03-20 Thread jack1142


Change by jack1142 :


--
nosy: +jack1142

___
Python tracker 

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



[issue43535] Make str.join auto-convert inputs to strings.

2021-03-20 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

FWIW, I'm running a user poll on Twitter and have asked people to state their 
rationale:

https://twitter.com/raymondh/status/1373315362062626823

Take it with a grain of salt.  Polls totals don't reflect how much thought each 
person put into their vote.

--

___
Python tracker 

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



[issue43517] Fix false positives in circular import detection with from-imports

2021-03-20 Thread Antoine Pitrou


Antoine Pitrou  added the comment:


New changeset 2fd16ef406bba239b1334057fb499496a84b3aa2 by Antoine Pitrou in 
branch 'master':
bpo-43517: Fix false positive in detection of circular imports (#24895)
https://github.com/python/cpython/commit/2fd16ef406bba239b1334057fb499496a84b3aa2


--

___
Python tracker 

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



[issue43452] Microoptimize PyType_Lookup for cache hits

2021-03-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset ee48c7d54147ae906776b9f6f96e8920e097d0c4 by Dino Viehland in 
branch 'master':
bpo-43452: Micro-optimizations to PyType_Lookup (GH-24804)
https://github.com/python/cpython/commit/ee48c7d54147ae906776b9f6f96e8920e097d0c4


--
nosy: +pablogsal

___
Python tracker 

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



[issue43452] Microoptimize PyType_Lookup for cache hits

2021-03-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue43517] Fix false positives in circular import detection with from-imports

2021-03-20 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
pull_requests: +23706
pull_request: https://github.com/python/cpython/pull/24948

___
Python tracker 

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



[issue43452] Microoptimize PyType_Lookup for cache hits

2021-03-20 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +23707
pull_request: https://github.com/python/cpython/pull/24949

___
Python tracker 

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



[issue43569] test_importlib failed on installed Python

2021-03-20 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
assignee:  -> jaraco
nosy: +jaraco

___
Python tracker 

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



[issue43517] Fix false positives in circular import detection with from-imports

2021-03-20 Thread miss-islington


miss-islington  added the comment:


New changeset ac17ed60f2033253248be494a8e1980fe7e3531d by Antoine Pitrou in 
branch '3.9':
[3.9] bpo-43517: Fix false positive in detection of circular imports (GH-24895) 
(GH-24948)
https://github.com/python/cpython/commit/ac17ed60f2033253248be494a8e1980fe7e3531d


--
nosy: +miss-islington

___
Python tracker 

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



[issue43569] test_importlib failed on installed Python

2021-03-20 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Interestingly, the pull request never alerted to any buildbot failures.

Any idea how I can reproduce the issue locally? Is there a docker image that 
would likely replicate the environment in which the tests are failing?

--

___
Python tracker 

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



[issue43535] Make str.join auto-convert inputs to strings.

2021-03-20 Thread Emil Stenström

Emil Stenström  added the comment:

Since the proposal is fully backwards compatible I don’t think preferring the 
old version is a reason against this nicer API. After all, people that like the 
current version can continue using it as they do today. 

Teaching Python to beginners is a great way to find the warts of a language 
(I’ve done it too). In the beginning people struggle with arrays and if-blocks, 
and having to go into how map and the str constructor work together to get a 
comma separated list of ints is just too much. Beginners are an important group 
of programmers that this proposal will clearly benefit.

I’m sure there will be some “None”-strings that will slip through this, but I 
think the upside far outweighs the downside in this case.

Big +1 from me.

--
nosy: +EmilStenstrom

___
Python tracker 

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



[issue42137] Raise an ImportWarning for calling module_repr() on loaders

2021-03-20 Thread Brett Cannon


Brett Cannon  added the comment:

Should try to use __spec__ first, but if it isn't set then fall back on 
module_repr() and raise an ImportWarning. See 
Lib/importlib/_bootstrap.py:_module_repr.

--

___
Python tracker 

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



[issue43517] Fix false positives in circular import detection with from-imports

2021-03-20 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
pull_requests: +23708
pull_request: https://github.com/python/cpython/pull/24950

___
Python tracker 

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



[issue43481] PyEval_EvalCode() namespace issue not observed in Python 2.7.

2021-03-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Foolish me. Commenting out the first exec results in the 2nd exec raising.  
Commenting out the 2nd exec also results in the class code raising, which is 
what I expected.  The point of the class code is to partially explain the 
exception, which is not a bug, but a consequence of passing separate global and 
initial local namespaces, combined with comprehensions being executed, starting 
in 3.0, in a new local namespace, separate from the one you passed in.

The exec doc in https://docs.python.org/3/library/functions.html#exec explains 
the effect of passing different global and local namespaces with "If exec gets 
two separate objects as globals and locals, the code will be executed as if it 
were embedded in a class definition."  There is no class, but this is the only 
way to get the same effect in Python code (without exec/eval).

The NameError has nothing to do with subscripting as it happens upon the 
attempt to load c.  Remove the subscription and the exception it remains.  
Instead, it arises because in 3.x, but not in 2.x, comprehensions are executed 
in a separate local namespace, the same as a method, where the passed in local 
namespace is invisible.

Here are simpler examples that both raise NameError.

exec("c=1\nlist(c for i in [1])", globals(), {})


class A:
c =1
def f(self): c

A().f()

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue43517] Fix false positives in circular import detection with from-imports

2021-03-20 Thread miss-islington


miss-islington  added the comment:


New changeset 66c8adfa27aeea004657ef29b6db4e4c360ad611 by Antoine Pitrou in 
branch 'master':
bpo-43517 (followup): Install additional test directory (GH-24950)
https://github.com/python/cpython/commit/66c8adfa27aeea004657ef29b6db4e4c360ad611


--

___
Python tracker 

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



[issue43517] Fix false positives in circular import detection with from-imports

2021-03-20 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
pull_requests: +23709
pull_request: https://github.com/python/cpython/pull/24951

___
Python tracker 

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



[issue43535] Make str.join auto-convert inputs to strings.

2021-03-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I read all the responses as of this timestamp. They left me more persuaded that 
joining objects with a string (or bytes) is explicit enough that the objects 
*must* be coerced to strings.

A problem with coercion in "1 + '2'" is that there is no 'must'.  The desired 
answer could be either 3 or '12', and neither can be converted to the other, so 
don't guess.

The desired answer for "1 + .5" is much more obviously 1.5 rather than either 1 
or 2, plus the former avoids information loss and leaves the option available 
of rounding or converting however one wants.

One tweet answered my question about masking a bug. Suppose 'words' is intended 
to be an iterable of strings.

>>> words = ['This', 'is', 'a', 'list', 'of', 7, 'words']  # Buggy
>>> print(*words)  # Auto-coercion masks the bug.
This is a list of 7 words
>>> '-'.join(words)  # Current .join does not.
Traceback (most recent call last):
  File "", line 1, in 
'-'.join(words)
TypeError: sequence item 5: expected str instance, int found

With the proposed change, detection of the bug is delayed, as is already the 
case with print.  How much do we care about this possibility?  One possible 
answer is to add a new method, such as 'joins' or builtin function 'join'.

Given the variety of opinions, I think a PEP and SC decision would be needed.

--

___
Python tracker 

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



[issue43535] Make str.join auto-convert inputs to strings.

2021-03-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

-10.  I agree with Serhiy.  Automatic type conversion is rarely a feature.  It 
leads to silent bugs when people pass the wrong things.  Be explicit.

We are intentionally not one of those everything is really a string languages 
like Perl or Javascript.

This core API behavior change is big enough to need a PEP and steering council 
approval.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue43569] test_importlib failed on installed Python

2021-03-20 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Oh, "installed python". So maybe Python requires one register files in more 
than one place to add them to the installation.

--

___
Python tracker 

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



[issue43517] Fix false positives in circular import detection with from-imports

2021-03-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Thanks Antoine!

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue43572] "Too many open files" on macOS buildbot

2021-03-20 Thread Antoine Pitrou


New submission from Antoine Pitrou :

See https://buildbot.python.org/all/#/builders/366/builds/960/steps/5/logs/stdio

--
messages: 389184
nosy: mattbillenstein, pablogsal, pitrou, zach.ware
priority: normal
severity: normal
status: open
title: "Too many open files" on macOS buildbot

___
Python tracker 

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



[issue43517] Fix false positives in circular import detection with from-imports

2021-03-20 Thread miss-islington


miss-islington  added the comment:


New changeset 107cf078910db7c1cafdd486270ba8083d72aed7 by Antoine Pitrou in 
branch '3.9':
[3.9] bpo-43517 (followup): Install additional test directory (GH-24950) 
(GH-24951)
https://github.com/python/cpython/commit/107cf078910db7c1cafdd486270ba8083d72aed7


--

___
Python tracker 

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



[issue43517] Fix false positives in circular import detection with from-imports

2021-03-20 Thread Antoine Pitrou


Change by Antoine Pitrou :


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



[issue43547] support ZIP files with zeroed out fields (e.g. for reproducible builds)

2021-03-20 Thread Robert Pollak


Change by Robert Pollak :


--
nosy: +jondo

___
Python tracker 

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



[issue43569] test_importlib failed on installed Python

2021-03-20 Thread Jason R. Coombs


Change by Jason R. Coombs :


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

___
Python tracker 

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



[issue43520] Make Fraction(string) handle non-ascii slashes

2021-03-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

The proposal I like is for a unicode numeric normalization functions that 
return the ascii equivalent to exist.

These ideally belong in a third party PyPI library anyways, as they're the kind 
of thing that needs updating every time a new unicode revision comes out.  And 
there are often multiple cultural interpretations for some symbols, despite any 
standard, so you'd wind up with a variety of functions and options for which 
behavior to obtain.  That isn't the kind of thing that make for a good stdlib.

Doing this by default within the language syntax itself (and thus stdlib 
constructors) is potentially dangerous and confusing as everything in existence 
in the world today that processes Python source code already has baked in 
single-ascii-token assumptions.  While parsing and tooling could be evolved for 
that, it'd be a major ecosystem impacting change.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue43520] Make Fraction(string) handle non-ascii slashes

2021-03-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


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

___
Python tracker 

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



[issue43571] Add option to create MPTCP sockets

2021-03-20 Thread Gregory P. Smith


New submission from Gregory P. Smith :


New changeset b05b48dd7ab68bf0046356f2abd6d7fe3b5b3d77 by Rui Cunha in branch 
'master':
bpo-43571: Add IPPROTO_MPTCP macro (GH-24946)
https://github.com/python/cpython/commit/b05b48dd7ab68bf0046356f2abd6d7fe3b5b3d77


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue43571] Add option to create MPTCP sockets

2021-03-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Thanks for the contribution!

Simple constant addition.  I ignored the contributor CLA status as a result.  
There's only one way to write this non-logic plumbing.

--
assignee:  -> gregory.p.smith
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed

___
Python tracker 

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



[issue27602] Enable py launcher to launch repository Python.

2021-03-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue29178] Adding bytes.frombuffer(byteslike) constructor

2021-03-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
stage:  -> patch review
versions:  -Python 3.8, Python 3.9

___
Python tracker 

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



[issue43487] Rename __unicode__ methods to __str__ in 2to3 conversion

2021-03-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

We're not accepting anything new into lib2to3 anymore as it is deprecated and 
slated for eventual removal.  I recommend putting any fixers you develop up as 
on PyPI as package(s) for others to use.

--
nosy: +gregory.p.smith
resolution:  -> rejected
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



[issue43535] Make str.join auto-convert inputs to strings.

2021-03-20 Thread Emil Stenström

Emil Stenström  added the comment:

Terry, Gregory: The suggestion is not to change what 1 + "2" does, I fully 
agree that it behaves at it should. The suggestion is to change what 
",".join(1, "2") does. There's no doubt that the intended result is "1, 2". 
That's why it's possible to coerce.

About the example with a list with mixed types: If the reason that example is 
buggy is "this list should only have strings", a better way to enforce that is 
to add types to enforces it.

--

___
Python tracker 

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



[issue37871] Windows: WindowsConsoleIO produces mojibake for strings longer than 32 KiB

2021-03-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Steve's approach makes sense and should be robust.

side note: do we need to care about Windows 7 anymore in 3.10 given that 
microsoft no longer supports it?

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue43542] Add image/heif(heic) to list of media types in mimetypes.py

2021-03-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith
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



[issue43535] Make str.join auto-convert inputs to strings.

2021-03-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

There is a lot of doubt.  That should clearly raise an exception because this 
function is intended to only operate on strings.

Trivial types examples like that gloss over the actual problem.

data_from_some_computations = [b"foo", b"bar"]  # probably returned by a 
function

... later on, some other place in the code ...

colon_sep_data = ":".join(data_from_some_computations)

I guarantee you that 99.999% of the time everyone wants an exception there 
instead of their colon_sep_data to contain `b"foo":b"bar"`.

Implicit conversions always lead to hard to pin down bugs.  An exception raised 
at the source of the problem is very easy to debug in comparison.

--

___
Python tracker 

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



[issue33240] shutil.rmtree fails if inner folder is open in Windows Explorer

2021-03-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Isn't this just "how windows behaves" on some filesystems with little that we 
can do about it?

The only real action item I can see here is that if it is _reasonable_ for us 
to detect the situation and improve the error message, that'd help the users 
(and reduce bugreports like this).

Otherwise I suggest closing it as wont fix / working as the platform intends.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue43569] test_importlib failed on installed Python

2021-03-20 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I've submitted a PR and triggered build by buildbots, but I don't see that the 
indicated builder is building the PR. Shall I just submit and see what happens? 
Any other ideas how to verify the installed builder buildbots?

--

___
Python tracker 

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



[issue43552] Add locale.get_locale_encoding() and locale.get_current_locale_encoding()

2021-03-20 Thread Eryk Sun

Eryk Sun  added the comment:

> In my experience, most applications use the ANSI code page because 
> they use the ANSI flavor of the Windows API.

The default encoding at startup and in the "C" locale wouldn't change. It would 
only differ from the default if setlocale(LC_CTYPE, locale_name) sets it 
otherwise. The suggestion is to match the behavior of nl_langinfo(CODESET) in 
Linux and many other POSIX systems.

When I say the default encoding won't change, I mean that the Universal C 
Runtime (ucrt) system component uses the process ANSI code page as the default 
locale encoding for setlocale(LC_CTYPE, ""). This agrees with what Python has 
always done, but it disagrees with previous versions of the CRT in Windows. 
Personally, I think it's a misstep because the user locale isn't necessarily 
compatible with the process code page, but I'm not looking to change this 
decision. For example, if the user locale is "el_GR" (Greek, Greece) but the 
process code page is 1252 (Latin) instead of 1253 (Greek), I get the following 
result in Python 3.4 (VC++ 10) vs Python 3.5 (ucrt):

>py -3.4 -c "from locale import *; print(setlocale(LC_CTYPE, ''))"
Greek_Greece.1253

>py -3.5 -c "from locale import *; print(setlocale(LC_CTYPE, ''))"
Greek_Greece.1252

The result from VC++ 10 is consistent with the user locale. It's also 
consistent with multilingual user interface (MUI) text, such as error messages, 
or at least it should be, because the user locale and user preferred language 
(i.e. Windows display language) should be consistent. (The control panel dialog 
to set the user locale in Windows 10 has an option to match the display 
language, which is the recommended and default setting.)  For example, Python 
uses system error messages that are localized to the user's preferred language:

>py -c "import os; os.stat('spam')"
Traceback (most recent call last):
  File "", line 1, in 
FileNotFoundError: [WinError 2] Δεν είναι δυνατή η εύρεση του καθορισμένου 
αρχείου από το σύστημα: 'spam'

This example is on a system where the process (system) ANSI code page is 1252 
(Latin), which cannot encode the user's preferred Greek text. Thankfully Python 
3.6+ uses the console's Unicode API, so neither the console session's output 
code page nor the process code page gets in the way. On the other hand, if this 
Greek text is written to a file or piped to a child process using 
subprocess.Popen(), Python's choice of locale encoding based on the process 
code page (Latin) is incompatible with Greek text, and thus it's incompatible 
with the current user's preferred locale and language settings.

The process ANSI code page from GetACP() has its uses, which are important. 
It's a system setting that's independent of the current user locale and thus 
useful when interacting with the legacy system API and as a common encoding for 
inter-process data exchange when applications do not use Unicode and may be 
operating in different locales. So if you're writing to a legacy-encoded text 
file that's shared by multiple users or piping text to an arbitrary program, 
then using the ANSI code page is probably okay. Though, especially for IPC, 
there's a good chance that's it's wrong since Windows has never set, let alone 
enforced, a standard in that case. 

Using the process ANSI code page in the "C" locale makes sense to me. 

> What is the use case for using ___lc_codepage()? Is it a different 
> encoding?

I always forget the "_func" suffix in the name; it's ___lc_codepage_func() [1]. 
The lc_codepage value is the current LC_CTYPE codeset as an integer code page. 
It's the equivalent of nl_langinfo(CODESET) in POSIX. For UTF-8, the code page 
is CP_UTF8 (65001), but this get displayed in locale strings as "UTF-8" (or 
variants such as "utf8"). It could be the LC_CTYPE encoding of just the current 
thread, but Python does not enable per-thread locales.

The CRT has exported ___lc_codepage_func() since VC++ 7.0 (2002), and before 
that the current lc_codepage value itself was directly exported as 
__lc_codepage. However, this triple-dundered function is documented as internal 
and not recommended for use. That's why the code snippet I showed uses 
_get_current_locale() with locinfo cast to __crt_locale_data_public *. This 
takes "public" in the struct name at face value. Anything that's declared 
public should be safe to use, but the locale_t type is frustratingly 
undocumented even for this public data [2].

If neither approach is supported, locale.get_current_locale_encoding() could 
instead parse the current locale encoding from setlocale(LC_CTYPE, NULL). The 
resulting locale string usually includes the codeset (e.g. 
"Greek_Greece.1253"). The exceptions are the "C" locale and BCP-47 (RFC 5646) 
locales that do not explicitly use UTF-8 (e.g. "el_GR" or "el" instead of 
"el_GR.UTF-8"), but these cases can be handled reliably.

---

[1] https://docs.microsoft.com/en-us/cpp/c-runtime-library/lc-codepage-

[issue38890] subprocess.Popen should not emit a ResourceWarning for a detached process

2021-03-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

On POSIX the norm for anything daemonizing itself is to fork() and let the 
parent die so that its original process with the child pid has ended.  But I'm 
used to this being the responsibility of the daemon process.  Not the code 
launching the daemon.

Related, a deferred PEP on supporting any form of daemon stuff in the stdlib:  
https://www.python.org/dev/peps/pep-3143/ along with 
https://pypi.org/project/python-daemon/ and a plethora of other 
daemon/daemonize related PyPI libraries.

Those tend to be about implement proper become a daemon behavior in Python 
processes themselves.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue43542] Add image/heif(heic) to list of media types in mimetypes.py

2021-03-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 20a5b7e986377bdfd929d7e8c4e3db5847dfdb2d by Ilya Stepin in branch 
'master':
bpo-43542: Add heif/heic formats in mimetypes (GH-24917)
https://github.com/python/cpython/commit/20a5b7e986377bdfd929d7e8c4e3db5847dfdb2d


--

___
Python tracker 

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



[issue43542] Add image/heif(heic) to list of media types in mimetypes.py

2021-03-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


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



[issue43080] pprint for dataclass instances

2021-03-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

+0.5 I lean towards just accepting this under the conditions Eric describes 
given that dataclass is a stdlib concept and nobody is likely to claim that 
such output from pprint is a bad thing.

The larger "some form of protocol for pprint to work on all sorts of other 
things" issue (regardless of how) remains a long term wish list item that'll 
probably wind up in PEP land if someone wants to take it on.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue43547] support ZIP files with zeroed out fields (e.g. for reproducible builds)

2021-03-20 Thread Felix C. Stegerman


Change by Felix C. Stegerman :


--
nosy: +obfusk

___
Python tracker 

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



[issue42917] Block stack size for frame objects should be dynamically sizable

2021-03-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue32592] Drop support of Windows Vista and Windows 7

2021-03-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
title: Drop support of Windows Vista and 7 in Python 3.9 -> Drop support of 
Windows Vista and Windows 7
type:  -> enhancement

___
Python tracker 

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



[issue42914] pprint numbers with underscore

2021-03-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue37871] Windows: WindowsConsoleIO produces mojibake for strings longer than 32 KiB

2021-03-20 Thread Eryk Sun


Eryk Sun  added the comment:

> side note: do we need to care about Windows 7 anymore in 
> 3.10 given that microsoft no longer supports it?

If the fix comes in time for Python 3.8, then it needs to support Windows 7. 
For Python 3.9+, the 32 KiB limit can be removed. 

The console documentation still includes the misleading disclaimer about 
"available heap". This refers to a relatively small block of shared memory (64 
KiB IIRC) that's overlayed by a heap, not the default process heap. Shared 
memory is used by system LPC ports to efficiently pass large messages between a 
system server (e.g. csrss.exe, conhost.exe) and a client process. The console 
API used to use an LPC port, but in Windows 8.1+ it uses a driver instead, so 
none of the "available heap" warnings apply anymore. Microsoft should clarify 
the docs to stress that the warning is for Windows 7 and earlier.

--

___
Python tracker 

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



[issue33240] shutil.rmtree fails if inner folder is open in Windows Explorer

2021-03-20 Thread Eryk Sun


Eryk Sun  added the comment:

> Isn't this just "how windows behaves" on some filesystems with 
> little that we can do about it?

The suggestion was to include an error handler that retries unlink() and 
rmdir() -- particularly rmdir() -- a given number of times, probably with an 
exponential back off, before giving up and failing. This accounts for race 
conditions in which the delete succeeds but the file/directory can't be 
unlinked because it's currently open (with delete sharing). A lot of these 
cases are similar to ReadDirectoryChangesExW(), in which the owner of the open 
is immediately notified that the directory was deleted. If they're well 
behaved, like Explorer, they immediately close their handle to allow the 
directory to be unlinked by the system. But that may not be soon enough for the 
process that deleted the directory. The suggested retry loop would help to work 
around this race condition. A couple people were in favor of this being 
provided by the standard library, so everyone isn't forced to implement there 
own workaround for a common problem.

--

___
Python tracker 

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



  1   2   >