[issue42613] freeze.py doesn't support sys.platlibdir different than lib nor multiarch

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:

I found this issue while working on bpo-42591 which exported the missing 
Py_FrozenMain() symbol.

--

___
Python tracker 

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



[issue42651] Title: Recursive traceback crashes Python Interpreter

2020-12-16 Thread Xinmeng Xia


New submission from Xinmeng Xia :

=
import traceback

def foo():
  traceback.print_exc()
  foo() 

foo()



Try running the above program, the interpreter is crashed with the error 
message like the following:

Fatal Python error: Cannot recover from stack overflow.
NoneType: None
NoneType: None
NoneType: None
NoneType: None

...
NoneType: None

NoneType: None
NoneType: 
NoneType: None
NoneType: None
...
NoneType: None
NoneType: None
NoneType: None
Fatal Python error: _Py_CheckRecursiveCall: Cannot recover from stack overflow.
Python runtime state: initialized

Current thread 0x7fab0bdda700 (most recent call first):
  File "/usr/local/python310/lib/python3.10/traceback.py", line 155 in _some_str
  File "/usr/local/python310/lib/python3.10/traceback.py", line 515 in __init__
  File "/usr/local/python310/lib/python3.10/traceback.py", line 103 in 
print_exception
  File "/usr/local/python310/lib/python3.10/traceback.py", line 163 in print_exc
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 4 in foo
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 5 in foo
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 5 in foo
...
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 5 in foo
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 5 in foo
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 5 in foo
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 5 in foo
  ...
Aborted (core dumped)

--
components: Interpreter Core
messages: 383118
nosy: xxm
priority: normal
severity: normal
status: open
title: Title: Recursive traceback crashes  Python Interpreter
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



[issue42613] freeze.py doesn't support sys.platlibdir different than lib nor multiarch

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:

Tools/freeze/freeze.py is broken for 4 years, since Python 3.6 which added 
sys.implementation._multiarch to the config directory in sysconfig:

commit 5553231b91e05cf93827b33a79aebe62c4370a09
Author: d...@ubuntu.com 
Date:   Tue Jun 14 08:55:19 2016 +0200

- Issue #23968: Rename the platform directory from plat-$(MACHDEP) to
  plat-$(PLATFORM_TRIPLET).
  Rename the config directory (LIBPL) from config-$(LDVERSION) to
  config-$(LDVERSION)-$(PLATFORM_TRIPLET).
  Install the platform specifc _sysconfigdata module into the platform
  directory and rename it to include the ABIFLAGS.

--

___
Python tracker 

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



[issue42591] Method Py_FrozenMain missing in libpython3.9

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:

Christian Bachmaier:
> Thus, when trying the provided freeze example via
> freeze.py hello.py & make

Do you mean freeze.py from Tools/freeze/freeze.py? This tool seems to be broken 
for 4 years, since Python 3.6: bpo-42613.

> 4. freeze.py wants wants this for a very long time:
>ln -s /usr/local/lib/python3.10/config-3.10-x86_64-linux-gnu
>  /usr/local/lib/python3.10/config-3.10

Oh, you fixed manually freeze.py?

--

___
Python tracker 

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



[issue42613] freeze.py doesn't support sys.platlibdir different than lib nor multiarch

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:

There are better maintained alternatives:

* PyOxidizer
* pyInstaller
* bbFreeze
* py2exe
* cx_Freeze
* py2app
* etc.

--

___
Python tracker 

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



[issue42613] freeze.py doesn't support sys.platlibdir different than lib nor multiarch

2020-12-16 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue42519] [C API] Upgrade the C API in extension modules

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



[issue42591] Method Py_FrozenMain missing in libpython3.9

2020-12-16 Thread Christian Bachmaier


Christian Bachmaier  added the comment:

> Do you mean freeze.py from Tools/freeze/freeze.py?

Yes, unfortunately I have to keep a large old system running and there are only 
few options left. It is a University learning system, where students upload 
program code and then a huge amount of automtic quality checks are executed 
within a sandbox. The grading is done in a half automtic way. A real 
alternative is not existing, we tried hard to find one...

> This tool seems to 
> be broken for 4 years, since Python 3.6: bpo-42613.
> 4. freeze.py wants wants this for a very long time:
>ln -s /usr/local/lib/python3.10/config-3.10-x86_64-linux-gnu
>  /usr/local/lib/python3.10/config-3.10

The symlink does the trick. So it may be easy for you to fix that, so it does 
operate out of the box again.

--

___
Python tracker 

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



[issue42443] Provide Thread creation hook support

2020-12-16 Thread Piotr Stanczyk


Piotr Stanczyk  added the comment:

Friendly ping - does the proposal sound fine?

--

___
Python tracker 

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



[issue42652] recursive in finally clause cause Python interpreter crash.

2020-12-16 Thread Xinmeng Xia


New submission from Xinmeng Xia :

Considering the following two program,running the program 1 will get expected 
output: RecursionError 

program 1
===
import traceback

def foo():
try:
1/0
except Exception as e:
traceback.print_exc()
finally:
a = 1
foo()   

foo()

==
---
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 5, in foo
1/0
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 5, in foo
1/0
ZeroDivisionError: division by zero

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 5, in foo
1/0
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 5, in foo
1/0
ZeroDivisionError: division by zero

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 12, in 

  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 10, in foo
foo()   
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 10, in foo
...
foo()   
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 10, in foo
foo()   
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 7, in foo
traceback.print_exc()
  File "/usr/lib/python3.5/traceback.py", line 159, in print_exc
print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain)
  File "/usr/lib/python3.5/traceback.py", line 100, in print_exception
type(value), value, tb, limit=limit).format(chain=chain):
  File "/usr/lib/python3.5/traceback.py", line 474, in __init__
capture_locals=capture_locals)
  File "/usr/lib/python3.5/traceback.py", line 358, in extract
f.line
  File "/usr/lib/python3.5/traceback.py", line 282, in line
self._line = linecache.getline(self.filename, self.lineno).strip()
  File "/usr/lib/python3.5/linecache.py", line 16, in getline
lines = getlines(filename, module_globals)
  File "/usr/lib/python3.5/linecache.py", line 43, in getlines
if len(entry) != 1:
RecursionError: maximum recursion depth exceeded in comparison


However when moving foo() into finally clause, the interpreter crashes.

program 2
==
import traceback

def foo():
try:
1/0
except Exception as e:
traceback.print_exc()
finally:
a = 1
foo()   

foo()

==  
-
File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 10 in foo
Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 5, in foo
1/0
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 5, in foo
1/0
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 5, in foo
1/0
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 5, in foo
1/0
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 5, in foo
1/0
ZeroDivisionError: division by zero

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/myerror/test1.py", line 7, in foo
traceback.print_exc()
  File "/usr/lib/python3.5/traceback.py", line 159, in print_exc
print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain)
  File "/usr/lib/python3.5/traceback.py", line 100, in print_exception
type(value), value, tb, limit=limit).format(chain=chain):
  File "/usr/lib/python3.5/traceback.py", line 474, in __init__
capture_locals=capture_locals)
  File "/usr/lib/python3.5/traceback.py", line 358, in extract
f.line
  File "/usr/lib/python3.5/traceback.py", line 282, in line
self._line = linecache.getline(self.filename, self.lineno).strip()
  File "/usr/lib/python3.5/linecache.py", line 16, in getline
lines = getlines(filename, module_globals)
  File "/usr/lib/python3.5/linecache.py", line 43, in getlines
if len(entry) != 1:
RecursionError: maximum recursion depth exceeded in comparison

During handling

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-12-16 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22649
pull_request: https://github.com/python/cpython/pull/23793

___
Python tracker 

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



[issue10141] SocketCan support

2020-12-16 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +22650
pull_request: https://github.com/python/cpython/pull/23794

___
Python tracker 

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



[issue42644] logging.disable('WARN') breaks AsyncIO

2020-12-16 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
components: +Library (Lib) -asyncio

___
Python tracker 

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



[issue42644] logging.disable('WARN') breaks AsyncIO

2020-12-16 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
type: crash -> behavior

___
Python tracker 

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



[issue41804] test_epoll fails test_control_and_wait() randomly on aarch64 RHEL8 Refleaks 3.9

2020-12-16 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue42653] Expose ISO-TP Contants for Linux >= 5.10

2020-12-16 Thread Stefan Tatschner


New submission from Stefan Tatschner :

Linux >= 5.10 gained a new SocketCAN module called ISOTP. This is an 
implementation of ISO 15765-2 which is mainly used in vehicle CAN networks. 
Expose the constants from linux/can/isotp.h in the socket module.

These constants are not entirely new. Previously there was an out of tree 
kernel module available and a subset of these constants are already available 
in CPyton.

[1]: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/can/isotp.h
[2]: https://github.com/hartkopp/can-isotp

--
components: Library (Lib)
messages: 383126
nosy: rumpelsepp
priority: normal
pull_requests: 22652
severity: normal
status: open
title: Expose ISO-TP Contants for Linux >= 5.10
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue40949] test_socket altered the execution environment: threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 5)

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:

I didn't see the failure recently, I close the issue.

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



[issue41473] test_gdb fails on AMD64 Fedora Rawhide 3.x [gdb 9.2 bug]

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:

test_gdb pass again on AMD64 Fedora Rawhide 3.x with "GNU gdb (GDB) Fedora 
10.1-2.fc34":

https://buildbot.python.org/all/#/builders/285/builds/348
0:02:52 load avg: 11.34 [242/426] test_gdb passed (1 min 28 sec) (...)

I close the issue.

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



[issue42654] Add folder for python customizations: __sitecustomize__

2020-12-16 Thread Mario Corchero


New submission from Mario Corchero :

Following the conversations in https://bugs.python.org/issue33944, wanted to 
discuss the support for a __sitecustomize__ folder that will hold python 
scripts to be executed at startup. Similar to `sitecustomize.py` but allowing 
different stakeholders of a Python installation to add themselves.

This is basically a "supported way" of the current abuse of pth files to add 
startup code.

How will this be useful?
- Support administrators to add multiple "sitecustomize.py" files. As an 
example, today we are basically appending to sitecustomize when we need some 
additional behaviour.
- Support for library owners that need some startup customization like 
betterexceptions.
- Tools that include an interpreter like virtualenv or things like PyOxidizer 
by allowing them to customize the interpreter they expose to users.

It basically offers a better alternative to the currently abused feature of 
code execution in pth.

I this is something that is wanted in CPython, from the thread in 
https://bugs.python.org/issue33944 I see some open questions though:

- Look for `__sitecustomize__` only in site paths or in PYTHONPATH?
I'm honestly fine either way, but sightly incline more to @jaraco proposal to 
make this basically be a namespace package walking all its instances.

- Should we have a custom way to disable this? Or are we happy with just  `-S`. 
I think the `-S` is fine, it offers a similar behaviour to sitecustomize.

If you want to see "how it feels", see 
https://github.com/mariocj89/cpython/tree/pu/__sitecustomize__ (It's not 
finished).

If it seems interesting I would love to put a PR through. With this, we might 
be able to eventually remove code execution in pth files!

--
components: Library (Lib)
messages: 383129
nosy: jaraco, mariocj89, ncoghlan
priority: normal
severity: normal
status: open
title: Add folder for python customizations: __sitecustomize__
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



[issue42654] Add folder for python customizations: __sitecustomize__

2020-12-16 Thread Mario Corchero


Change by Mario Corchero :


--
type:  -> enhancement

___
Python tracker 

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



[issue42644] logging.disable('WARN') breaks AsyncIO

2020-12-16 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +22653
pull_request: https://github.com/python/cpython/pull/23796

___
Python tracker 

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



[issue42654] Add folder for python customizations: __sitecustomize__

2020-12-16 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



[issue42644] logging.disable('WARN') breaks AsyncIO

2020-12-16 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22654
pull_request: https://github.com/python/cpython/pull/23797

___
Python tracker 

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



[issue42644] logging.disable('WARN') breaks AsyncIO

2020-12-16 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset b32d8b4f9bcd2e7d11240b6b9de0262cf8f5e09d by Matthias Bussonnier 
in branch 'master':
bpo-42644: Validate values in logging.disable() (#23786)
https://github.com/python/cpython/commit/b32d8b4f9bcd2e7d11240b6b9de0262cf8f5e09d


--

___
Python tracker 

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



[issue33129] Add kwarg-only option to dataclass

2020-12-16 Thread conchylicultor


conchylicultor  added the comment:

For the API, I think we could add this feature with a single new 
`dataclass(kw_only: bool | str)`

```
@dataclasses.dataclass(kw_only=True)
class A:
  a: int
  b: int
  c: int

# A(*, a, b, c)


@dataclasses.dataclass(kw_only='b')
class A:
  a: int
  b: int
  c: int

# A(a, *, b, c)
```

I think this would be flexible enough for all use cases, while avoiding the 
boilerplate from the above proposals.

--

___
Python tracker 

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



[issue42655] Fix subprocess extra_groups gid conversion

2020-12-16 Thread Jakub Kulik


New submission from Jakub Kulik :

C function `subprocess_fork_exec` incorrectly transforms gids from the 
`extra_groups` argument because it passes `unsigned long*` rather than `pid_t*` 
into the `_Py_Gid_Converter()`. Assuming that `gid_t` is 32 bit and `unsigned 
long` is 64 bit (which it often is), `*(gid_t *)p = gid;` then incorrectly 
overwrites only part of that variable, leaving the other one filled with 
previous garbage.

I found this on Solaris, but I am pretty sure that this doesn't work correctly 
on Linux as well, since both use `unsigned int` as `gid_t`.

--
components: Extension Modules
messages: 383132
nosy: kulikjak
priority: normal
severity: normal
status: open
title: Fix subprocess extra_groups gid conversion
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



[issue42655] Fix subprocess extra_groups gid conversion

2020-12-16 Thread Jakub Kulik


Change by Jakub Kulik :


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

___
Python tracker 

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



[issue42644] logging.disable('WARN') breaks AsyncIO

2020-12-16 Thread miss-islington


miss-islington  added the comment:


New changeset 0a24a57888798905e3b8891c59e61ed4f1bfc5a8 by Miss Islington (bot) 
in branch '3.8':
bpo-42644: Validate values in logging.disable() (GH-23786)
https://github.com/python/cpython/commit/0a24a57888798905e3b8891c59e61ed4f1bfc5a8


--

___
Python tracker 

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



[issue42644] logging.disable('WARN') breaks AsyncIO

2020-12-16 Thread miss-islington


miss-islington  added the comment:


New changeset db63da7e5d4a98925a04f903a19bf3595b9c2c46 by Miss Islington (bot) 
in branch '3.9':
bpo-42644: Validate values in logging.disable() (GH-23786)
https://github.com/python/cpython/commit/db63da7e5d4a98925a04f903a19bf3595b9c2c46


--

___
Python tracker 

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



[issue40364] asyncio: replace _compute_returncode() with os.waitstatus_to_exitcode()

2020-12-16 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue41804] test_epoll fails test_control_and_wait() randomly on aarch64 RHEL8 Refleaks 3.9

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 79782fe4f8cf73d7fdf8db02073bbadf7ff817b6 by Victor Stinner in 
branch 'master':
bpo-41804: Enhance test_epoll.test_control_and_wait() (GH-23795)
https://github.com/python/cpython/commit/79782fe4f8cf73d7fdf8db02073bbadf7ff817b6


--

___
Python tracker 

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



[issue42656] prime numbers loop issue

2020-12-16 Thread Валерій Марцишин

New submission from Валерій Марцишин :

I have written a program which must show prime numbers. At the beginning it 
does, but from some moment it doesn't work properly, despite the fact that it 
is a loop. I suspect there is a bug somewhere, if not, I'll be thankful if you 
tell me the issue.





valera0...@gmail.com

--
components: Windows
files: main.py
messages: 383135
nosy: paul.moore, steve.dower, tim.golden, valeriymartsyshyn, zach.ware
priority: normal
severity: normal
status: open
title: prime numbers loop issue
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file49685/main.py

___
Python tracker 

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



[issue41804] test_epoll fails test_control_and_wait() randomly on aarch64 RHEL8 Refleaks 3.9

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:

I failed to reproduce the issue. Let's hope that replacing send() with 
sendall() is enough to fix the issue.

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



[issue42654] Add folder for python customizations: __sitecustomize__

2020-12-16 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Shouldn't this be discussed on Python-Ideas? I'm pretty sure this is a big 
enough change that it will need a PEP.

If you need code run on startup, can't you just put it in the PYTHONSTARTUP 
file?

--
nosy: +steven.daprano

___
Python tracker 

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



[issue42654] Add folder for python customizations: __sitecustomize__

2020-12-16 Thread Mario Corchero


Mario Corchero  added the comment:

> Shouldn't this be discussed on Python-Ideas? I'm pretty sure this is a big 
> enough change that it will need a PEP.

Indeed, I wanted to see if there was interest in the feature. That is probably 
a better place to start.

> If you need code run on startup, can't you just put it in the PYTHONSTARTUP 
> file?

My understanding is that PYTHONSTARTUP is only for interactive executions. 
Additionally, it suffers from the same issue as sitecustomize. It is a single 
file that won't be a real substitute for code execution in pth files.

--

___
Python tracker 

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



[issue42656] prime numbers loop issue

2020-12-16 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Hello valeriymartsyshyn,

This is for reporting bugs in the Python interpreter, it is not a help desk for 
learning how to program in Python. There are many places you can ask for help 
to debug your code, such as Reddit's r/learnpython, or Stackoverflow, or the 
tutor mailing list:

https://mail.python.org/mailman/listinfo/tutor

There are various Python IRC channels or Discuss, if you google you will soon 
find them.

In this case, your bug occurs because you are deleting items from the list as 
you are iterating over it. Don't do that.

--
nosy: +steven.daprano
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



[issue42654] Add folder for python customizations: __sitecustomize__

2020-12-16 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> Additionally, it suffers from the same issue as 
> sitecustomize. It is a single file that won't be a real substitute for 
> code execution in pth files.

I thought that the consensus in b.p.o. #33944 is that code execution in 
pth files is an anti-feature that must be removed, not something to 
merely move into a new file type or location.

(I may be wrong, I'll admit I haven't read the entire thread in 33944.)

--

___
Python tracker 

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



[issue19733] Setting image parameter of a button crashes with Cocoa Tk

2020-12-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 5f0fe8ec70120f4586d08978b0911b436f82c421 by Serhiy Storchaka in 
branch 'master':
bpo-19733: Re-enable tests for -image option in Tkinter (GH-23785)
https://github.com/python/cpython/commit/5f0fe8ec70120f4586d08978b0911b436f82c421


--

___
Python tracker 

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



[issue19733] Setting image parameter of a button crashes with Cocoa Tk

2020-12-16 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +22657
pull_request: https://github.com/python/cpython/pull/23799

___
Python tracker 

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



[issue42641] Deprecate os.popen() function

2020-12-16 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> There is also the os.system() function which exposes the libc system() 
> function. Should we deprecate this one as well?

Please don't deprecate os.system. For quick and dirty scripts used in trusted 
environments with trusted data, it is simple to use, effective and safe enough.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue42657] Python 3.9.1 building process could not use local standard library

2020-12-16 Thread xz_sophos


New submission from xz_sophos :

When trying to build python 3.9.1 on Mac OSX 10.15, one of the building step by 
make is to run this command: 

DYLD_FRAMEWORK_PATH=/Users/jenkins/BaseFolder/savmac-python ./python.exe -E -S 
-m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi

It would produce this error message: 

Could not find platform independent libraries 
Could not find platform dependent libraries 
Consider setting $PYTHONHOME to [:]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = '/Library/Frameworks/Python.framework/Versions/3.7/bin/python3'
  isolated = 0
  environment = 0
  user site = 1
  import site = 0
  sys._base_executable = 
'/Library/Frameworks/Python.framework/Versions/3.7/bin/python3'
  sys.base_prefix = 
'/Users/jenkins/BaseFolder/savmac-python/sophos/tmp/Python.framework/Versions/3.9'
  sys.base_exec_prefix = 
'/Users/jenkins/BaseFolder/savmac-python/sophos/tmp/Python.framework/Versions/3.9'
  sys.platlibdir = 'lib'
  sys.executable = 
'/Library/Frameworks/Python.framework/Versions/3.7/bin/python3'
  sys.prefix = 
'/Users/jenkins/BaseFolder/savmac-python/sophos/tmp/Python.framework/Versions/3.9'
  sys.exec_prefix = 
'/Users/jenkins/BaseFolder/savmac-python/sophos/tmp/Python.framework/Versions/3.9'
  sys.path = [

'/Users/jenkins/BaseFolder/savmac-python/sophos/tmp/Python.framework/Versions/3.9/lib/python39.zip',

'/Users/jenkins/BaseFolder/savmac-python/sophos/tmp/Python.framework/Versions/3.9/lib/python3.9',

'/Users/jenkins/BaseFolder/savmac-python/sophos/tmp/Python.framework/Versions/3.9/lib/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the 
filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00011668ddc0 (most recent call first):

15:08:54 stdout: generate-posix-vars failed
make: *** [pybuilddir.txt] Error 1


Please note that current working directory is : 
/Users/jenkins/BaseFolder/savmac-python

In the Mac, there is already a python 3.7 installed at: 
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3

I wonder what's the root cause of the above ./python.exe error, as I don't have 
this error on a different MacOS 10.15 with an existing installation of "python 
launcher.app" (version 3.9.1)

--
components: macOS
messages: 383144
nosy: ned.deily, ronaldoussoren, xz_sophos
priority: normal
severity: normal
status: open
title: Python 3.9.1 building process could not use local standard library
type: compile error
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



[issue42644] logging.disable('WARN') breaks AsyncIO

2020-12-16 Thread Andrew Svetlov


Change by Andrew Svetlov :


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

___
Python tracker 

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



[issue19733] Setting image parameter of a button crashes with Cocoa Tk

2020-12-16 Thread miss-islington


miss-islington  added the comment:


New changeset cd7412e3c4a2805009d0baa948cd4026d6fa6f3d by Miss Islington (bot) 
in branch '3.9':
bpo-19733: Re-enable tests for -image option in Tkinter (GH-23785)
https://github.com/python/cpython/commit/cd7412e3c4a2805009d0baa948cd4026d6fa6f3d


--

___
Python tracker 

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



[issue19733] Setting image parameter of a button crashes with Cocoa Tk

2020-12-16 Thread 雅雯

雅雯  added the comment:

周zhtw1234

--
hgrepos: +395
nosy: +zhtw1234
Added file: https://bugs.python.org/file49686/IMAG0215(5).jpg

___
Python tracker 

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



[issue19733] Setting image parameter of a button crashes with Cocoa Tk

2020-12-16 Thread 雅雯

雅雯  added the comment:

幹你娘

--

___
Python tracker 

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



[issue19733] Setting image parameter of a button crashes with Cocoa Tk

2020-12-16 Thread Ned Deily


Change by Ned Deily :


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

___
Python tracker 

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



[issue19733] Setting image parameter of a button crashes with Cocoa Tk

2020-12-16 Thread Ned Deily


Change by Ned Deily :


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

___
Python tracker 

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



[issue19733] Setting image parameter of a button crashes with Cocoa Tk

2020-12-16 Thread 雅雯

雅雯  added the comment:

你娘老雞歪

--

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

2020-12-16 Thread Julien Palard


Julien Palard  added the comment:

Today I spotted one error that suspicious could have spotted:

-both ``Callable``s no longer validate their ``argtypes``, in 
+both ``Callable``\ s no longer validate their ``argtypes``, in 

I'm fixing it in https://github.com/python/cpython/pull/23800 

`make suspicious` found it as:

[whatsnew/changelog:23] "`" found in "Callable``s no longer validate their 
``argtypes"

So I'll doodle around this to see if tools/rstlint.py or Sphinx itself can see 
the error.

--

___
Python tracker 

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



[issue19733] Setting image parameter of a button crashes with Cocoa Tk

2020-12-16 Thread Ned Deily


Change by Ned Deily :


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

___
Python tracker 

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



[issue19733] Setting image parameter of a button crashes with Cocoa Tk

2020-12-16 Thread Ned Deily


Change by Ned Deily :


Removed file: https://bugs.python.org/file49686/IMAG0215(5).jpg

___
Python tracker 

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



[issue19733] Setting image parameter of a button crashes with Cocoa Tk

2020-12-16 Thread Ned Deily


Change by Ned Deily :


--
hgrepos:  -395

___
Python tracker 

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



[issue40364] asyncio: replace _compute_returncode() with os.waitstatus_to_exitcode()

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 99d28c56708bff1f442e1df5748adb2620542c61 by Victor Stinner in 
branch 'master':
bpo-40364: asyncio uses os.waitstatus_to_exitcode() (GH-23798)
https://github.com/python/cpython/commit/99d28c56708bff1f442e1df5748adb2620542c61


--

___
Python tracker 

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



[issue40364] asyncio: replace _compute_returncode() with os.waitstatus_to_exitcode()

2020-12-16 Thread STINNER Victor


Change by STINNER Victor :


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



[issue42613] freeze.py doesn't support sys.platlibdir different than lib nor multiarch

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1c653f17cb84d81df3a74ab0b42140d2bb68c5c4 by Victor Stinner in 
branch 'master':
bpo-42613: Fix freeze.py config directory (GH-23792)
https://github.com/python/cpython/commit/1c653f17cb84d81df3a74ab0b42140d2bb68c5c4


--

___
Python tracker 

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



[issue42613] freeze.py doesn't support sys.platlibdir different than lib nor multiarch

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



[issue42115] Caching infrastructure for the evaluation loop: specialised opcodes

2020-12-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Oh, I am quite confused about what's going on with pidigits and regex_v8. I 
will try to run the benchmarks again. Did you compare the current master 
against the PR? If that's the case we should rebase the PR it first to make 
sure we are comparing it correctly.

--

___
Python tracker 

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



[issue42613] freeze.py doesn't support sys.platlibdir different than lib nor multiarch

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:

I tested my fix with these commands:
---
./configure --with-platlibdir=lib64 --enable-shared --prefix /opt/py310 
CFLAGS="-O0"
make
make install
# move outside CPython source tree
cd

mkdir hello
cd hello
echo 'print("hello")' > hello.py

cp -R  ~/python/master/Tools/freeze/ .
LD_LIBRARY_PATH=/opt/py310/lib /opt/py310/bin/python3.10 freeze/freeze.py 
hello.py
---

Output:
---
$ LD_LIBRARY_PATH=/opt/py310/lib ./hello 
hello
---

--

___
Python tracker 

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



[issue42591] Method Py_FrozenMain missing in libpython3.9

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:

Christian Bachmaier:
> The symlink does the trick. So it may be easy for you to fix that, so it does 
> operate out of the box again.

I pushed a fix in bpo-42613. It would be great if you could test it.

See my manual test: https://bugs.python.org/issue42613#msg383153

If you can test it, I can backport the fix to stable branches.

--

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8203c73f3bb1f51614279b6e23af2ec587d1fa22 by Victor Stinner in 
branch 'master':
bpo-1635741: Refactor _threadmodule.c (GH-23793)
https://github.com/python/cpython/commit/8203c73f3bb1f51614279b6e23af2ec587d1fa22


--

___
Python tracker 

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



[issue42591] Method Py_FrozenMain missing in libpython3.9

2020-12-16 Thread Christian Bachmaier


Christian Bachmaier  added the comment:

Vistor Stinner:
> If you can test it, I can backport the fix to stable branches.

Seems to work like a charm. Basically I used the same testing setup as 
previously on Dec 10th under Debian testing/bullseye without step 2, as master 
already contains your fix.

Victor, many thanks again, you are great!

--

___
Python tracker 

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



[issue40821] os.getlogin() not working

2020-12-16 Thread Philipp Gortan


Change by Philipp Gortan :


--
nosy: +mephinet

___
Python tracker 

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



[issue42615] Redundant jump instructions due to deleted unreachable bytecode blocks

2020-12-16 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset c71581c7a4192e6ba9a79eccc583aaadab300efa by Om G in branch 
'master':
bpo-42615: Delete redundant jump instructions that only bypass empty blocks 
(GH-23733)
https://github.com/python/cpython/commit/c71581c7a4192e6ba9a79eccc583aaadab300efa


--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue42529] CPython DLL initialization routine failed from PYC cache file

2020-12-16 Thread Steve Dower


Steve Dower  added the comment:

Sorry, I haven't had a chance to set up a test machine with all the 
requirements.

It's almost certainly something in jpype, to be clear. Most likely it loads a 
DLL that hasn't been loaded yet, but does it under conditions where it won't 
load. Nothing we build as part of CPython should do anything interesting on 
load, at least nothing we can change/fix. So jpype will probably need an update 
to import something manually.

The only thing I can think of that changed along these lines in 3.9.0 is that 
we no longer LoadLibrary("api-ms-win-core-path-l1-1-0.dll") at startup (because 
we can assume that it's present now). That shouldn't matter at all unless jpype 
is doing some really weird stuff, as it's a system library with no code. But 
maybe it'll give someone a hint who knows the module better?

--

___
Python tracker 

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



[issue42246] Implement PEP 626 -- Precise line numbers for debugging

2020-12-16 Thread Mark Shannon


Mark Shannon  added the comment:

https://github.com/python/cpython/pull/23780 fixes the finally handling.
The if-break case was fixed by earlier changes.

--

___
Python tracker 

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



[issue42115] Caching infrastructure for the evaluation loop: specialised opcodes

2020-12-16 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

OK, I have repeated the benchmarks after rebasing and this is what I get:

venv ❯ python -m pyperf compare_to 
json/2020-12-16_11-20-master-8203c73f3bb1.json.gz 
json/2020-12-16_11-22-load_method-21b1566125b3.json.gz -G --min-speed=1
Slower (13):
- regex_v8: 30.5 ms +- 0.1 ms -> 32.8 ms +- 0.2 ms: 1.08x slower (+8%)
- pidigits: 253 ms +- 0 ms -> 264 ms +- 0 ms: 1.05x slower (+5%)
- richards: 84.1 ms +- 1.1 ms -> 87.4 ms +- 1.4 ms: 1.04x slower (+4%)
- fannkuch: 573 ms +- 2 ms -> 589 ms +- 14 ms: 1.03x slower (+3%)
- regex_effbot: 3.87 ms +- 0.03 ms -> 3.98 ms +- 0.05 ms: 1.03x slower (+3%)
- scimark_sor: 223 ms +- 4 ms -> 227 ms +- 2 ms: 1.02x slower (+2%)
- pathlib: 20.9 ms +- 0.2 ms -> 21.3 ms +- 0.3 ms: 1.02x slower (+2%)
- regex_compile: 209 ms +- 1 ms -> 212 ms +- 3 ms: 1.01x slower (+1%)
- xml_etree_process: 93.7 ms +- 0.7 ms -> 94.9 ms +- 1.1 ms: 1.01x slower (+1%)
- nqueens: 122 ms +- 1 ms -> 123 ms +- 1 ms: 1.01x slower (+1%)
- regex_dna: 263 ms +- 1 ms -> 266 ms +- 1 ms: 1.01x slower (+1%)
- django_template: 56.1 ms +- 0.4 ms -> 56.7 ms +- 0.4 ms: 1.01x slower (+1%)
- raytrace: 566 ms +- 7 ms -> 572 ms +- 6 ms: 1.01x slower (+1%)

Faster (15):
- unpack_sequence: 80.4 ns +- 0.9 ns -> 70.8 ns +- 0.8 ns: 1.14x faster (-12%)
- scimark_sparse_mat_mult: 6.26 ms +- 0.02 ms -> 5.97 ms +- 0.06 ms: 1.05x 
faster (-5%)
- pickle_pure_python: 547 us +- 5 us -> 523 us +- 5 us: 1.05x faster (-4%)
- unpickle: 17.7 us +- 0.1 us -> 17.0 us +- 0.2 us: 1.04x faster (-4%)
- mako: 20.0 ms +- 0.1 ms -> 19.5 ms +- 0.1 ms: 1.02x faster (-2%)
- unpickle_pure_python: 361 us +- 4 us -> 353 us +- 4 us: 1.02x faster (-2%)
- logging_simple: 9.59 us +- 0.14 us -> 9.39 us +- 0.12 us: 1.02x faster (-2%)
- scimark_fft: 462 ms +- 4 ms -> 455 ms +- 4 ms: 1.02x faster (-2%)
- chameleon: 11.6 ms +- 0.2 ms -> 11.4 ms +- 0.1 ms: 1.02x faster (-2%)
- pickle: 13.0 us +- 0.1 us -> 12.8 us +- 0.1 us: 1.02x faster (-1%)
- telco: 8.30 ms +- 0.23 ms -> 8.18 ms +- 0.14 ms: 1.01x faster (-1%)
- go: 277 ms +- 2 ms -> 274 ms +- 2 ms: 1.01x faster (-1%)
- pickle_list: 5.30 us +- 0.07 us -> 5.23 us +- 0.06 us: 1.01x faster (-1%)
- logging_format: 10.3 us +- 0.1 us -> 10.2 us +- 0.1 us: 1.01x faster (-1%)
- meteor_contest: 136 ms +- 0 ms -> 134 ms +- 1 ms: 1.01x faster (-1%)

Benchmark hidden because not significant (32): 2to3, chaos, crypto_pyaes, 
deltablue, dulwich_log, float, genshi_text, genshi_xml, hexiom, json_dumps, 
json_loads, logging_silent, nbody, pickle_dict, pyflate, python_startup, 
python_startup_no_site, scimark_lu, scimark_monte_carlo, spectral_norm, 
sqlalchemy_declarative, sqlalchemy_imperative, sqlite_synth, sympy_expand, 
sympy_integrate, sympy_sum, sympy_str, tornado_http, unpickle_list, 
xml_etree_parse, xml_etree_iterparse, xml_etree_generate

--
Added file: https://bugs.python.org/file49687/result.zip

___
Python tracker 

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



[issue40821] os.getlogin() not working

2020-12-16 Thread Christian Heimes


Christian Heimes  added the comment:

errno 6 is ENXIO. According to 
https://www.man7.org/linux/man-pages/man3/getlogin.3.html the error code means 
"The calling process has no controlling terminal.".

os.getlogin() returns the name of the user logged in on the controlling 
terminal of the process. Typically processes in user session (tty, X session) 
have a controlling terminal. Processes spawned by a service manager like init, 
systemd, or upstart usually do not have a controlling terminal. You have to get 
the user information by other means. Our documentation for os.getlogin() 
recommends getpass.getuser().

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



[issue42115] Caching infrastructure for the evaluation loop: specialised opcodes

2020-12-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I think I am closing the PR as it seems that the gains are not good enough (and 
there is quite a lot of noise by comparing the benchmarks together).

--

___
Python tracker 

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



[issue42658] os.path.normcase() is inconsistent with Windows file system

2020-12-16 Thread sogom


New submission from sogom :

On Windows file system, U+03A9 (Greek capital letter Omega) and U+2126 (Ohm 
sign) are distinguished. In fact, two distinct files "\u03A9.txt" and 
"\u2126.txt" can exist side by side in the same folder. But os.path.normcase() 
transforms both U+03A9 and U+2126 to U+03C9 (Greek small letter omega).

MSDN reads they use CompareStringOrdinal() to compare NTFS file names: 
https://docs.microsoft.com/en-us/windows/win32/intl/handling-sorting-in-your-applications#sort-strings-ordinally
 . This document also says "the function maps case using the operating system 
*uppercasing* table." But I made an experiment and found that at least in the 
Basic Multilingual Plane, "lowercase two strings by means of LCMapStringEx() 
and then wcscmp the two" always gives the same result as "compare the two 
strings with CompareStringOrdinal()". Though this fact is not explicitly 
mentioned in MSDN 
https://docs.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-lcmapstringex
 , the description of LCMAP_LINGUISTIC_CASING in this page implies that casing 
rules conform to file system's unless LCMAP_LINGUISTIC_CASING is used.

Therefore, I believe that os.path.normcase() should probably call 
LCMapStringEx(), with the first argument LOCALE_NAME_INVARIANT and the second 
argument LCMAP_LOWERCASE.

--
components: Windows
messages: 383163
nosy: paul.moore, sogom, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: os.path.normcase() is inconsistent with Windows file system
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



[issue42654] Add folder for python customizations: __sitecustomize__

2020-12-16 Thread Mario Corchero


Mario Corchero  added the comment:

Thread open in Python ideas: 
https://discuss.python.org/t/add-folder-for-python-customizations-sitecustomize/6190/5

--

___
Python tracker 

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



[issue42645] break/continue or return in finally block occurs twice in trace.

2020-12-16 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 5274b682bc93a04da8a69742528ac7f64633a96e by Mark Shannon in 
branch 'master':
bpo-42645: Make sure that return/break/continue are only traced once when 
exiting via a finally block. (GH-23780)
https://github.com/python/cpython/commit/5274b682bc93a04da8a69742528ac7f64633a96e


--

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fcc6935384b933fbe1a1ef659ed455a3b74c849a by Victor Stinner in 
branch 'master':
Add symbols of the stable ABI to python3dll.c (GH-23598)
https://github.com/python/cpython/commit/fcc6935384b933fbe1a1ef659ed455a3b74c849a


--

___
Python tracker 

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



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fcc6935384b933fbe1a1ef659ed455a3b74c849a by Victor Stinner in 
branch 'master':
Add symbols of the stable ABI to python3dll.c (GH-23598)
https://github.com/python/cpython/commit/fcc6935384b933fbe1a1ef659ed455a3b74c849a


--

___
Python tracker 

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



[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fcc6935384b933fbe1a1ef659ed455a3b74c849a by Victor Stinner in 
branch 'master':
Add symbols of the stable ABI to python3dll.c (GH-23598)
https://github.com/python/cpython/commit/fcc6935384b933fbe1a1ef659ed455a3b74c849a


--

___
Python tracker 

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



[issue37194] Move new vector private declarations to the internal C API

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fcc6935384b933fbe1a1ef659ed455a3b74c849a by Victor Stinner in 
branch 'master':
Add symbols of the stable ABI to python3dll.c (GH-23598)
https://github.com/python/cpython/commit/fcc6935384b933fbe1a1ef659ed455a3b74c849a


--

___
Python tracker 

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



[issue37194] Move new vector private declarations to the internal C API

2020-12-16 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22660
pull_request: https://github.com/python/cpython/pull/23801

___
Python tracker 

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



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2020-12-16 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22661
pull_request: https://github.com/python/cpython/pull/23801

___
Python tracker 

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



[issue42415] python3.lib in Python3.9.0 Windows distribution does not contain PyObject_CallNoArgs symbol

2020-12-16 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner
nosy_count: 7.0 -> 8.0
pull_requests: +22658
pull_request: https://github.com/python/cpython/pull/23801

___
Python tracker 

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



[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-12-16 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22659
pull_request: https://github.com/python/cpython/pull/23801

___
Python tracker 

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



[issue42415] python3.lib in Python3.9.0 Windows distribution does not contain PyObject_CallNoArgs symbol

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:

commit fcc6935384b933fbe1a1ef659ed455a3b74c849a
Author: Victor Stinner 
Date:   Wed Dec 16 15:08:23 2020 +0100

Add symbols of the stable ABI to python3dll.c (GH-23598)

Add the following symbols to python3dll.c:

* PyFrame_GetCode (bpo-40421)
* PyFrame_GetLineNumber (bpo-40421)
* PyModule_AddObjectRef (bpo-1635741)
* PyObject_CallNoArgs (bpo-37194)
* PyThreadState_GetFrame (bpo-39947)
* PyThreadState_GetID (bpo-39947)
* PyThreadState_GetInterpreter (bpo-39947)

I backported the change manually to 3.9: PR 23801.

--

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

2020-12-16 Thread Julien Palard


Change by Julien Palard :


--
pull_requests: +22662
pull_request: https://github.com/python/cpython/pull/23802

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

2020-12-16 Thread Julien Palard


Julien Palard  added the comment:

I created https://github.com/python/cpython/pull/23802 with a port of the 
"wrong backtick detector" (at least, one aspect from it) from suspicious to 
rstlint.

I dropped the suspicious check three weeks ago, and found a single committed 
issue since then, which was fixable (and is fixed) in rstlint, so I'll continue 
this experience and see where it goes.

--

___
Python tracker 

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



[issue42033] Seemingly unnecessary complexification of foo(**kw)

2020-12-16 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Even if making a copy is necessary when the underlying function receives the 
dict "raw", preemptively performing the copy (before knowing if the function 
being called is a Vectorcall function) means that when it's a Vectorcall 
function (e.g. all user-defined functions, right?), instead of just copying 
from the original dict to the unpacked stack for vectorcall, it makes an 
intermediate copy, then copies from that copy to the unpacked stack later on; 
the copy is otherwise completely unused.

The extra bytecode isn't even defending against "dict-like" kwargs, because 
CALL_FUNCTION_EX itself already copies to a true dict for anything that's not 
an exact dict (that defense shouldn't even be there if the bytecode compiler is 
already guaranteeing a true dict).

Seems like, if preventing the caller's dict from being passed directly to the 
underlying function is necessary and intended, it should be done in 
PyObject_Call (which can avoid the copy entirely when call a Vectorcall 
function and when the reference count on the dict is 1), not at the bytecode 
interpreter layer. As is, PyObject_Call is already violating the documented 
behavior by *not* matching the behavior of callable(*args, **kwargs) (see 
#42629), so moving it to PyObject_Call would fix that problem and improve 
performance passing a single kwargs.

--

___
Python tracker 

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



[issue42629] PyObject_Call not behaving as documented

2020-12-16 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Pingback from #42033. Proper fix for that issue likely involves moving the work 
for copying kwargs into PyObject_Call, which would fix this bug by side-effect.

--
nosy: +josh.r

___
Python tracker 

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



[issue42615] Redundant jump instructions due to deleted unreachable bytecode blocks

2020-12-16 Thread Om G


Change by Om G :


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



[issue42246] Implement PEP 626 -- Precise line numbers for debugging

2020-12-16 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +22663
pull_request: https://github.com/python/cpython/pull/23803

___
Python tracker 

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



[issue42659] Objects of uname_result Class Cannot be Successfully Pickled

2020-12-16 Thread CrocoDuck


New submission from CrocoDuck :

See the code example below.

```python
import platform
import pickle

pack = {
'uname_result': platform.uname()
}

with open('test.pickle', 'wb') as f:
pickle.dump(pack, f, protocol=pickle.HIGHEST_PROTOCOL)

with open('test.pickle', 'rb') as f:
data = pickle.load(f)

```

It works smoothly on Python 3.8.5. However, on Python 3.9.0, the last line 
produces this error:

```
Traceback (most recent call last):
  File "/Users/crocoduck/pickle/3.9.0/make_pickle.py", line 12, in 
data = pickle.load(f)
TypeError: () takes 6 positional arguments but 7 were given
```

The files produced by the code snipped above are attached for reference.

This was observed in macOS Catalina 10.15.7.

--
files: pickles.zip
messages: 383174
nosy: CrocoDuck
priority: normal
severity: normal
status: open
title: Objects of uname_result Class Cannot be Successfully Pickled
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49688/pickles.zip

___
Python tracker 

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



[issue40686] Compiler warnings in _zoneinfo.c on Windows build in 64-bit

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:

The problem can be simplified to this x.c file:
---
static int invalid_day(unsigned int day)
{
return (day < 0 || day > 6);
}

int main()
{
invalid_day(3);
return 0;
}
---

GCC emits the warning:

$ gcc x.c -o x -O3 -Wall -Wextra
x.c: In function 'invalid_day':
x.c:3:17: warning: comparison of unsigned expression in '< 0' is always false 
[-Wtype-limits]
3 | return (day < 0 || day > 6);
  | ^

There are different options to avoid the warning:


(A) Remove "day < 0" test

Easiest option, portable, simple: my PR 23614.


(B) Disable compiler warnings on the test

Solution currently implemented with pragma + PR 20619 to fix pragmas.


(C) Cast the 'day' variable to a signed type

I understand that Paul wants the code to be as generic as possible, and not 
depending on the "day" parameter type. For example, casting to "int8_t" may 
introduce a risk of integer overflow if day type is larger than 8 bits. Not my 
favorite option.


(D) Make "day < 0" conditional depending if day type is signed or not
(E) Check that day type is unsigned to ensure indirectly that "day >= 0"

Checking if *a type* is signed or not is easy using the C preprocessor:

#define _Py_IS_TYPE_UNSIGNED(type) (((type)-1) > (type)0) 

The problem is that there is no standard function to get a variable type. GCC 
and clang provide the __typeof__(var) extension, C++ provides decltype(var) 
(but CPython code base cannot be built with a C++ compiler if I recall 
correctly).

Paul's PR 20624 introduces Py_ASSERT_VAR_UNSIGNED(var) macro which fails during 
compilation if the variable is unsigned, or does nothing if the compiler 
doesn't provide a way to get a variable type (ex: MSC on Windows).


--


Most answers about "comparison of unsigned expression always false" question on 
the Internet are (A): remove the check which emits the warning.

My worry is also that outside _zoneinfo.c, they are tons of functions which 
rely on the fact that an unsigned type cannot be negativ. I don't want to start 
adding Py_ASSERT_VAR_UNSIGNED(). For me, it's part of the C language and there 
is no need to be explicit about it. If a developer changes a variable type, 
they have to check the type bounds and check of the variable is used.

I would prefer to be consistent and never check for "< 0" if the type is 
unsigned, nor ensure with an assertion that the type is unsigned.

Paul is in disagreement with that.

--

___
Python tracker 

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



[issue42529] CPython DLL initialization routine failed from PYC cache file

2020-12-16 Thread Karl Nelson


Karl Nelson  added the comment:

I am fairly sure this is a Python "bug" in the sense that there was some change 
in undocumented change in requirements and the distutils pattern for building a 
module no longer reflects that requirement.   That said very likely JPype is 
the only module to be affected and thus I will have to manually adjust to 
account for the new requirement.

Unfortunately as far as developers, I am it so fixing it (with your assistance) 
is going to have to fall on me.  So lets do a run down of how this all working 
so you can point me where to look.

1) JPype gets built as an ordinary setup.py CPython module.  So it is possibly 
a bug in the build pattern of the customizers in JPype that was exposed by 
Python 3.9.   I am just going to cut and paste so that it is easy to follow 
along.

jpype/setup.py
```
...
from setuptools import Extension
...
import setupext
...
jpypeLib = Extension(name='_jpype', **setupext.platform.Platform(
include_dirs=[Path('native', 'common', 'include'),
  Path('native', 'python', 'include'),
  Path('native', 'embedded', 'include')],
sources=[Path('native', 'common', '*.cpp'),
 Path('native', 'python', '*.cpp'),
 Path('native', 'embedded', '*.cpp')], platform=platform,
))
```

We have two sets of customization in setup.py.  Both are included from a module 
called jpype/setupext/

The key one is the jpype/setupext/platform.py which defines the compiler flags. 
 There are two sections of interest...

jpype/setupext/platform.py contains these modifications for win32.   
(So there is the Advapi32, not sure why it appears there because this section 
is all before my time as this was started in 2001 and I joined in 2018)
```
static = True
if platform == 'win32':
distutils.log.info("Add windows settings")
platform_specific['libraries'] = ['Advapi32']
platform_specific['define_macros'] = [('WIN32', 1)]
if sys.version > '3':
platform_specific['extra_compile_args'] = [
'/Zi', '/EHsc', '/std:c++14']
else:
platform_specific['extra_compile_args'] = ['/Zi', '/EHsc']
platform_specific['extra_link_args'] = ['/DEBUG']
jni_md_platform = 'win32'
```

The second section is currently commented out.  Though it is relevant because 
JPype is exotic in one way.  It is a module which is loaded in three ways.   
When imported from Python it is an ordinary library (1) which will later pull 
in Java which will then load library a second time (2) to bind Java native 
methods.   It can also be used to launch Python if Java starts the session (3). 
  In that case, it needs libpython.dll to be bound to module so that the Java 
equivalent to LoadLibrary can work.  When it does Java first manually loads 
libpython.dll then loads the module and calls the hook to get Python started. 
```
# This code is used to include python library in the build when starting Python 
from
# within Java.  It will be used in the future, but is not currently required.
#if static and sysconfig.get_config_var('BLDLIBRARY') is not None:
#
platform_specific['extra_link_args'].append(sysconfig.get_config_var('BLDLIBRARY'))
```

The actual buildext has a few minor patches so that Java libraries can run 
through the normal process.  But nothing seems like a good candidate

We have one section tweeking some of the build options.
```
def initialize_options(self, *args):
"""omit -Wstrict-prototypes from CFLAGS since its only valid for C 
code."""
self.android = False
self.makefile = False
self.jar = False
import distutils.sysconfig
cfg_vars = distutils.sysconfig.get_config_vars()
replacement = {
'-Wstrict-prototypes': '',
'-Wimplicit-function-declaration': '',
}
tracing = self.distribution.enable_tracing

# Arguments to remove so we set debugging and optimization level
remove_args = ['-O0', '-O1', '-O2', '-O3', '-g']

for k, v in cfg_vars.items():
if not isinstance(v, str):
continue
if not k == "OPT" and not "FLAGS" in k:
continue

args = v.split()
for r in remove_args:
args = list(filter((r).__ne__, args))

cfg_vars[k] = " ".join(args)
super().initialize_options()
```

Then later we interrupt the build process for Java.
```
def build_extension(self, ext):
if ext.language == "java":
return self.build_java_ext(ext)
if self.jar:
return
print("Call build ext")
return super().build_extension(ext)
```

2) Next we have the module start.  I am guessing this is not the source of the 
error because adding a printf shows we never got to this point.

jpype/native/pyjp_module.cpp
```
PyMODINIT_FUNC PyInit__jpype()
{
JP_PY_TRY("PyInit__jpype");
JPCo

[issue40686] Compiler warnings in _zoneinfo.c on Windows build in 64-bit

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset aefb69b23f056c61e82ad228d950f348de090c70 by Victor Stinner in 
branch 'master':
bpo-40686: Fix compiler warnings on _zoneinfo.c (GH-23614)
https://github.com/python/cpython/commit/aefb69b23f056c61e82ad228d950f348de090c70


--

___
Python tracker 

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



[issue40686] Compiler warnings in _zoneinfo.c on Windows build in 64-bit

2020-12-16 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +22664
pull_request: https://github.com/python/cpython/pull/23804

___
Python tracker 

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



[issue40686] Compiler warnings in _zoneinfo.c on Windows build in 64-bit

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:

The 3 compiler warnings are now fixed in master, and a 3.9 backport will land 
as soon as the CI tests pass. Thanks everyone who helped to fix these warnings.

I know that the solution is not perfect, but we have to deal with C language 
limitations.

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



[issue40686] Compiler warnings in _zoneinfo.c on Windows build in 64-bit

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:

Fixing these compiler warnings helps PR 18532 "[workflow] Use MSVC problem 
matcher for Windows action build".

--

___
Python tracker 

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



[issue42660] _zoneinfo.c incorrectly checks bounds of `day` variable in calenderrule_new

2020-12-16 Thread Paul Ganssle

New submission from Paul Ganssle :

This is a code style issue — in https://github.com/python/cpython/pull/23614, a 
regression was deliberately introduced to satisfy an overzealous compiler. The 
`day` variable has logical bounds `0 <= day <= 6`. In the original code, both 
sides of this boundary condition were explicitly checked (since this logically 
documents the bounds of the variable).

Some compilers complain about checking `day < 0`, because `day` is an unsigned 
type. It is not an immutable fact that `day` will always be an unsigned type, 
and implicitly relying on this fact makes the code both less readable and more 
fragile. This was changed over my objections and despite the fact that I had a 
less fragile solution available that also satisfied the overzealous compiler.

In the short term, my preferred solution would be to add in a static assertion 
that `day` is an unsigned type — this does not have to work on every platform, 
it simply needs to serve as a notification to make the code less fragile and to 
document our assumptions to both readers and the compiler.

In the long term, I think we need a way to solve the problem that it is 
apparently not possible to disable any compiler warnings even if they don't 
apply to the situation!

--
components: Library (Lib)
messages: 383180
nosy: p-ganssle
priority: normal
severity: normal
stage: needs patch
status: open
title: _zoneinfo.c incorrectly checks bounds of `day` variable in 
calenderrule_new
type: behavior
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue37961] Tracemalloc traces do not include original stack trace length

2020-12-16 Thread daniel hahler


Change by daniel hahler :


--
nosy: +blueyed
nosy_count: 2.0 -> 3.0
pull_requests: +22665
pull_request: https://github.com/python/cpython/pull/23805

___
Python tracker 

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



[issue23915] [doc] traceback set with BaseException.with_traceback() pushed back on raise

2020-12-16 Thread Julien Palard


Julien Palard  added the comment:


New changeset c590c2338e5a36cf3ce5b55e6d366a0675ed1db5 by Irit Katriel in 
branch 'master':
bpo-23915: update and elucidate documentation of with_traceback (GH-23680)
https://github.com/python/cpython/commit/c590c2338e5a36cf3ce5b55e6d366a0675ed1db5


--
nosy: +mdk

___
Python tracker 

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



[issue23915] [doc] traceback set with BaseException.with_traceback() pushed back on raise

2020-12-16 Thread Julien Palard


Change by Julien Palard :


--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue42660] _zoneinfo.c incorrectly checks bounds of `day` variable in calenderrule_new

2020-12-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I do not think there is any problem *now*. The type of day is uint8_t, it 
cannot be negative.

BTW, why is it uint8_t? Would not be easier to use type int by default? I doubt 
that it saves memory or makes the code faster.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue42659] Objects of uname_result Class Cannot be Successfully Pickled

2020-12-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See also issue42189.

--
components: +Library (Lib)
nosy: +jaraco, serhiy.storchaka

___
Python tracker 

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



[issue40686] Compiler warnings in _zoneinfo.c on Windows build in 64-bit

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7492b55ea0ca993c353b6373341b92e40faa9c4d by Miss Islington (bot) 
in branch '3.9':
bpo-40686: Fix compiler warnings on _zoneinfo.c (GH-23614) (GH-23804)
https://github.com/python/cpython/commit/7492b55ea0ca993c353b6373341b92e40faa9c4d


--

___
Python tracker 

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



  1   2   >