[issue43878] ./configure fails on Apple Silicon

2021-04-16 Thread Keith Smiley


Change by Keith Smiley :


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

___
Python tracker 

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



[issue43878] ./configure fails on Apple Silicon

2021-04-16 Thread Keith Smiley


New submission from Keith Smiley :

It seems that Apple Silicon support has been added in 
https://github.com/python/cpython/pull/22855, but when I try to build locally I 
see this error:

```
% ./configure
checking for git... found
checking build system type... Invalid configuration `arm64-apple-darwin20.3.0': 
machine `arm64-apple' not recognized
configure: error: /bin/sh ./config.sub arm64-apple-darwin20.3.0 failed
```

I went through the `autoreconf` instructions to see if the checked in configure 
script was outdated, but it doesn't seem to have fixed the issue.

I was able to fix this locally by updating the config.sub and config.guess 
files (only the former was required but I noticed in previous updates that they 
were updated in lockstep). I'm a bit wary about that change because it doesn't 
seem like they are updated frequently (they haven't been in over 3 years), but 
I will submit it for discussion.

--
components: Build
messages: 391272
nosy: keith
priority: normal
severity: normal
status: open
title: ./configure fails on Apple Silicon
type: compile error
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue43877] Logging Cookbook ambiguity

2021-04-16 Thread Gene Ratzlaff


New submission from Gene Ratzlaff :

In the section titled "Logging to a single file from multiple processes"
I am puzzled by the second example, as follows:
The first example has the listener/logger is in a separate >process< and the 
listener/logger process is (as I would anticipate) started >before< the 
worker/sender processes. 
In the 2nd example, the listener/logger is in a separate >thread< and the 
listener/logger thread is (oddly) started >after< the worker/sender processes.
Please correct it, or explain in the Cookbook what is OK about doing it that 
way, and if it is OK, are there limitations to doing it that way?

--
assignee: docs@python
components: Documentation
messages: 391267
nosy: bluebloodpole, docs@python
priority: normal
severity: normal
status: open
title: Logging Cookbook ambiguity
type: enhancement

___
Python tracker 

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



[issue10663] configure shouldn't set a default OPT

2021-04-16 Thread Arfrever Frehtes Taifersar Arahesis


Arfrever Frehtes Taifersar Arahesis  added the comment:

configure.in is old name of Autoconf input file.
configure.ac is new name of Autoconf input file (and the only name to be 
supported in some future version of Autoconf).
configure.in in CPython project was renamed to configure.ac in 2012 (commit 
0f4c16e29cd7925bd99cb68dba5595eed6e19b62).
Problem described in this issue is still present in configure.ac.

--
resolution: out of date -> 
stage: resolved -> 
status: closed -> open
versions: +Python 3.10 -Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue43768] Possible race condition on multiprocessing.Manager().dict() on macOS

2021-04-16 Thread Ned Deily


Change by Ned Deily :


--
nosy: +davin, pitrou

___
Python tracker 

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



[issue43762] Add audit events for loading of sqlite3 extensions

2021-04-16 Thread Ned Deily


Change by Ned Deily :


--
nosy: +steve.dower

___
Python tracker 

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



[issue43873] bz2.open() docs give conflicting defaults for mode

2021-04-16 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This was fixed in https://github.com/python/cpython/pull/15100 and not 
backported.

--
nosy: +xtreak

___
Python tracker 

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



[issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py

2021-04-16 Thread Guido van Rossum

Guido van Rossum  added the comment:

Yeah,  like this idea. Let’s get this in before beta 1.

--
nosy: +Guido.van.Rossum

___
Python tracker 

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



[issue43873] bz2.open() docs give conflicting defaults for mode

2021-04-16 Thread Ned Deily


Change by Ned Deily :


--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py

2021-04-16 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +24178
pull_request: https://github.com/python/cpython/pull/25449

___
Python tracker 

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



[issue43866] Installation files of the Python

2021-04-16 Thread William Pickard


William Pickard  added the comment:

Python, when installed for all users, installs to %ProgramFiles% (or 
%ProgramFiles(x86)% for 32-bit version on 64-bit Windows).

The %LocalAppData% install is just for you... you didn't install it for 
everyone or you didn't provide Python with the Administrator privileges it 
needs for %ProgramFiles% (IE: No process elevation)

--
nosy: +WildCard65

___
Python tracker 

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



[issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py

2021-04-16 Thread Ken Jin


Ken Jin  added the comment:

Guido, I hope I didn't choose a bad time to send this PR over (I suspect you 
may already be flooded by emails about PEP 563).

The jist of the PR is that it's possible to implement PEP 612 in pure-Python. 
Specifically, PEP 612 says:

> As before, parameters_expressions by themselves are not acceptable in places 
> where a type is expected

https://www.python.org/dev/peps/pep-0612/#valid-use-locations

Currently, the implementation treats ``ParamSpec`` specially in all builtin 
``GenericAlias`` objects just for the sake of ``collections.abc.Callable``. 
There isn't a need for that - it just needs ``collections.abc.Callable`` to 
exhibit that behaviour.

By implementing this in pure Python, we can:
- Conform more strictly to the PEP.
- Reduce complexity of the builtin ``GenericAlias`` and also speed it up 
because less checks are required.
- Not tie more typing.py stuff to builtin ``GenericAlias``, which is a plus in 
my book.

What do you think?

--

___
Python tracker 

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



[issue43877] Logging Cookbook ambiguity

2021-04-16 Thread Ned Deily


Change by Ned Deily :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue31481] telnetlib fails to read continous large output from Windows Telnet Server

2021-04-16 Thread Irit Katriel


Irit Katriel  added the comment:

Nisar, if you are still having the problem (in Python 3) please create a new 
issue with detail on how we can reproduce it.

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

___
Python tracker 

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



[issue6253] optparse.OptionParser.get_usage uses wrong formatter

2021-04-16 Thread Irit Katriel


Change by Irit Katriel :


--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue16718] Mysterious atexit fail

2021-04-16 Thread Irit Katriel


Change by Irit Katriel :


--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue22128] patch: steer people away from codecs.open

2021-04-16 Thread Irit Katriel


Change by Irit Katriel :


--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue10794] Infinite recursion while garbage collecting loops indefinitely

2021-04-16 Thread Irit Katriel


Change by Irit Katriel :


--
stage: needs patch -> resolved
status: pending -> closed

___
Python tracker 

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



[issue43866] Installation files of the Python

2021-04-16 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions:  -Python 3.6, Python 3.7

___
Python tracker 

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



[issue43837] Operator precedence documentation could be more clear

2021-04-16 Thread Guido van Rossum

Guido van Rossum  added the comment:

I defer to Raymond on this. 

Honestly without looking at the website I don’t even recall whether “higher 
precedence” means “binds more tightly” or the opposite. :-) So maybe we should 
change the terminology while we’re at it.

--
nosy: +Guido.van.Rossum, rhettinger

___
Python tracker 

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



[issue43857] Fix the AttributeError message for deletion of a missing attribute

2021-04-16 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +pablogsal
versions:  -Python 3.6, Python 3.7

___
Python tracker 

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



[issue43837] Operator precedence documentation could be more clear

2021-04-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

When I looked at the table yesterday (after several years), I was initially 
confused at the 'reversed' order (before I checked the text above).  Besides 
precedence usually (nearly always) being listed high to low*, the chapter 
itself is highest to lowest, so the table is reversed from the chapter order.

* I checked K C and several sites and images and all I saw had highest at the 
top (highest).  This include other Python charts.

The table has been this way since at least 1.4
https://docs.python.org/release/1.4/ref/ref5.html#HDR18
Guido, how would you feel about reversing it to follow what seems to be the de 
facto standard?

The header 'Operator' could be changed to 'Operator (lowest first)' but I would 
prefer to make that 'Operator (highest first)'.

--
nosy: +gvanrossum, terry.reedy

___
Python tracker 

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



[issue43795] Implement PEP 652 -- Maintaining the Stable ABI

2021-04-16 Thread Petr Viktorin


Petr Viktorin  added the comment:

Thanks! I'll send PRs later.

--

___
Python tracker 

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



[issue43856] Docs for importlib.metadata should mention Python version

2021-04-16 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +24177
pull_request: https://github.com/python/cpython/pull/25448

___
Python tracker 

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



[issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument

2021-04-16 Thread Larry Hastings


Larry Hastings  added the comment:

I admit I hadn't looked that closely at Jelle's PR.  You're right, its effects 
on code size should be minimal.

If I'm reading it correctly, Jelle's PR would suppress NameError by replacing 
the failed value with a new "AnnotationName" object.  It wouldn't handle any 
other exceptions (e.g. ValueError).

Also, as currently implemented it doesn't permit getting attributes or indexing 
into the AnnotationName--if "o" is the object we failed to look up, "o.value" 
and "o[1]" would raise exceptions.  The AnnotationName could be extended with 
__getattr__ and __getitem__, but this makes it even more opinionated.

Also, the PR only adds LOAD_ANNOTATION_GLOBAL; it would presumably also need 
LOAD_ANNOTATION_NAME and LOAD_ANNOTATION_CLASSDEREF.  (I don't think we'd need 
LOAD_ANNOTATION_LOCAL.)

I'll file these comments on the PR.

--

___
Python tracker 

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



[issue43876] argparse documentation contrasting nargs '*' vs. '+' is misleading

2021-04-16 Thread Vince Reuter

Vince Reuter  added the comment:

Here's the docs excerpt that seems misleading:
"""
'+'. Just like '*', all command-line args present are gathered into a list. 
Additionally, an error message will be generated if there wasn’t at least one 
command-line argument present.
"""

--

___
Python tracker 

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



[issue43876] argparse documentation contrasting nargs '*' vs. '+' is misleading

2021-04-16 Thread Vince Reuter


New submission from Vince Reuter :

Standard library docs for argparse, at 
https://docs.python.org/3/library/argparse.html#nargs, suggest that setting 
nargs='+' differs from nargs='*' in that the former will raise a parsing error 
when the argument's omitted while the latter will not. In other words, 
nargs='+' sounds like it's distinguished from nargs='*' by virtue of implicitly 
making `required=True`. This implication isn't valid when the option name has a 
double-hyphen prefix, though: no argument parsing error is thrown for a 
double-hyphen-prefix-named option, even with `nargs='+'`. The docs neglect to 
mention this qualification that prevents `nargs='+'` from implicitly making the 
option required. Originally noticed while using a port of the library to R: 
https://github.com/trevorld/r-argparse/issues/31

--
messages: 391255
nosy: vreuter
priority: normal
severity: normal
status: open
title: argparse documentation contrasting nargs '*' vs.  '+' is misleading

___
Python tracker 

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



[issue43835] Dataclasses don't call base class __init__

2021-04-16 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions:  -Python 3.7

___
Python tracker 

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



[issue43834] Use context manager in StringIO example

2021-04-16 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +benjamin.peterson, stutzbach

___
Python tracker 

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



[issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument

2021-04-16 Thread Guido van Rossum

Guido van Rossum  added the comment:

I thought Jelle’s solution would avoid code bloat — a dedicated opcode. It can 
do whatever is decided.

--
nosy: +Guido.van.Rossum

___
Python tracker 

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



[issue43827] abc conflicts with __init_subclass__

2021-04-16 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +rhettinger, stutzbach
type: crash -> behavior

___
Python tracker 

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



[issue43821] Undocumented behavior of sleep functions and asyncio delayed execution

2021-04-16 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +asvetlov, yselivanov
versions:  -Python 3.6, Python 3.7

___
Python tracker 

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



[issue43807] JSONDecodeError: Extra Data Raised on Long Valid JSON

2021-04-16 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +ezio.melotti, rhettinger

___
Python tracker 

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



[issue43806] asyncio.StreamReader hangs when reading from pipe and other process exits unexpectedly

2021-04-16 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +asvetlov, yselivanov

___
Python tracker 

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



[issue43805] multiprocessing.Queue hangs when process on other side dies

2021-04-16 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +davin, pitrou

___
Python tracker 

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



[issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring

2021-04-16 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions:  -Python 3.6, Python 3.7

___
Python tracker 

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



[issue43875] glob.glob with ** does not always detect symlink loops

2021-04-16 Thread Reuben Thomas


Change by Reuben Thomas :


--
title: path.glob with ** does not always detect symlink loops -> glob.glob with 
** does not always detect symlink loops

___
Python tracker 

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



[issue43875] path.glob with ** does not always detect symlink loops

2021-04-16 Thread Reuben Thomas


Change by Reuben Thomas :


--
components: +Library (Lib)
versions: +Python 3.9

___
Python tracker 

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



[issue43864] [Windows] test_importlib logs: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead

2021-04-16 Thread Brett Cannon


Brett Cannon  added the comment:

Darn, forgot about Windows when I hunted down all the warnings on macOS.

--
assignee:  -> brett.cannon

___
Python tracker 

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



[issue43875] path.glob with ** does not always detect symlink loops

2021-04-16 Thread Reuben Thomas


New submission from Reuben Thomas :

Example session:

$ mkdir foo
$ cd foo
$ ln -s .. bar
$ ln -s .. baz
$ python3.9
Python 3.9.0+ (default, Oct 20 2020, 08:43:38) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from glob import glob
>>> glob('**/README', recursive=True)
[HANG]

Removing either of the symlinks fixes the hang.

--
messages: 391253
nosy: rrt
priority: normal
severity: normal
status: open
title: path.glob with ** does not always detect symlink loops

___
Python tracker 

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



[issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument

2021-04-16 Thread Larry Hastings


Larry Hastings  added the comment:

It would also cause the code generated for the annotations function to 
balloon--the calculation of every value would have to be wrapped in a 
try/except, and for what I assume is an obscure use case.  I'm already getting 
some pushback on the code generated with PEP 649 as it is.

My goal in designing PEP 649 was to take stock semantics and time-shift the 
evaluation of the annotations, adding as little opinion as possible.  I think 
catching NameErrors is too opinionated, much less catching every plausible 
error.

Still, the approach is mentioned in PEP 649.  I assume the Steering Committee 
rules is aware this option exists.  If they rule in favor of adding PEP 649, 
but stipulate that this feature is necessary, I will of course implement it.

--

___
Python tracker 

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



[issue43864] [Windows] test_importlib logs: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead

2021-04-16 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


--
nosy: +shreyanavigyan

___
Python tracker 

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



[issue43874] argparse crashes on subparsers with no dest/metava

2021-04-16 Thread Terence Honles


New submission from Terence Honles :

When creating a simple required subparser the following will result in an error 
instead of an error message:

>>> from argparse import ArgumentParser
>>>
>>> parser = ArgumentParser()
>>> subparsers = parser.add_subparsers(required=True)
>>> subparsers.add_parser('one')
>>> subparsers.add_parser('two')
>>>
>>> parser.parse_args([])

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python3.8/argparse.py", line 1768, in parse_args
args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib64/python3.8/argparse.py", line 1800, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib64/python3.8/argparse.py", line 2035, in _parse_known_args
', '.join(required_actions))
TypeError: sequence item 0: expected str instance, NoneType found

Looking at the code this is because the subparser is actually an action and 
when resolving the name it uses `None` as the subparser name which results in 
the error above.

--
components: Library (Lib)
messages: 391250
nosy: terence.honles
priority: normal
pull_requests: 24176
severity: normal
status: open
title: argparse crashes on subparsers with no dest/metava
type: crash
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



[issue21728] Confusing error message when initialising type inheriting object.__init__

2021-04-16 Thread Irit Katriel


Change by Irit Katriel :


--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue35342] email "default" policy raises exception iterating over unparseable date headers

2021-04-16 Thread Irit Katriel


Irit Katriel  added the comment:

I get the same result on macOS as on Windows, it seems this was fixed in 
https://github.com/python/cpython/pull/22090, there are unit tests there for 
invalid dates passed to parsedate_to_datetime.

--
status: pending -> closed

___
Python tracker 

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



[issue27835] SystemExit in setUpClass etc. terminates test run

2021-04-16 Thread Irit Katriel


Change by Irit Katriel :


--
stage: patch review -> resolved
status: pending -> closed

___
Python tracker 

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



[issue1676820] Add a PeriodicTimer to threading

2021-04-16 Thread Irit Katriel


Irit Katriel  added the comment:

I'm closing this as rejected because the comments were not very supportive of 
the idea and there has been no activity for over 10 years.  There are also more 
possibilities for this now with asyncio.

--
resolution:  -> rejected
stage: patch review -> resolved
status: pending -> closed

___
Python tracker 

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



[issue42256] BaseCookie.__parse_string() doesn't work with expires= between cookies

2021-04-16 Thread Paulie Pena


Paulie Pena  added the comment:

Here's a simple example. This is correctly parsed via a `SimpleCookie().load()` 
call:
'key1=val1, key2=val2'

but this fails to parse:
'key1=val1; expires=Wed, 21 Oct 2015 07:28:00 GMT, key2=val2'

My suggested fix:
str = re.sub(r'(=\w{3},\s[\w\d\s-]{9,11}\s[\d:]{8}\sGMT),', r'\1;', str)

will convert the comma separator to a semicolon, so this will correctly parse:
'key1=val1; expires=Wed, 21 Oct 2015 07:28:00 GMT; key2=val2'

--

___
Python tracker 

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



[issue43873] bz2.open() docs give conflicting defaults for mode

2021-04-16 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

The documentation has been corrected in 3.9. Prior to 3.9 the header was 
bz2.open(filename, mode='r' ...). Now in 3.9 or later the header is 
bz2.open(filename, mode='rb' ...).

--
nosy: +shreyanavigyan

___
Python tracker 

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



[issue43873] bz2.open() docs give conflicting defaults for mode

2021-04-16 Thread Roy Smith


New submission from Roy Smith :

See https://docs.python.org/3.7/library/bz2.html

For bz2.open(), the section header says:

bz2.open(filename, mode='r' ...)

but the text says:

The mode argument ... The default is 'rb'.

As I understand it, 'r' and 'rb' actually do the same thing, but the docs 
should at least be consistent.

--
components: Library (Lib)
messages: 391245
nosy: roysmith
priority: normal
severity: normal
status: open
title: bz2.open() docs give conflicting defaults for mode
versions: Python 3.7

___
Python tracker 

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



[issue43872] Unable to compile cpython in Visual Studio 2019

2021-04-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

Okay, and good luck!

--
resolution:  -> not a bug

___
Python tracker 

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



[issue43872] Unable to compile cpython in Visual Studio 2019

2021-04-16 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

I'm not able to reproduce the error right now. I think I forgot to clean all 
object files and other stuff created during compilation and therefore was 
witnessing the error during rebuilding. I'm closing this issue for now. If I 
come across this error in the future I'll reopen this issue and attach a 
screenshot of the error.

--

___
Python tracker 

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



[issue43872] Unable to compile cpython in Visual Studio 2019

2021-04-16 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


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



[issue43871] urllib.parse.urlparse doesn't check port

2021-04-16 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I guess moving port validation logic to parsing time is done as part of 
https://github.com/python/cpython/pull/16780

--
nosy: +orsenthil, vstinner, xtreak

___
Python tracker 

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



[issue43872] Unable to compile cpython in Visual Studio 2019

2021-04-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

It's almost certainly not a bug in CPython. But you haven't even shown us what 
the error is, so it's impossible to say. What error are you seeing?

--
nosy: +eric.smith

___
Python tracker 

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



[issue43867] multiprocess: catch explicitly SystemExit in the Server class

2021-04-16 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



[issue43867] multiprocess: catch explicitly SystemExit in the Server class

2021-04-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7c29ae1f0585378dba4d220a2c0fb5dd49fdab3e by Victor Stinner in 
branch 'master':
bpo-43867: multiprocessing Server catchs SystemExit (GH-25441)
https://github.com/python/cpython/commit/7c29ae1f0585378dba4d220a2c0fb5dd49fdab3e


--

___
Python tracker 

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



[issue43872] Unable to compile cpython in Visual Studio 2019

2021-04-16 Thread Shreyan Avigyan


New submission from Shreyan Avigyan :

Recently, I'm having some problem compiling cpython from Visual Studio 2019. 
I'm able to compile using the build.bat script. I'm using Visual Studio 2019 
for about 2-3 months now for compiling and developing cpython. But 
unfortunately, some error occurs. While compiling cpython from Visual Studio 
2019 the asdl_c.py, if I remember correctly, raises an exception that it was 
passed no arguments and therefore the build fails. After I compile cpython 
using build.bat script I'm able to build and rebuild cpython from Visual Studio 
2019 without facing any problem for 2-3 days. Then again the error occurs. Can 
anyone explain to why this is happening? Or is this a bug in cpython?

--
messages: 391239
nosy: shreyanavigyan
priority: normal
severity: normal
status: open
title: Unable to compile cpython in Visual Studio 2019
type: compile error

___
Python tracker 

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



[issue43871] urllib.parse.urlparse doesn't check port

2021-04-16 Thread Alexei Pastuchov


New submission from Alexei Pastuchov :

It is possible to get valid ParseResult from the urlparse function even for a 
non-numeric port value. Only by requesting the port it fails[1].
Would it be an improvement if _checknetloc[2] validates the value of port 
properly?


// code snippet
Python 3.8.5 (default, Jan 27 2021, 15:41:15) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib.parse import urlparse
>>> uri = 'xx://foo:bar'
>>> uri_parts = urlparse(uri)
>>> uri_parts.netloc
'foo:bar'
>>> uri_parts.port
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.8/urllib/parse.py", line 174, in port
raise ValueError(message) from None
ValueError: Port could not be cast to integer value as 'bar'
// code snippet

[1] 
https://github.com/python/cpython/blob/e1903e11a3d42512effe336026e0c67f602e5848/Lib/urllib/parse.py#L172
[2] 
https://github.com/python/cpython/blob/e1903e11a3d42512effe336026e0c67f602e5848/Lib/urllib/parse.py#L416

--
messages: 391238
nosy: palik
priority: normal
severity: normal
status: open
title: urllib.parse.urlparse doesn't check port

___
Python tracker 

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



[issue43868] Remove PyOS_ReadlineFunctionPointer from the stable ABI list

2021-04-16 Thread STINNER Victor


STINNER Victor  added the comment:

Yes, please remove it from the limited C API.

PyOS_ReadlineFunctionPointer has a bad API. I fixed recently PyOS_StdioReadline 
because it used the Python C API without holding the GIL. To acquire the GIL, 
you need to access a *private* _PyOS_ReadlineTState variable which is kind of 
unfortunate :-(

commit c353764fd564e401cf47a5d9efab18c72c60014e
Author: Victor Stinner 
Date:   Mon Jun 1 20:59:35 2020 +0200

bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20579)

Fix GIL usage in PyOS_Readline(): lock the GIL to set an exception.

Pass tstate to my_fgets() and _PyOS_WindowsConsoleReadline(). Cleanup
these functions.

See also:

commit fa7ab6aa0f9a4f695e5525db5a113cd21fa93787
Author: Victor Stinner 
Date:   Wed Jun 3 14:39:59 2020 +0200

bpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599)

my_fgets() now calls _PyOS_InterruptOccurred(tstate) to check for
pending signals, rather calling PyOS_InterruptOccurred().

my_fgets() is called with the GIL released, whereas
PyOS_InterruptOccurred() must be called with the GIL held.

test_repl: use text=True and avoid SuppressCrashReport in
test_multiline_string_parsing().

Fix my_fgets() on Windows: fgets(fp) does crash if fileno(fp) is closed.

--
nosy: +vstinner

___
Python tracker 

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



[issue15907] move doctest test-data files into a subdirectory of Lib/test

2021-04-16 Thread Irit Katriel


Irit Katriel  added the comment:

The patch needs to be converted into a github PR.

--
keywords: +easy
nosy: +iritkatriel
stage: patch review -> needs patch
versions: +Python 3.10 -Python 3.5

___
Python tracker 

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



[issue43795] Implement PEP 652 -- Maintaining the Stable ABI

2021-04-16 Thread STINNER Victor


STINNER Victor  added the comment:

> PyThreadState_DeleteCurrent

No.

bpo-37878 explicitly excluded it from the limited C API. IMO it's too close to 
the CPython implementation and so must not be added to the stable ABI.

> Py_GetArgcArgv

No.

Python 3.10 now provides sys.orig_argv which can be read in C.
https://docs.python.org/dev/library/sys.html#sys.orig_argv

Py_GetArgcArgv() is part of the "legacy" C API to initialize Python. The "new" 
PyConfig API provides PyConfig.orig_argv.

FYI in the PyPI top 4000 projects, the function seems to be called by the 
following projects:

2021-02-18/uWSGI-2.0.19.1.tar.gz
2021-02-18/stem-1.8.0.tar.gz
2021-02-18/sphinx-gallery-0.8.2.tar.gz
2021-02-18/setproctitle-1.2.2.tar.gz
2021-02-18/pyuwsgi-2.0.19.1.post0.tar.gz
2021-02-18/mercurial-5.7.tar.gz
2021-02-18/httpretty-1.0.5.tar.gz
2021-02-18/CherryPy-18.6.0.tar.gz
2021-02-18/aws-encryption-sdk-cli-2.1.0.tar.gz

> PyInterpreterState_GetID

Yes.

It's part of the limited C API. IMO technically, it's ok to add to the stable 
ABI. I added it to PC/python3dll.c on purpose. Sadly, it's not available on 
PyPy, but I don't think that the stable ABI must care about PyPy which is a 
different use case.

--

___
Python tracker 

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



[issue43284] sys.getwindowsversion().platform_version is incorrect

2021-04-16 Thread Eryk Sun


Eryk Sun  added the comment:

> shouldn't the documentation provide the information that 
> sys.getwindowsversion().platform_version returns the 
> kernel32.dll version?

platform_version is documented as an "accurate major version, minor version and 
build number of the current operating system, rather than the version that is 
being emulated for the process". That's it's currently using the file version 
of "kernel32.dll" is an implementation detail, one that needs to be changed to 
something more reliable.

Keep in mind that the Python DLL can be embedded in any application, which may 
not be manifested to get the true OS version via GetVersionExW(). For example, 
when running in Windows 10, the default with no manifest reports Windows 8 (NT 
6.2):

>>> sys.getwindowsversion()
sys.getwindowsversion(major=6, minor=2, build=9200, platform=2, 
service_pack='')

Here it is with a manifest that supports Windows 8.1 (NT 6.3):

>>> sys.getwindowsversion()
sys.getwindowsversion(major=6, minor=3, build=9600, platform=2, 
service_pack='')

This is the OS version that's relevant to the application, but for logging and 
other diagnostics, platform_version is provided to get the real version, at 
least if all goes according to plan.

--

___
Python tracker 

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



[issue43862] warnings: -W option and PYTHONWARNINGS now use the message as a regex

2021-04-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 62ec63864822de1dd1933225584e8503ac40c1f9 by Victor Stinner in 
branch 'master':
bpo-43862: Enhance -W cmdline option documentation (GH-25439)
https://github.com/python/cpython/commit/62ec63864822de1dd1933225584e8503ac40c1f9


--

___
Python tracker 

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



[issue41163] test_weakref hangs

2021-04-16 Thread STINNER Victor


STINNER Victor  added the comment:

> Command make hangs on test_weakref 

You don't provide enough information to investigate. You should re-run tests in 
verbose mode and use --timeout=60 to get a traceback where the test hangs.

Since Python 3.6, the test suite (in general) got tons of fixes to make tests 
more reliable, and so it sounds likely that your issue has been fixed in the 
meanwhile.

https://bugs.python.org/issue29796 was specific to Python 2.7 which sounds 
time.sleep() argument towards zero. In Python 3.6, the argument is rounded away 
from zero.

I close the issue. Reopen the issue if you can still reproduce it on Python 
3.10.

--
nosy: +vstinner
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue42967] [CVE-2021-23336] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-04-16 Thread Senthil Kumaran


Senthil Kumaran  added the comment:


New changeset d5b80eb11b4812b4a579ce129ba4a10c5f5d27f6 by Miss Islington (bot) 
in branch '3.8':
bpo-42967: coerce bytes separator to string in urllib.parse_qs(l) (GH-24818) 
(#25345)
https://github.com/python/cpython/commit/d5b80eb11b4812b4a579ce129ba4a10c5f5d27f6


--

___
Python tracker 

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



[issue29799] Add tests for header API of 'urllib.request.Request' class

2021-04-16 Thread Irit Katriel


Irit Katriel  added the comment:

Jaysinh, I see you closed the PR. Did you intend to close this issue as well or 
are you still planning to work on this?

--
nosy: +iritkatriel
status: open -> pending

___
Python tracker 

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



[issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument

2021-04-16 Thread Guido van Rossum


Guido van Rossum  added the comment:

If the NameError were to leave behind a marker wrapping the string, that might 
allow the best of both worlds -- errors don't pass *silently* (an error value 
is returned) and you can still inspect the other annotations.

--

___
Python tracker 

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



[issue43817] Add typing.get_annotations()

2021-04-16 Thread Guido van Rossum


Guido van Rossum  added the comment:

Putting it in inspect makes sense then.

--

___
Python tracker 

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



[issue30898] SSL cert failure running make test during Python 3.6 install

2021-04-16 Thread Irit Katriel


Irit Katriel  added the comment:

Python 3.6 is no longer maintained. Are you seeing this on a more recent 
version?

--
nosy: +iritkatriel
resolution:  -> out of date
status: open -> pending

___
Python tracker 

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



[issue41163] test_weakref hangs

2021-04-16 Thread Irit Katriel


Irit Katriel  added the comment:

Python 36. is no longer maintained. Are you seeing this issue with a more 
recent version?

--
nosy: +iritkatriel
resolution:  -> out of date
status: open -> pending

___
Python tracker 

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



[issue43795] Implement PEP 652 -- Maintaining the Stable ABI

2021-04-16 Thread Petr Viktorin


Petr Viktorin  added the comment:

I unsure about the following symbols.
Victor, do you think they should be part of the stable ABI?

 - PyThreadState_DeleteCurrent
 - Py_GetArgcArgv
 - PyInterpreterState_GetID

--
nosy: +vstinner

___
Python tracker 

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



[issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument

2021-04-16 Thread Larry Hastings


Larry Hastings  added the comment:

> Hey Larry, it would seem that PEP 649 as currently specified would make it 
> impossible to access annotations via the inspect module in cases where 
> x.__annotations__ raises (because one of the annotations references an 
> undefined variable).

That's true.  If PEP 649 is accepted, inspect.signature() might want to catch 
NameError when examining __annotations__ on the object.  Though I'm not sure 
what it should do when the exception is raised.


> I really think that we need *some* way of accessing partial annotations. Even 
> just leaving the failing key out of __annotations__ (but keeping other keys 
> if their annotation works) would be better than failing to return an 
> __annotations__ dict at all.

Unfortunately I don't agree--"errors should never pass silently."  Silently 
omitting the failed annotation seems like it would be a bad experience.  What 
if the value you needed from the annotation was the one that was omitted?  Now 
you have a mystery obscuring your existing problem.

There is a PR against PEP 649 specifically to suppress NameErrors:

https://github.com/larryhastings/co_annotations/pull/3

I haven't merged the PR as I don't agree with it.

--

___
Python tracker 

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



[issue43856] Docs for importlib.metadata should mention Python version

2021-04-16 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 7.0 -> 8.0
pull_requests: +24175
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/25445

___
Python tracker 

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



[issue38530] Offer suggestions on AttributeError and NameError

2021-04-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 0ad81d4db2f409d72f469d0b74ab597be772a68e by Pablo Galindo in 
branch 'master':
bpo-38530: Match exactly AttributeError and NameError when offering suggestions 
(GH-25443)
https://github.com/python/cpython/commit/0ad81d4db2f409d72f469d0b74ab597be772a68e


--

___
Python tracker 

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



[issue43817] Add typing.get_annotations()

2021-04-16 Thread Larry Hastings


Larry Hastings  added the comment:

Assuming this function is added for Python 3.10, I propose that uses of 
typing.get_type_hints() in the standard library that aren't specifically 
dealing with type hints should change to calling this function instead.  I 
currently know of two sites:

   * inspect.signature()
   * functools.singledispatch()

--

___
Python tracker 

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



[issue43284] sys.getwindowsversion().platform_version is incorrect

2021-04-16 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

When we're talking about version are we talking about the kernel32.dll version 
or the Windows version? If we're talking about Windows version then why not use 
the return value of sys.getwindowsversion() itself? How is that function 
getting the Windows version? Moreover shouldn't the documentation provide the 
information that sys.getwindowsversion().platform_version returns the 
kernel32.dll version?

--

___
Python tracker 

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



[issue43870] C API Functions Bypass __import__ Override

2021-04-16 Thread Ian H

New submission from Ian H :

Some of the import-related C API functions are documented as bypassing an 
override to builtins.__import__. This appears to be the case, but the 
documentation is incomplete in this regard. For example, PyImport_ImportModule 
is implemented by calling PyImport_Import which does respect an override to 
builtins.__import__, but PyImport_ImportModule doesn't mention respecting an 
override. On the other hand some routines (like 
PyImport_ImportModuleLevelObject) do not respect an override to the builtin 
import.

Is this something that people are open to having fixed? I've been working on an 
academic project downstream that involved some overrides to the __import__ 
machinery (I haven't figured out a way to do this with just import hooks) and 
having some modules skip going through our override threw us for a bad 
debugging loop. The easiest long-term fix from our perspective is to patch the 
various PyImport routines to always respect an __import__ override. This 
technically is a backwards compatibility break, but I'm unsure if anyone is 
actually relying on the fact that specific C API functions bypass 
builtins.__import__ entirely. It seems more likely that the current behavior 
will cause bugs downstream like it did for us.

--
messages: 391220
nosy: Ian.H
priority: normal
severity: normal
status: open
title: C API Functions Bypass __import__ Override
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue43284] sys.getwindowsversion().platform_version is incorrect

2021-04-16 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


--
nosy: +shreyanavigyan

___
Python tracker 

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



[issue43865] win32_ver and getwindowsversion return different Windows 10 build numbers

2021-04-16 Thread Eryk Sun


Change by Eryk Sun :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> sys.getwindowsversion().platform_version is incorrect

___
Python tracker 

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



[issue38530] Offer suggestions on AttributeError and NameError

2021-04-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 3b82cae774638ecf2baaee8fe2cac8fedafb2ca7 by Pablo Galindo in 
branch 'master':
bpo-38530: Properly extend UnboundLocalError from NameError (GH-25444)
https://github.com/python/cpython/commit/3b82cae774638ecf2baaee8fe2cac8fedafb2ca7


--

___
Python tracker 

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



[issue43284] sys.getwindowsversion().platform_version is incorrect

2021-04-16 Thread Eryk Sun


Change by Eryk Sun :


--
stage:  -> needs patch
title: Inability to fetch build 20H2 -> 
sys.getwindowsversion().platform_version is incorrect
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



[issue43869] Fix documentation of epoch/time.time

2021-04-16 Thread STINNER Victor


STINNER Victor  added the comment:

"platform dependent" was added in 2017 by the commit (bpo-29026): 

commit 23557d59b819f57800ddef0b1373acef8e024670
Author: Eric Appelt 
Date:   Thu Feb 16 05:00:45 2017 -0500

bpo-29026: Clarify documentation of time.time (#34)

* bpo-29026: Clarity documentation of time.time

Clarify the documentation of time.time by more
precisely defining what is meant by "seconds since
the epoch" on most platforms. Additionally explain
how gmtime and localtime may be used to extract
calendar components and convert to a more common
date format.

* bpo-29026: Minor improvements for time.time doc

* bpo-29026: Consistency fixes for time.time doc

---

MS-DOS (no longer supported by Python since 2014) uses 1980-01-01 epoch.

The Windows FILETIME type uses 1601-01-01 epoch. Python has convention 
functions to the Unix 1970-01-01 Epoch:

static __int64 secs_between_epochs = 11644473600; /* Seconds between 1.1.1601 
and 1.1.1970 */

static void
FILE_TIME_to_time_t_nsec(FILETIME *in_ptr, time_t *time_out, int* nsec_out)
{
/* XXX endianness. Shouldn't matter, as all Windows implementations are 
little-endian */
/* Cannot simply cast and dereference in_ptr,
   since it might not be aligned properly */
__int64 in;
memcpy(, in_ptr, sizeof(in));
*nsec_out = (int)(in % 1000) * 100; /* FILETIME is in units of 100 
nsec. */
*time_out = Py_SAFE_DOWNCAST((in / 1000) - secs_between_epochs, 
__int64, time_t);
}

void
_Py_time_t_to_FILE_TIME(time_t time_in, int nsec_in, FILETIME *out_ptr)
{
/* XXX endianness */
__int64 out;
out = time_in + secs_between_epochs;
out = out * 1000 + nsec_in / 100;
memcpy(out_ptr, , sizeof(out));
}

More epochs for more fun:
https://en.wikipedia.org/wiki/Epoch_(computing)#Notable_epoch_dates_in_computing

--

___
Python tracker 

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



[issue43795] Implement PEP 652 -- Maintaining the Stable ABI

2021-04-16 Thread Petr Viktorin


Petr Viktorin  added the comment:

Opened as a separate issue: bpo-43868, Remove PyOS_ReadlineFunctionPointer from 
the stable ABI list

--

___
Python tracker 

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



[issue43869] Fix documentation of epoch/time.time

2021-04-16 Thread STINNER Victor


STINNER Victor  added the comment:

time.time doc says "On Windows and most Unix systems, the epoch is January 1, 
1970, 00:00:00 (UTC)"

The epoch doc says "For Unix, the epoch is January 1, 1970, 00:00:00 (UTC)".

At least, the epoch doc can be completed to also mention that it's the same on 
Windows.

--

___
Python tracker 

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



[issue43869] Fix documentation of epoch/time.time

2021-04-16 Thread STINNER Victor


STINNER Victor  added the comment:

On Windows 10 (build 20H2), I get:

Python 3.10.0a7+ (heads/master:b136b1aac4, Apr 16 2021, 14:36:39) [MSC v.1928 
64 bit (AMD64)] on win32
>>> import time
>>> time.gmtime(0)
time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, 
tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=0)

--
nosy: +vstinner

___
Python tracker 

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



[issue43869] Fix documentation of epoch/time.time

2021-04-16 Thread Ofek Lev


New submission from Ofek Lev :

The descriptions for the following:

- https://docs.python.org/3/library/time.html#epoch
- https://docs.python.org/3/library/time.html#time.time

indicate that it is platform dependent. However, that is likely untrue. See the 
brief discussion here: 
https://github.com/DataDog/integrations-core/pull/6692#discussion_r427469097

--
assignee: docs@python
components: Documentation
messages: 391214
nosy: Ofekmeister, docs@python, p-ganssle
priority: normal
severity: normal
status: open
title: Fix documentation of epoch/time.time
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



[issue38530] Offer suggestions on AttributeError and NameError

2021-04-16 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +24174
pull_request: https://github.com/python/cpython/pull/25444

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2021-04-16 Thread STINNER Victor


STINNER Victor  added the comment:

> Doc/tools/extensions/suspicious.py is a CPython specific extension, it's not 
> part of Sphinx. Maybe someone should open a feature request on Sphinx to get 
> a similar feature without false positives (or at least less false positives).

This extension was written by Gabriel Genellina in 2009 when he discovered that:

   Several documents contain invalid reST markup that "leaks"
   into the html output (missing ``, incorrect indentation, etc.)

Extension added in bpo-4811 with:

commit 700cf28f410521066f40671f1da7db0302d753fd
Author: Georg Brandl 
Date:   Sun Jan 4 10:23:49 2009 +

Add "suspicious" builder which finds leftover markup in the HTML files.

Patch by Gabriel Genellina.


The code didn't evolved much since it was added in 2009. Main changes.

commit 144c269cc8b82ab3b877797e1c7c26b0849e2b56
Author: Ezio Melotti 
Date:   Thu Mar 28 18:01:11 2013 +0200

Update the suspicious builder to detect unused rules, and remove currently 
unusued rules.

bpo-22537:

commit 14b5a4da2732d3464c6b40527458005ccf19f95c
Author: Georg Brandl 
Date:   Thu Oct 2 08:26:26 2014 +0200

Closes #22537: Make sphinx extensions compatible with Python 2 or 3, like 
in the 3.x branches

Filename renamed:

* master: Doc/tools/extensions/suspicious.py
* Commit 160cbce92adc3ccbe4ae6e231ea27fb5ff28dca9 renames 
Doc/tools/suspicious.py to Doc/tools/extensions/suspicious.py
* Commit f16fbf940fdaec594eb1f4c5f9c61e926db53c5d renames 
Doc/tools/sphinxext/suspicious.py to  Doc/tools/suspicious.py

--

___
Python tracker 

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



[issue43817] Add typing.get_annotations()

2021-04-16 Thread Guido van Rossum


Guido van Rossum  added the comment:

Also, for crosslinking, see issue43463.

--

___
Python tracker 

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



[issue38530] Offer suggestions on AttributeError and NameError

2021-04-16 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +24173
pull_request: https://github.com/python/cpython/pull/25443

___
Python tracker 

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



[issue43865] win32_ver and getwindowsversion return different Windows 10 build numbers

2021-04-16 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

I'm also able to reproduce the problem you just described. It's actually not 
the fault of platform.win32_ver. Just type in 
sys.getwindowsversion().platform_version and you'll achieve a similar result. 
Behind the scenes platform.win32_ver is actually deriving it's result from 
sys.getwindowsversion().platform_version. I'm not sure if the result is 
intended or is a bug but Microsoft seems to claim in this post 
https://answers.microsoft.com/en-us/insider/forum/insider_wintp-insider_install-insiderplat_pc/wrong-version-of-kernel32dll-in-win10-insider/b0053ba0-f6e5-48f1-86e3-ddac28d6c4eb
 that both builds are same just the versions are different.

--
nosy: +shreyanavigyan

___
Python tracker 

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



[issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument

2021-04-16 Thread Guido van Rossum


Guido van Rossum  added the comment:

Hey Larry, it would seem that PEP 649 as currently specified would make it 
impossible to access annotations via the inspect module in cases where 
x.__annotations__ raises (because one of the annotations references an 
undefined variable).

I really think that we need *some* way of accessing partial annotations. Even 
just leaving the failing key out of __annotations__ (but keeping other keys if 
their annotation works) would be better than failing to return an 
__annotations__ dict at all.

--
nosy: +larry

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2021-04-16 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote a PR to enhance -W option documentation. The suspicious job complains 
whereas my Sphinx format is valid:

   The full form of argument is::

   action:message:category:module:lineno

Example of suspicious error:

[using/cmdline:438] ":message" found in "action:message:category:module:lineno"

I see that Doc/tools/suspicious.csv already contains an ignore rule for 
Doc/using/cmdline.rst.

--

___
Python tracker 

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



[issue43868] Remove PyOS_ReadlineFunctionPointer from the stable ABI list

2021-04-16 Thread Petr Viktorin


Change by Petr Viktorin :


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

___
Python tracker 

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



[issue43843] libregrtest: mark a test as failed if a thread logs an unexpected exception

2021-04-16 Thread STINNER Victor


STINNER Victor  added the comment:

test_concurrent_futures logs two warnings: I created bpo-43867 for this one.

--

___
Python tracker 

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



[issue43867] multiprocess: catch explicitly SystemExit in the Server class

2021-04-16 Thread STINNER Victor


STINNER Victor  added the comment:

Oh sorry, I was confused. While the issue is seen in test_concurrent_futures, 
my PR 25441 changes the multiprocessing module.

--

___
Python tracker 

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



[issue43868] Remove PyOS_ReadlineFunctionPointer from the stable ABI list

2021-04-16 Thread Petr Viktorin


New submission from Petr Viktorin :

The inclusion of PyOS_ReadlineFunctionPointer in python3dll.c (*) was a 
mistake. According to PEP 384:

> functions expecting FILE* are not part of the ABI, to avoid depending on a 
> specific version of the Microsoft C runtime DLL on Windows.

The situation may have changed and it might be reasonable to revisit this 
decision, but that would call for a larger discussion. There are FILE*-taking 
functions that are probably much ore useful than this one. (But, I think it's a 
good idea to limit the stable ABI to file-like Python objects anyway.)

I see PEP 384 as being definitive (where it's not ambiguous). The python3dll.c 
list and public/private headers do not actually define the stable ABI.

So, I'd like to remove the function from the list.


---

(*) it was actually PC/python3.def in 3.2

--
components: C API, Windows
messages: 391206
nosy: paul.moore, petr.viktorin, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Remove PyOS_ReadlineFunctionPointer from the stable ABI list
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



[issue43867] multiprocess: catch explicitly SystemExit in the Server class

2021-04-16 Thread STINNER Victor


Change by STINNER Victor :


--
title: concurrent.futures: handle explicitly SystemExit in managers.Server -> 
multiprocess: catch explicitly SystemExit in the Server class

___
Python tracker 

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



[issue43867] concurrent.futures: handle explicitly SystemExit in managers.Server

2021-04-16 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



  1   2   >