[issue44814] python 3.9.6 installation installs 0 modules

2021-08-04 Thread Mark Dickinson


Mark Dickinson  added the comment:

Setting as pending. It looks as though this report represents a 
misunderstanding of how Python works rather than a bug in Python.

--
nosy: +mark.dickinson
resolution:  -> not a bug
status: open -> pending

___
Python tracker 

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



[issue44821] Instance dictionaries should be created eagerly

2021-08-04 Thread Mark Shannon


New submission from Mark Shannon :

Currently, instance dictionaries (__dict__ attribute) are created lazily when 
the first attribute is set.

This is bad for performance for a number of reasons:
1. It causes additional checks on every attribute access.
2. It causes allocation of the object and its dict to be temporarily separated, 
most likely leading to increased physical separation and worse cache behavior.
3. It has a large impact on specialization, as the first SET_ATTR for an object 
has to behave differently.


Creating a __dict__ lazily does not save a significant amount of memory.
If an object has a __dict__ slot, then it will end up with a dictionary before 
it dies in almost all cases.

Many objects, e.g. ints, floats, don't have a dictionary. They are unaffected.

Plain python objects that have no instance attributes are extremely rare, 
unless they have __slots__, in which case they don't have a dictionary anyway.

The remaining case is subclasses of builtin types that do not add extra 
attributes, but these are rare, and the overhead of an empty dictionary is only 
64 bytes (on a 64 bit machine).

--
assignee: Mark.Shannon
components: Interpreter Core
messages: 398864
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Instance dictionaries should be created eagerly
type: performance
versions: Python 3.11

___
Python tracker 

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



[issue44822] [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text()

2021-08-04 Thread Erlend E. Aasland


New submission from Erlend E. Aasland :

The third argument to sqlite3_result_text() is the length of the string passed 
as the second argument. Currently, we pass -1, so SQLite has to invoke strlen() 
to compute the length of the passed string. Suggesting to use 
PyUnicode_AsUTF8AndSize() iso. PyUnicode_AsUTF8() and pass the string size to 
avoid the superfluous strlen().

See also:
- https://sqlite.org/c3ref/result_blob.html

--
assignee: erlendaasland
components: Extension Modules
messages: 398865
nosy: erlendaasland
priority: normal
severity: normal
status: open
title: [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text()
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue44822] [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text()

2021-08-04 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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

___
Python tracker 

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



[issue44823] Docs fail to build - looking for the wrong interpreter (Python 3.10-rc1)

2021-08-04 Thread Karolina Surma


New submission from Karolina Surma :

Documentation for Python3.10-rc1 fails to build.
sphinx-build looks for non-existing interpreter, which causes a crash.
Looking at the tarball with Python, there is Doc/venv/ present (which probably 
shouldn't be included) containing executable sphinx-build with shebang " 
#!/home/pablogsal/github/python/3.10/3.10.0rc1/Python-3.10.0rc1/Doc/venv/bin/python3".

Traceback from our Fedora RPM build:

+ make -C Doc html PYTHON=/usr/bin/python3
make: Entering directory '/builddir/build/BUILD/Python-3.10.0rc1/Doc'
venv already exists
mkdir -p build
Using existing Misc/NEWS file
PATH=./venv/bin:$PATH sphinx-build -b html -d build/doctrees   -W . build/html 
/bin/sh: ./venv/bin/sphinx-build: 
/home/pablogsal/github/python/3.10/3.10.0rc1/Python-3.10.0rc1/Doc/venv/bin/python3:
 bad interpreter: No such file or directory
make: Leaving directory '/builddir/build/BUILD/Python-3.10.0rc1/Doc'
make: *** [Makefile:51: build] Error 126

--
assignee: docs@python
components: Documentation
messages: 398866
nosy: docs@python, ksurma
priority: normal
severity: normal
status: open
title: Docs fail to build - looking for the wrong interpreter (Python 3.10-rc1)
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



[issue44824] The 3.10.0rv1 source tarballs contain the Docs/venv directory populated with pablogsal's venv

2021-08-04 Thread Miro Hrončok

New submission from Miro Hrončok :

When we download the signed Python-3.10.0rc1.tgz or Python-3.10.0rc1.tar.xz 
source tarball, we see that the Docs/venv directory contains teh actual virtual 
environment with 
#!/home/pablogsal/github/python/3.10/3.10.0rc1/Python-3.10.0rc1/Doc/venv/bin/python3
 shebangs.

That means, an attempt to build the documentation (e.g. with make html) will 
fail with:

PATH=./venv/bin:$PATH sphinx-build -b html -d build/doctrees   -W . build/html 
/bin/sh: ./venv/bin/sphinx-build: 
/home/pablogsal/github/python/3.10/3.10.0rc1/Python-3.10.0rc1/Doc/venv/bin/python3:
 bad interpreter: No such file or directory
make: Leaving directory '/builddir/build/BUILD/Python-3.10.0rc1/Doc'
make: *** [Makefile:51: build] Error 126

I believe the venv directory should not be part of the release tarball, 
especially since it is unusbale from different paths than pablogsal's 
github/python/3.10/3.10.0rc1/Python-3.10.0rc1 directory.

Also, technically the entire effective license of the tarball is now hard to 
determine, since it contains many different packages.

--
assignee: docs@python
components: Documentation
messages: 398867
nosy: docs@python, hroncok, pablogsal
priority: normal
severity: normal
status: open
title: The 3.10.0rv1 source tarballs contain the Docs/venv directory populated 
with pablogsal's venv
versions: Python 3.11

___
Python tracker 

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



[issue44824] The 3.10.0rc1 source tarballs contain the Docs/venv directory populated with pablogsal's venv

2021-08-04 Thread Miro Hrončok

Change by Miro Hrončok :


--
title: The 3.10.0rv1 source tarballs contain the Docs/venv directory populated 
with pablogsal's venv -> The 3.10.0rc1 source tarballs contain the Docs/venv 
directory populated with pablogsal's venv

___
Python tracker 

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



[issue44756] In ./Doc, "make html" and "make build" should depend on "make venv"

2021-08-04 Thread Miro Hrončok

Miro Hrončok  added the comment:

The 3.10.0rc1 source tarballs contain the Docs/venv directory populated with 
pablogsal's venv: issue44824

--
nosy: +hroncok

___
Python tracker 

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



[issue44822] [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text()

2021-08-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The difference between specifying negative and non-negative third argument of 
sqlite3_result_text() is that in the latter case the result can contain 
embedded NUL characters.

Could you please add a test for string containing embedded NUL?

Letting SQLite compute string length would work incorrect in case of embedded 
NULs, so I think that we should raise explicit error if sz > INT_MAX.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue43498] "dictionary changed size during iteration" error in _ExecutorManagerThread

2021-08-04 Thread Jakub Kulik


Jakub Kulik  added the comment:

I think that even if copy() doesn't fix it entirely, it's still much better 
than nothing. I never encountered the issue mentioned in bpo-40327, but I saw 
this issue several times a week (before applying the proposed patch).

--

___
Python tracker 

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



[issue44823] Docs fail to build - looking for the wrong interpreter (Python 3.10-rc1)

2021-08-04 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Seems like a duplicate of https://bugs.python.org/issue44824

--
nosy: +pablogsal, xtreak

___
Python tracker 

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



[issue44824] The 3.10.0rc1 source tarballs contain the Docs/venv directory populated with pablogsal's venv

2021-08-04 Thread Miro Hrončok

Miro Hrončok  added the comment:

This is the same as https://bugs.python.org/issue44823, sorry about that.

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



[issue44822] [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text()

2021-08-04 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> Could you please add a test for string containing embedded NUL?

Of course, thanks for the heads up.

> I think that we should raise explicit error if sz > INT_MAX.

Yes, I thought about this. I do agree that raising OverflowError would be 
better. Thanks.

--

___
Python tracker 

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



[issue44756] In ./Doc, "make html" and "make build" should depend on "make venv"

2021-08-04 Thread Petr Viktorin


Petr Viktorin  added the comment:

The issue this (or lack of communication about it) caused in rc1 is tracked in 
https://bugs.python.org/issue44823

> @petr.viktorin a whatsnew entry was added, what more notice could have been 
> provided?

Ideally, the python-dev mailing list (or Discourse).

> pip install sphinx blurb python-docs-theme
> If running that is ever unsafe, we have big problems!

Who is "we"?
We do have big problems. Anyone who can upload wheels for sphinx blurb 
python-docs-theme or any of their dependencies (or anyone who has their 
credentials) can now easily put code on machines of CPython developers.

For example, PyPI doesn't guarantee that wheels correspond to sources. 
"Markupsafe" is particularly dangerous because the wheels are platform-specific 
and have compiled code, so tampering is nearly undetectable. (But if another 
dependency starts using platform-specific wheels, I don't think anyone would 
notice.)

--

___
Python tracker 

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



[issue44756] In ./Doc, "make html" and "make build" should depend on "make venv"

2021-08-04 Thread Petr Viktorin


Petr Viktorin  added the comment:

I've sent a mail to python-dev: 
https://mail.python.org/archives/list/python-...@python.org/thread/MGPNI7OSA7UXNOTVDVW2I2GUMXV25FRS/

--

___
Python tracker 

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



[issue44772] Regression in memory use of instances due to dictionary ordering

2021-08-04 Thread Mark Shannon


Mark Shannon  added the comment:

Raymond,
When you say "this was mostly a net win" do you mean the more compact layout or 
ordering?

The compact layout is obviously a win, and doesn't conflict with sharing. The 
problem is that ordering conflicts with sharing.

As long as instances all have attributes that are a subset of the shared keys 
stored on the class, they can share attributes, or least they could in 3.5.

--

___
Python tracker 

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



[issue44823] Docs fail to build - looking for the wrong interpreter (Python 3.10-rc1)

2021-08-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I will look into this ASAP

--

___
Python tracker 

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



[issue44825] node.annotation is not a str in `ast`'s `class _Unparser(NodeVisitor)`

2021-08-04 Thread Samuel Marks


New submission from Samuel Marks :

I tried making `node.annotation` an `ast.Name("str", ast.Load())`, which worked 
but when the AST was unparsed to a string it shows as `# type: `.
https://github.com/offscale/cdd-python/runs/3213864077

Replicate with:
```
unparse(Assign(annotation=None, simple=1, targets=[Name("foo", Store())], 
value=Constant(value=5, kind=None), expr=None, expr_targe
   ...: t=None, expr_annotation=None, type_comment=Name('str', Load()), 
lineno=None))
```

Checking what it expects, it does expect a str. E.g.,:
```
$ python3.9 -c 'import ast; tc=ast.parse("foo = 5 # type: int", 
type_comments=True).body[0].type_comment; print("type_comment is a", 
type(tc).__name__, "with value", tc)'
type_comment is a str with value int
```

But when I do make it a str and unparse it, I get:
```
File "/opt/python3.10/lib/python3.10/ast.py", line 1674, in unparse
return unparser.visit(ast_obj)
  File "/opt/python3.10/lib/python3.10/ast.py", line 808, in visit
self.traverse(node)
  File "/opt/python3.10/lib/python3.10/ast.py", line 799, in traverse
super().visit(node)
  File "/opt/python3.10/lib/python3.10/ast.py", line 410, in visit
return visitor(node)
  File "/opt/python3.10/lib/python3.10/ast.py", line 1005, in visit_FunctionDef
self._function_helper(node, "def")
  File "/opt/python3.10/lib/python3.10/ast.py", line 1023, in _function_helper
self._write_docstring_and_traverse_body(node)
  File "/opt/python3.10/lib/python3.10/ast.py", line 816, in 
_write_docstring_and_traverse_body
self.traverse(node.body)
  File "/opt/python3.10/lib/python3.10/ast.py", line 797, in traverse
self.traverse(item)
  File "/opt/python3.10/lib/python3.10/ast.py", line 799, in traverse
super().visit(node)
  File "/opt/python3.10/lib/python3.10/ast.py", line 410, in visit
return visitor(node)
  File "/opt/python3.10/lib/python3.10/ast.py", line 879, in visit_AnnAssign
self.traverse(node.annotation)
  File "/opt/python3.10/lib/python3.10/ast.py", line 799, in traverse
super().visit(node)
  File "/opt/python3.10/lib/python3.10/ast.py", line 410, in visit
return visitor(node)
  File "/opt/python3.10/lib/python3.10/ast.py", line 414, in generic_visit
for field, value in iter_fields(node):
  File "/opt/python3.10/lib/python3.10/ast.py", line 252, in iter_fields
for field in node._fields:
AttributeError: 'str' object has no attribute '_fields'
```

--
messages: 398878
nosy: samuelmarks
priority: normal
severity: normal
status: open
title: node.annotation is not a str in `ast`'s `class _Unparser(NodeVisitor)`
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue44825] node.annotation is not a str in `ast`'s `class _Unparser(NodeVisitor)`

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



[issue44825] node.annotation is not a str in `ast`'s `class _Unparser(NodeVisitor)`

2021-08-04 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

@samuelmarks can you share the full reproducer / AST and what you expect it to 
be unparsed? (you can use gist or other pasting services if it is too big)

--

___
Python tracker 

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



[issue44825] node.annotation is not a str in `ast`'s `class _Unparser(NodeVisitor)`

2021-08-04 Thread Samuel Marks


Samuel Marks  added the comment:

Hmm, debugging my test and I was able to replicate it with this smaller one:

```
from ast import FunctionDef, arguments, Load, Name, AnnAssign, Store, BinOp, 
Add, unparse
unparse(FunctionDef(args=arguments(args=[],
   defaults=[],
   kw_defaults=[],
   kwarg=None,
   kwonlyargs=[],
   posonlyargs=[],
   vararg=None),
body=[AnnAssign(annotation='int',
simple=1,
target=Name(ctx=Store(),
id='res'),
value=BinOp(left=Name(ctx=Load(),
  id='a'),
op=Add(),
right=Name(ctx=Load(),
   id='b')))],
decorator_list=[],
name='sum',
returns=None,
lineno=None,
type_comment=None))
```

Which for some reason has made the `annotation` a `str` rather than `Name`. So 
I think it's my bug then?

--

___
Python tracker 

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



[issue44756] In ./Doc, "make html" and "make build" should depend on "make venv"

2021-08-04 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal

___
Python tracker 

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



[issue44822] [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text()

2021-08-04 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Serhiy, I've updated the PR, if you want to take a look. Thanks for your 
feedback.

--

___
Python tracker 

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



[issue44823] Docs fail to build - looking for the wrong interpreter (Python 3.10-rc1)

2021-08-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

The tarball in the download server has been updated to not contain the venv 
directory and the release machinery has been updated to account for 
https://bugs.python.org/issue44756

--

___
Python tracker 

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



[issue44823] Docs fail to build - looking for the wrong interpreter (Python 3.10-rc1)

2021-08-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Note, this problem was created due to:

https://bugs.python.org/issue44756

--

___
Python tracker 

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



[issue44756] In ./Doc, "make html" and "make build" should depend on "make venv"

2021-08-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Note this issue has impacted negatively the release process of 3.10.0rc1:

https://bugs.python.org/issue44823

--

___
Python tracker 

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



[issue44823] Docs fail to build - looking for the wrong interpreter (Python 3.10-rc1)

2021-08-04 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue44825] node.annotation is not a str in `ast`'s `class _Unparser(NodeVisitor)`

2021-08-04 Thread Samuel Marks


Samuel Marks  added the comment:

Fixed with https://github.com/offscale/cdd-python/commit/079dc28

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



[issue44825] node.annotation is not a str in `ast`'s `class _Unparser(NodeVisitor)`

2021-08-04 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> Which for some reason has made the `annotation` a `str` rather than `Name`. 
> So I think it's my bug then?

Yes, from what I can see it is a bug in your code.

> body=[AnnAssign(annotation='int',

The 'annotation' field in 'AnnAssign' nodes are designated as expressions. So 
you need to either wrap that into an ast.Name() node, or an ast.Constant() node 
(if you want to stringify it with quotes in the generated code). For more 
information about fields you can read this;

https://github.com/python/cpython/blob/ac811f9b5a68ce8756911ef2c8be83b46696018f/Parser/Python.asdl#L29

--

___
Python tracker 

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



[issue44826] Specialize STORE_ATTR using PEP 659 machinery.

2021-08-04 Thread Mark Shannon


New submission from Mark Shannon :

Add specializations of STORE_ATTR following the pattern of LOAD_ATTR and 
LOAD_GLOBAL.

For this to work well we need https://bugs.python.org/issue44821, otherwise the 
first assigned to an attribute of any object cannot be specialized.

--
messages: 398887
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Specialize STORE_ATTR using PEP 659 machinery.

___
Python tracker 

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



[issue44821] Instance dictionaries should be created eagerly

2021-08-04 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue44826] Specialize STORE_ATTR using PEP 659 machinery.

2021-08-04 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue44822] [sqlite3] Do not truncate results of user functions and aggregates on the first NUL

2021-08-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
title: [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text() 
-> [sqlite3] Do not truncate results of user functions and aggregates on the 
first NUL
type: enhancement -> behavior
versions: +Python 3.10, Python 3.9

___
Python tracker 

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



[issue44827] Incomplete 3.10.0rc1 release info

2021-08-04 Thread PEW's Corner


New submission from PEW's Corner :

The "Files" section is empty on this page:

https://www.python.org/downloads/release/python-3100rc1/

Also, the Python Insider blog post contains the outdated b4 text under "And now 
for something completely different".

--
messages: 39
nosy: pewscorner
priority: normal
severity: normal
status: open
title: Incomplete 3.10.0rc1 release info
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



[issue44828] Using tkinter.filedialog crashes on macOS Python 3.9.6

2021-08-04 Thread Nythepegasus


New submission from Nythepegasus :

Using tkinter.filedialog crashes on macOS 12.0 Beta (21A5294g) on M1 when the 
open file dialog window is created. Full crash below:

2021-08-04 07:19:04.239 Python[40251:323363] *** Assertion failure in 
-[NSOpenPanel beginServicePanel:asyncExHandler:], NSVBOpenAndSavePanels.m:1910
2021-08-04 07:19:04.241 Python[40251:323363] -[NSSavePanel 
beginWithCompletionHandler:]_block_invoke caught non-fatal 
NSInternalInconsistencyException ' is attempting to 
advance this Open/Save panel to run phase while another 
self.advanceToRunPhaseCompletionHandler is in waiting for a previous attempt. 
An Open/Save panel cannot start to advance more than once.' with user 
dictionary {
NSAssertFile = "NSVBOpenAndSavePanels.m";
NSAssertLine = 1910;
} and backtrace (
0   CoreFoundation  0x0001a9d47150 
__exceptionPreprocess + 240
1   libobjc.A.dylib 0x0001a9a986e8 
objc_exception_throw + 60
2   Foundation  0x0001aac3b4a4 
-[NSCalendarDate initWithCoder:] + 0
3   AppKit  0x0001ad1f02b0 
-[NSSavePanel beginServicePanel:asyncExHandler:] + 512
4   AppKit  0x0001ad1f1708 
-[NSSavePanel runModal] + 332
5   libtk8.6.dylib  0x0001013d8c18 
showOpenSavePanel + 360
6   libtk8.6.dylib  0x0001013d99e4 
Tk_ChooseDirectoryObjCmd + 992
7   libtcl8.6.dylib 0x0001011cbafc 
TclNRRunCallbacks + 80
8   _tkinter.cpython-39-darwin.so   0x000100c111a4 Tkapp_Call + 
400
9   Python  0x000100d66a40 
cfunction_call + 96
10  Python  0x000100d184e0 
_PyObject_Call + 128
11  Python  0x000100e10150 
_PyEval_EvalFrameDefault + 40288
12  Python  0x000100e053f0 
_PyEval_EvalCode + 444
13  Python  0x000100d1877c 
_PyFunction_Vectorcall + 364
14  Python  0x000100e12590 
call_function + 128
15  Python  0x000100e0ff08 
_PyEval_EvalFrameDefault + 39704
16  Python  0x000100e053f0 
_PyEval_EvalCode + 444
17  Python  0x000100d1877c 
_PyFunction_Vectorcall + 364
18  Python  0x000100e12590 
call_function + 128
19  Python  0x000100e0ff84 
_PyEval_EvalFrameDefault + 39828
20  Python  0x000100e053f0 
_PyEval_EvalCode + 444
21  Python  0x000100e5cce4 
run_eval_code_obj + 136
22  Python  0x000100e5cbf8 run_mod + 112
23  Python  0x000100e5a434 pyrun_file + 
168
24  Python  0x000100e59d58 
pyrun_simple_file + 276
25  Python  0x000100e59c04 
PyRun_SimpleFileExFlags + 80
26  Python  0x000100e79d2c 
pymain_run_file + 320
27  Python  0x000100e7947c Py_RunMain + 
916
28  Python  0x000100e7a6c4 pymain_main 
+ 36
29  Python  0x000100e7a93c Py_BytesMain 
+ 40
30  dyld0x0001007990fc start + 520
)
.

--
components: Tkinter
files: tkinter_crash.py
messages: 398889
nosy: Nythepegasus
priority: normal
severity: normal
status: open
title: Using tkinter.filedialog crashes on macOS Python 3.9.6
type: crash
versions: Python 3.9
Added file: https://bugs.python.org/file50200/tkinter_crash.py

___
Python tracker 

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



[issue39940] Micro-optimizations to PySequence_Tuple()

2021-08-04 Thread Irit Katriel


Irit Katriel  added the comment:

Marco, are you planning to complete this work, and in particular show the 
benefit with benchmarks?

Otherwise, if this project is abandoned I will close the issue and the PR.

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



[issue44819] assertSequenceEqual does not use _getAssertEqualityFunc

2021-08-04 Thread Irit Katriel


Irit Katriel  added the comment:

That's correct, and apparently not mentioned in the doc: 
https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertSequenceEqual

--
nosy: +ezio.melotti, iritkatriel, michael.foord, rbcollins

___
Python tracker 

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



[issue44827] Incomplete 3.10.0rc1 release info

2021-08-04 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I can see the files section table with links.

--
nosy: +pablogsal, xtreak

___
Python tracker 

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



[issue44827] Incomplete 3.10.0rc1 release info

2021-08-04 Thread PEW's Corner


PEW's Corner  added the comment:

Yes, they're there now.

--

___
Python tracker 

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



[issue42524] [doc] pdb access to return value

2021-08-04 Thread Romuald Brunet


Romuald Brunet  added the comment:

I'm not sure I follow.

You wish to "simply" update the doc? (and not update the retval to allow 
storing it into a varible. I'm OK with that)


But if we choose this, I'm not sure what needs changing in the doctests :-?


Another interrogation: is the use locals() really necessary? I can see that I 
can simply use `__return__` to access the return object.
Is there a reason to access it via locals() inside pdb?

--

___
Python tracker 

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



[issue44050] [subinterpreters] _PyImport_FixupExtensionObject() regression in Python 3.9

2021-08-04 Thread Trygve Aaberge


Trygve Aaberge  added the comment:

@jack__d: If you're just getting "no data" once and nothing else, the test 
isn't working correctly. You should get "no data" twice when it works correctly 
and the issue is fixed, or "unknown error" and some other info if the issue is 
present. I'm not sure why it doesn't work for you though.

I tried it with Python 3.9.6 now, and I'm still seeing the issue, with the same 
output as in my original post (apart from a newline between "no data" and 
"unknown error", and a different line number and id numbers).

--

___
Python tracker 

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



[issue42524] [doc] pdb access to return value

2021-08-04 Thread Irit Katriel


Irit Katriel  added the comment:

Yes, exactly - to update the doc so that the next person who needs it will 
easily find a way to do it (which was not available to you when you created 
this issue).

The test should assert that what the doc says, so that if someone breaks 
documented functionality we will immediately know.

Your point about accessing __return__ directly from the prompt is interesting - 
sure, if that works just document that and make sure the test fails if we make 
a change that breaks it.

--

___
Python tracker 

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



[issue44827] Incomplete 3.10.0rc1 release info

2021-08-04 Thread PEW's Corner


PEW's Corner  added the comment:

It was probably a caching issue, because another device was just now still 
displaying the page without files until I forced a refresh.

--

___
Python tracker 

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



[issue44827] Incomplete 3.10.0rc1 release info

2021-08-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Yeah, there is CDN in front and it has to get invalidated when we update it

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

___
Python tracker 

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



[issue44760] Turtle Documentation - Contents Hyperlink conflict

2021-08-04 Thread Harry


Harry  added the comment:

The conflict comes from the fact that the documentation is written from the 
perspective of the procedure-oriented interface

"All methods of TurtleScreen/Screen also exist as functions, i.e. as part of 
the procedure-oriented interface"

The conflict in the documentation comes from the fact that there is a conflict 
in the code as-well. The way the conflict is resolved in the code is that:

"This TurtleScreen method is available as a global function only under the name 
clearscreen. The global function clear is a different one derived from the 
Turtle method clear."

I propose that we noindex the TurtleScreen.clear() method, and index the 
Turtle.clear() method instead which more accurately reflects the behaviour of 
the turtle module itself. A link to the TurtleScreen.clear() method will still 
be available through its alias TurtleScreen.clearscreen().

--
nosy: +Harry-Lees

___
Python tracker 

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



[issue44829] zoneinfo.ZoneInfo does not check for Windows device names

2021-08-04 Thread apple502j


New submission from apple502j :

Note: this issue was submitted to security@ due to its potential as a DoS 
vector on 2021-05-08, but I have not received a response (excluding the 
automated email). It is over 88 days since the report, so I am now reporting 
this publicly.

Issue: zoneinfo.ZoneInfo does not check for Windows device names on Windows. 
For example, a timezone "NUL" do not raise ZoneInfoNotFoundError; instead, it 
raises ValueError ("Invalid TZif file: magic not found").

If the timezone passed is "CON", then the program would read the content from 
stdin, and parse it as tzdata file.

This can be abused for a DoS attack for programs that call ZoneInfo with 
untrusted timezone; for example, since reading CON is a blocking operation in 
the asyncio world, a web server that calls ZoneInfo with untrusted timezone 
input would stop its job and no future connections will succeed.

Note that this bug only occurs on Windows for obvious reasons.

Repro case:
>>> from zoneinfo import ZoneInfo
>>> ZoneInfo("CON")

This is related to bpo-41530 where timezone __init__.py does not raise 
ZoneInfoNotFoundError.

And finally, this happens with other file-based operations (and they are 
probably intentional); however, zoneinfo is designed to be secure by default, 
for example by disallowing path traversals. The interactions with Windows 
device names are not documented at all in the references. It's a common 
practice to let the users choose their preferred timezone in web applications, 
and such programs are expected to call ZoneInfo constructor with externally 
provided string. Timezone calculation should never cause a web server to stop 
to read stdin.

--
components: Library (Lib)
messages: 398900
nosy: apple502j
priority: normal
severity: normal
status: open
title: zoneinfo.ZoneInfo does not check for Windows device names
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue44611] CPython uses deprecated randomness API

2021-08-04 Thread STINNER Victor


STINNER Victor  added the comment:

Would it be possible to document in os.urandom() documentation that the 
BCryptGenRandom() function is used on Windows with the "system-preferred random 
number generator algorithm"? (I don't think that we should mention the 
BCRYPT_USE_SYSTEM_PREFERRED_RNG constant.)

--
nosy: +vstinner

___
Python tracker 

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



[issue44611] CPython uses deprecated randomness API

2021-08-04 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks for this change, I like the fact that hCryptProv variable could be 
removed!

--

___
Python tracker 

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



[issue44820] subprocess hungs when processing value from mariadb

2021-08-04 Thread Mark Dickinson


Mark Dickinson  added the comment:

Hi @jb. This tracker is for reporting bugs in the core Python language. While 
it's possible that what you're experiencing is due to a bug in core Python, on 
the information given it's likely that the problem is either in your own code, 
or in whatever database driver code you're using. In either case, I'm afraid 
this tracker is not the appropriate place to seek help.

For general debugging help, you could try any of the various dedicated Python 
groups and mailing lists (for example, discuss.python.org), or something like 
Stack Overflow. Be prepared to give details of exactly what you did, what you 
expected to happen, and what actually happened, along with code that will help 
others reproduce your issue.

I'm going to close here - currently, there's nothing useful that the Python 
core team can do with this report. The issue can be re-opened with more 
information after further investigation, if that investigation produces 
reasonable grounds to suspect a core Python bug.

--
nosy: +mark.dickinson
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue44760] Turtle Documentation - Contents Hyperlink conflict

2021-08-04 Thread Harry


Change by Harry :


--
keywords: +patch
pull_requests: +26093
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/27592

___
Python tracker 

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



[issue44818] '\t' (tab) support

2021-08-04 Thread Pooia


Pooia  added the comment:

unexcpeted indent

On Tue, Aug 3, 2021 at 7:59 PM Serhiy Storchaka 
wrote:

>
> Change by Serhiy Storchaka :
>
>
> --
> status: open -> pending
>
> ___
> Python tracker 
> 
> ___
>

--
status: pending -> open

___
Python tracker 

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



[issue31426] [3.5] crash in gen_traverse(): gi_frame.ob_type=NULL, called by subtract_refs() during a GC collection

2021-08-04 Thread STINNER Victor


STINNER Victor  added the comment:

This bug report mentions Python 3.5 and 3.6 which no longer accept bugfixes. 
Since nobody reported issues on Python 3.9 and newer (which still accept 
bugfixes), I close the issue as out of date.

Victor Zhestkov:
> It seems I have the same segfault, but with 3.6.13 python shipped with 
> SLE15SP2. It's salt-api process under intensive usage. I'm able to reproduce 
> it, but can't isolate due to the service complexity. In some cases it takes 
> about 5 minutes to be crashed, but in others it could run with no crash for 
> about an hour or more (I keep the workload on this service with a kind of 
> stress test).

See my notes to debug crashes happening during GC collections:
https://pythondev.readthedocs.io/debug_tools.html#debug-crash-in-garbage-collection-visit-decref

You can try to use a way smaller GC threshold: call gc.set_threshold(5) at the 
very beginning of your application.

I strongly advice you to use a debug mode of Python, since it includes way more 
debug modes.

I also strongly advice you to upgrade Python. I added many debug checks for 
object consistency in the GC in recent Python releases (3.8, 3.9, 3.10) and 
when a bug arises, Python dumps way more information about the faulty Python 
object.

Good luck for debug it. But please don't comment this closed issue. Python 3.6 
is no longer supported.

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



[issue41117] [easy C] GC: Use local variable 'op' when invoking 'traverse' in 'subtract_refs'

2021-08-04 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner
nosy_count: 1.0 -> 2.0
pull_requests: +26094
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27593

___
Python tracker 

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



[issue41117] [easy C] GC: Use local variable 'op' when invoking 'traverse' in 'subtract_refs'

2021-08-04 Thread STINNER Victor


STINNER Victor  added the comment:

I created PR 27593.

--

___
Python tracker 

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



[issue44683] Can't subscript objects with the string "1" using str.format()

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



[issue44661] Update property_descr_set to use vectorcall if possible.

2021-08-04 Thread STINNER Victor


STINNER Victor  added the comment:

> Mean +- std dev: [property_base] 140 ns +- 5 ns -> [property_vectorcall] 125 
> ns +- 2 ns: 1.12x faster

Ah! That's better. If it was only 1.01x faster, I would say that it's not worth 
it. But 1.12x is worth it. Thanks for this optimization.

--

___
Python tracker 

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



[issue44821] Instance dictionaries should be created eagerly

2021-08-04 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset cee67fa66129b5d1db5c8aa3884338f82f0da3de by Mark Shannon in 
branch 'main':
bpo-44821: Eagerly assign __dict__ for new objects. (GH-27589)
https://github.com/python/cpython/commit/cee67fa66129b5d1db5c8aa3884338f82f0da3de


--

___
Python tracker 

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



[issue44683] Can't subscript objects with the string "1" using str.format()

2021-08-04 Thread Eric V. Smith


Change by Eric V. Smith :


--
components: +Interpreter Core -Unicode

___
Python tracker 

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



[issue41117] [easy C] GC: Use local variable 'op' when invoking 'traverse' in 'subtract_refs'

2021-08-04 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c34fa2bb06ea44045af8493dfa414addb2b7ce66 by Victor Stinner in 
branch 'main':
bpo-41117: Cleanup subtract_refs() (GH-27593)
https://github.com/python/cpython/commit/c34fa2bb06ea44045af8493dfa414addb2b7ce66


--

___
Python tracker 

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



[issue41117] [easy C] GC: Use local variable 'op' when invoking 'traverse' in 'subtract_refs'

2021-08-04 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks William, I made the change that you suggested. Next time, please create 
a PR directly ;-)

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11 -Python 3.10

___
Python tracker 

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



[issue44819] assertSequenceEqual does not use _getAssertEqualityFunc

2021-08-04 Thread Brian


Brian  added the comment:

I've attached an example of what I want. It contains a class, a function to be 
tested, and a test class which tests the function.

What TestCase.addTypeEqualityFunc feels like it offers is a chance to compare 
objects however I feel like is needed for each test. Sometimes all I want is to 
compare the properties of the objects, and maybe not even all of the 
properties! When I have a list of these objects and I've added an equality 
function for the object, I was expecting the test class to use my equality 
function when comparing objects in the list.

--
Added file: https://bugs.python.org/file50201/example.py

___
Python tracker 

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



[issue41946] Add concrete examples to os.path documentation

2021-08-04 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Some examples were added since this issue was created, but more can be added. 
Stargirl: feel free to open a PR, I can review it.

--
nosy: +andrei.avk

___
Python tracker 

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



[issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section

2021-08-04 Thread Mark Dickinson


New submission from Mark Dickinson :

The "Bug Report Writing Guidelines" link in the "Dealing with Bugs" doc section 
(https://docs.python.org/3/bugs.html) looks broken.

The linked URL is 
https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines, but 
that gives me a "Page not found" error. I tried to find equivalent content 
elsewhere on developer.mozilla.org, but either it's not there or my search-fu 
is failing me.

--
assignee: docs@python
components: Documentation
messages: 398913
nosy: docs@python, mark.dickinson
priority: normal
severity: normal
status: open
title: Broken Mozilla devguide link in "Dealing with Bugs" doc section
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section

2021-08-04 Thread Mark Dickinson


Mark Dickinson  added the comment:

A bit more Googling found this:

https://support.mozilla.org/en-US/kb/contributors-guide-writing-good-bug

--

___
Python tracker 

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



[issue39355] The Python library will not compile with a C++2020 compiler because the code uses the reserved “module” keyword

2021-08-04 Thread Hasan


Hasan  added the comment:

If nobody works, i would like to solve this

--
nosy: +AliyevH

___
Python tracker 

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



[issue44829] zoneinfo.ZoneInfo does not check for Windows device names

2021-08-04 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +belopolsky, p-ganssle

___
Python tracker 

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



[issue44829] zoneinfo.ZoneInfo does not check for Windows device names

2021-08-04 Thread Eryk Sun


Eryk Sun  added the comment:

In zoneinfo._tzpath, _validate_tzfile_path() depends on os.path.normpath(). I 
think the Windows implementation of normpath() in the ntpath module should be 
extended to normalize reserved names in the final path component in the same 
manner as WinAPI GetFullPathNameW(). 

Alternatively, an isreserved() function could be added to os.path. This would 
allow _validate_tzfile_path() to raise a more informative exception for a 
reserved name.

Reserved names:

GetFullPathNameW() strips trailing spaces and dots from the final path 
component. This applies to all path types. For example:

>>> nt._getfullpathname('?\\UNC/server/share/spam. . .')
'?\\UNC\\server\\share\\spam'

GetFullPathNameW() reserves DOS device names in the final component of a 
relative path or drive path -- but not in a UNC path or device path. The 
following case-insensitive names are reserved:

* NUL
* CON
* CONIN$
* CONOUT$
* AUX
* PRN
* COM<1-9>
* LPT<1-9>

A reserved device name begins with one of the above base names plus an optional 
suffix. The suffix is zero or more spaces followed optionally by a "." or ":" 
and zero or more characters. The normalized result is a ".\\" device path 
for the base device name. For example: 

>>> nt._getfullpathname('C:/Temp/con . spam')
'.\\con'
>>> nt._getfullpathname('C:/Temp/con : spam')
'.\\con'

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

___
Python tracker 

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



[issue44819] assertSequenceEqual does not use _getAssertEqualityFunc

2021-08-04 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
superseder:  -> addTypeEqualityFunc is not used in assertListEqual

___
Python tracker 

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



[issue44818] '\t' (tab) support

2021-08-04 Thread Eric V. Smith

Eric V. Smith  added the comment:

Please show us an example that demonstrates your problem. Show us the code you 
tried, what you expected to happen, and what actually happened. Otherwise we 
can’t help you.

--
nosy: +eric.smith

___
Python tracker 

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



[issue44829] zoneinfo.ZoneInfo does not check for Windows device names

2021-08-04 Thread Paul Ganssle


Paul Ganssle  added the comment:

Sorry you didn't receive a response to your security@ email, I guess my 
response just went to the PSRT, not to you as well. I believe we determined 
that this was an issue in importlib.resources generally, not specific to 
zoneinfo.

I think `importlib.resources.open_binary` should check if a resource is a file 
with `os.isfile` before opening it. That will solve the issue in zoneinfo and 
other similar situations.

--

___
Python tracker 

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



[issue44760] Turtle Documentation - Contents Hyperlink conflict

2021-08-04 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44760] Turtle Documentation - Contents Hyperlink conflict

2021-08-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26096
pull_request: https://github.com/python/cpython/pull/27595

___
Python tracker 

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



[issue44831] Inconsistency between datetime.now() and datetime.fromtimestamp(time.time(), None)

2021-08-04 Thread Miksus


New submission from Miksus :

I am trying to measure time twice and the second measurement gives a time that 
is 1 microsecond before the first measurement about half of the time.

My experiment in short:
---
import time, datetime
start = time.time()
end = datetime.datetime.now()

start = datetime.datetime.fromtimestamp(start, None)
assert end >= start # fails about half the time.
---


The problem is somewhat interesting. This does not fail:
---
import time, datetime
start = time.time()
end = time.time()

start = datetime.datetime.fromtimestamp(start, None)
end = datetime.datetime.fromtimestamp(end, None)
assert end >= start
---

And neither does this:
---
import datetime
start = datetime.datetime.now()
end = datetime.datetime.now()
assert end >= start
---

And it seems datetime.datetime.now() works the same way as to how I handled the 
"start" time in my first experiment: 
https://github.com/python/cpython/blob/3.6/Lib/datetime.py#L1514
and therefore the issue seems to be under the hood.

I have tested this on two Windows 10 machines (Python 3.6 & 3.8) in which cases 
this occurred. This did not happen on Raspberry Pi OS using Python 3.7.

In short:
- The time module imported in datetime.datetime.now() seems to measure time 
slightly differently than the time module imported by a Python user.
- This seems to be Windows specific.

My actual application has some code in between the measurements suffering from 
the same problem thus this is not an issue affecting only toy examples.

--
components: Library (Lib), Windows
messages: 398919
nosy: Miksus, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Inconsistency between datetime.now() and 
datetime.fromtimestamp(time.time(), None)
versions: Python 3.6, Python 3.8

___
Python tracker 

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



[issue44832] Compiler detection is not strict enough

2021-08-04 Thread Ben Boeckel


New submission from Ben Boeckel :

Generally, the `configure.ac` script tries to detect compilers based on the 
path to the compiler. This is mostly fine, but trips up when using `mpicc` as 
the compiler. Even if the underlying compiler is `gcc`, this gets detected as 
`icc` in various situations.

The best solution is to do some compiler introspection like CMake does to 
determine what the compiler actually is, but I'm not familiar with the patterns 
used or available tools in autotools for such things.

--
components: Build
messages: 398920
nosy: mathstuf
priority: normal
severity: normal
status: open
title: Compiler detection is not strict enough
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue44803] change tracemalloc.BaseFilter to an abstract class

2021-08-04 Thread Łukasz Langa

Łukasz Langa  added the comment:

Many standard libraries, including new ones like asyncio, use `raise 
NotImplementedError` to denote methods that need re-implementation in 
subclasses. Some of those base classes even literally *called* Abstract and yet 
don't inherit from ABC (nor use ABCMeta). Do you intend to change all those as 
well?

While I agree it would be cleaner to have them defined as abstract, at the 
moment I'm not sure it's worth the churn.

--
nosy: +lukasz.langa

___
Python tracker 

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



[issue44831] Inconsistency between datetime.now() and datetime.fromtimestamp(time.time(), None)

2021-08-04 Thread Miksus


Miksus  added the comment:

I accidentially posted Python 3.6 link to the declaration of 
datetime.datetime.now() but this has been unchanged: 
https://github.com/python/cpython/blob/3d2b4c6f18d7e644e5850d2af74ac5dc530eb24c/Lib/datetime.py#L1696

The actual piece of code as of now:
...
import time as _time
...
@classmethod
def now(cls, tz=None):
"Construct a datetime from time.time() and optional time zone info."
t = _time.time()
return cls.fromtimestamp(t, tz)

--

___
Python tracker 

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



[issue44833] VideoCapture is not installing

2021-08-04 Thread ENG19EC0098_Swathi.M


New submission from ENG19EC0098_Swathi.M :

The python version is failing to install the VideoCapture of opencv despite 
many trials. 
Would request you to kindly go through this at the earliest

--
components: Installation
files: Screenshot 2021-08-04 232419.jpg
messages: 398923
nosy: eng19ec0098.swathim
priority: normal
severity: normal
status: open
title: VideoCapture is not installing
type: resource usage
versions: Python 3.9
Added file: https://bugs.python.org/file50202/Screenshot 2021-08-04 232419.jpg

___
Python tracker 

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



[issue44301] Is there a way to provide destructor for module written using C API?

2021-08-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26098
pull_request: https://github.com/python/cpython/pull/27597

___
Python tracker 

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



[issue44301] Is there a way to provide destructor for module written using C API?

2021-08-04 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44834] contextvars.Context.run w/ coroutines gives inconsistent behavior

2021-08-04 Thread Adrian Garcia Badaracco


New submission from Adrian Garcia Badaracco :

I recently tried to use `contextvars.Context.run` w/ coroutines, expecting the 
same behavior as with regular functions, but it seems that 
`contextvars.Context.run` does not work w/ coroutines.

I'm sorry if this is something obvious to do with how coroutines work under the 
hood, if so I'd appreciate some help in understanding why this is the expected 
behavior.

```python
import asyncio
import contextvars


ctxvar = contextvars.ContextVar("ctxvar", default="spam")


def func():
assert ctxvar.get() == "spam"

async def coro():
func()


async def main():
ctx = contextvars.copy_context()
ctxvar.set("ham")
ctx.run(func)  # works
await ctx.run(coro)  # breaks

asyncio.run(main())
```

Thanks!

--
components: Library (Lib)
messages: 398924
nosy: adriangb
priority: normal
severity: normal
status: open
title: contextvars.Context.run w/ coroutines gives inconsistent behavior
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



[issue44829] zoneinfo.ZoneInfo does not check for Windows device names

2021-08-04 Thread Eryk Sun


Change by Eryk Sun :


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

___
Python tracker 

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



[issue42815] new thread doesn't copy context of the parent thread

2021-08-04 Thread Adrian Garcia Badaracco


Change by Adrian Garcia Badaracco :


--
nosy: +adriangb

___
Python tracker 

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



[issue44834] contextvars.Context.run w/ coroutines gives inconsistent behavior

2021-08-04 Thread Adrian Garcia Badaracco


Change by Adrian Garcia Badaracco :


--
nosy: +yselivanov

___
Python tracker 

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



[issue44801] Type expression is coerced to a list of parameter arguments in substitution of ParamSpec

2021-08-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 3875a6954741065b136650db67ac533bc70a3eac by Serhiy Storchaka in 
branch 'main':
bpo-44801: Check arguments in substitution of ParamSpec in Callable (GH-27585)
https://github.com/python/cpython/commit/3875a6954741065b136650db67ac533bc70a3eac


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue44801] Type expression is coerced to a list of parameter arguments in substitution of ParamSpec

2021-08-04 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules

2021-08-04 Thread Irit Katriel


Irit Katriel  added the comment:

> We didn't make it stronger since we can't get rid of any of these attributes 
> until Python 2.7 compatibility is no longer a concern.

Maybe this can be revisited now.

--
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue44760] Turtle Documentation - Contents Hyperlink conflict

2021-08-04 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks, Harry! ✨ 🍰 ✨

--
nosy: +lukasz.langa
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow

2021-08-04 Thread Sebastian Berg


Sebastian Berg  added the comment:

The fix broke NumPy (see also https://github.com/numpy/numpy/pull/19612)

It seems incorrect.  After all, it doesn't matter much whether the float can be 
converted to an integer correctly (or even if it returns an undefined value), 
so long `int_value == float_value` remains sensible.

The old cast cast integers to complex when they were out of range (which is 
fine), the new code raises an error instead.

--
nosy: +seberg

___
Python tracker 

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



[issue44301] Is there a way to provide destructor for module written using C API?

2021-08-04 Thread Łukasz Langa

Change by Łukasz Langa :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.11

___
Python tracker 

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



[issue44301] Is there a way to provide destructor for module written using C API?

2021-08-04 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks for your report, Azat! ✨ 🍰 ✨

--
nosy: +lukasz.langa

___
Python tracker 

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



[issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow

2021-08-04 Thread Sebastian Berg


Sebastian Berg  added the comment:

Hmm, sorry, I overshot/misread :(.

The thing that the NumPy test-suite trips over is that:

c_powi(inf+0j, 3)

seems to not raise, but:

_Py_c_pow(inf+0j, 3.+0j)

(or nan+0.j rather then inf+0j)

does seem to raise (returning `nan+nanj` in both cases).  If this is the `inf` 
code path, raising an error may actually be fix and the integer code path 
should maybe also do it.

--

___
Python tracker 

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



[issue44817] os.path.realpath fails with WinError 161

2021-08-04 Thread Michael Förderer

Michael Förderer  added the comment:

Updated with ERROR_BAD_NETPATH (53).
What about following errors:
- ERROR_LOCK_VIOLATION (33)
- ERROR_DEV_NOT_EXIST (52)
- ERROR_BAD_NET_RESP (58)
- ERROR_UNEXP_NET_ERR (59)
- ERROR_NETNAME_DELETED (64)
- ERROR_NETWORK_ACCESS_DENIED (65)
- ERROR_BAD_DEV_TYPE (66)

--

___
Python tracker 

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



[issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow

2021-08-04 Thread Sebastian Berg


Sebastian Berg  added the comment:

(Sorry for the spam.  I think we can/should just hard-code the expected values 
in the NumPy test-suite.  So this is not actually an issue for NumPy and 
probably just warrants a double-check that the behaviour change is desirable.)

--

___
Python tracker 

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



[issue41354] filecmp.cmp documentation does not match actual code

2021-08-04 Thread Łukasz Langa

Łukasz Langa  added the comment:

Closed in favor of BPO-42958. Thanks for your report, Christof!

--
nosy: +lukasz.langa
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed
superseder:  -> filecmp.cmp(shallow=True) isn't actually shallow when only 
mtime differs

___
Python tracker 

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



[issue44828] Using tkinter.filedialog crashes on macOS Python 3.9.6

2021-08-04 Thread E. Paine


E. Paine  added the comment:

Thanks for reporting issue and for including the backtrace. I presume you used 
the Universal 2 installer, given that you are running an M1 mac? 

Kevin, do you have access to the macOS 12 beta to help test whether this is a 
Tkinter or Tk bug? (I assume the latter, as it is likely Apple have changed the 
API again)

--
components: +macOS
nosy: +epaine, ned.deily, ronaldoussoren, serhiy.storchaka, wordtech

___
Python tracker 

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



[issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow

2021-08-04 Thread Mark Dickinson


Mark Dickinson  added the comment:

Thanks, @seberg. I'll take a look and see if we can restore the old behaviour, 
at least for Python 3.9 and 3.10. I'm not convinced that the new behaviour is 
objectively wrong, but I agree that the *change* in behaviour is problematic.

I do find it a little odd that we're special-casing integer exponents for 
complex numbers when no such special-casing exists for floats. It's not purely 
for optimization (despite what the code might say). And all the messing around 
with trying to figure out exactly _which_ doubles can safely be cast to long 
(which was the original cause of this issue) seems like a symptom of a deeper 
problem, which is that it doesn't make a whole lot of sense to be 
distinguishing in the first place. But if we're going to change the behaviour, 
we should only be doing that in 3.11.

OTOH, there *is* real value in z**2 being fast and accurate; we definitely want 
to keep that. (Perhaps the math and cmath modules should grow a `square` 
function.)

--

___
Python tracker 

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



[issue44564] DeprecationWarning in test_enum over formatting

2021-08-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset f99c015638b46e46ae3ee3f27b96a514007cdaef by Brandon Schabell in 
branch 'main':
bpo-44564 Move formatted assertion under deprecation warning context (GH-27090)
https://github.com/python/cpython/commit/f99c015638b46e46ae3ee3f27b96a514007cdaef


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow

2021-08-04 Thread Mark Dickinson


Mark Dickinson  added the comment:

> a double-check that the behaviour change is desirable

I'm not sure I'm brave or foolhardy enough to try to figure out what all of the 
special case results *should* be for complex pow. The special cases seem 
reasonably clear cut for everything else in the cmath module, but for pow it's 
pretty much going to be a nightmare. I'm not sure there's much Python can do 
here in the way of guarantees, other than "not obviously horribly wrong". (And 
while I have reasonable confidence we can achieve the "not obviously horribly 
wrong" goal for everything else, I still have doubts for pow.)

--

___
Python tracker 

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



[issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules

2021-08-04 Thread Brett Cannon

Brett Cannon  added the comment:

> Maybe this can be revisited now.

I've started the work already (albeit rather slowly 😄). Importlib has been 
updated to prefer __spec__.parent of __package__ and warns when the values are 
not equal. Next step will be to raise an ImportWarning when __package__ is 
defined but __spec__.parent is not (then DeprecationWarning after that).

For __loader__ I got Python 3.10 to fall back on to __spec__.loader. Next step 
is https://bugs.python.org/issue42132 to update C code to set __spec__ where 
appropriate. From there the check for equivalence can go in (which then leads 
to the warnings).

I have not started with __cached__ yet, so next step is making sure all uses 
fall back on __spec__.

So, to be clear, the steps I have been following are:

1. Make sure all code falls back on __spec__ when appropriate (one release)
2. Raise an ImportWarning when values differ (one release)
3. Make __spec__ take precedence over old attribute (one release)
4. Raise an ImportWarning when having to fall back to older attribute (two 
releases)
5. Raise a DeprecationWarning when falling back on older attribute (two 
releases)
6. Clean up code

--

___
Python tracker 

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



[issue44564] DeprecationWarning in test_enum over formatting

2021-08-04 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks, Brandon! ✨ 🍰 ✨

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



  1   2   >