[issue44346] Fraction constructor may accept spaces around '/'

2021-06-09 Thread Sergey B Kirpichev


Sergey B Kirpichev  added the comment:

> See previous discussion in #9574.

Given this, probably spaces around '/' should be disallowed.

--

___
Python tracker 

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



[issue40468] IDLE: configdialog tab rearrange

2021-06-09 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +25205
pull_request: https://github.com/python/cpython/pull/26621

___
Python tracker 

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



[issue44351] distutils.sysconfig.parse_makefile() regression in Python 3.10

2021-06-09 Thread Lumír Balhar

Lumír Balhar  added the comment:

Thanks for the report.

The regression is caused by the fact that the old implementation of 
parse_makefile in distutils.sysconfig was using feature-rich class TextFile 
which handles all the functionalities you reported as broken - stripping of 
comments, joining lines, and more.

The new implementation of parse_makefile in sysconfig just reads all the lines 
without any processing.

The TextFile class is deprecated together with the whole distutils. The class 
is not used outside of distutils modules, only in these functions:

distutils.extension:read_setup_file
distutils.sdist:read_template
+ its tests in distutils/tests/test_text_file.py

If the functionality is something we want to preserve, we should find a new 
home for the class and then we can use it in the sysconfig module.

--

___
Python tracker 

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



[issue44357] Add math.cbrt() function: Cube Root

2021-06-09 Thread Ajith Ramachandran


Change by Ajith Ramachandran :


--
components: Library (Lib)
nosy: AjithRamachandran
priority: normal
severity: normal
status: open
title: Add math.cbrt() function: Cube Root
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



[issue44358] AMD64 RHEL8 LTO + PGO 3.x build failed with: /usr/bin/ld: Dwarf Error: Offset (2487097600) greater than or equal to .debug_str size (571933).

2021-06-09 Thread STINNER Victor


New submission from STINNER Victor :

On RHEL8, gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1) fails to build Python with 
LTO+PGO: the linker fails with "Dwarf Error".

On ~200 builds, the linker error only occurred once (build 279) :-( It sounds 
really hard to reproduce.

I suggest to close the issue as "out of date" if it doesn't come back next 
weeks.

https://buildbot.python.org/all/#/builders/568/builds/279

gcc -pthread   -fno-semantic-interposition -flto -fuse-linker-plugin 
-ffat-lto-objects -flto-partition=none -g -fprofile-generate -Xlinker 
-export-dynamic -o Programs/_testembed Programs/_testembed.o libpython3.11.a 
-lcrypt -lpthread -ldl  -lutil -lm   -lm 
/usr/bin/ld: Dwarf Error: Offset (2487097600) greater than or equal to 
.debug_str size (571933).
/usr/bin/ld: Dwarf Error: Could not find abbrev number 12095.

Then the linker failed to find many symbols:

/tmp/cccV00H7.lto.o: In function `signal_pthread_sigmask':
:(.text+0x292cbc): undefined reference to `_Py_Sigset_Converter'
/tmp/cccV00H7.lto.o: In function `fill_siginfo':
:(.text+0x2930cb): undefined reference to `_PyLong_FromUid'
/tmp/cccV00H7.lto.o: In function `signal_sigwaitinfo':
:(.text+0x29325e): undefined reference to `_Py_Sigset_Converter'
/tmp/cccV00H7.lto.o: In function `signal_sigtimedwait':
:(.text+0x293566): undefined reference to `_Py_Sigset_Converter'
/tmp/cccV00H7.lto.o: In function `signal_sigwait':
:(.text+0x293af0): undefined reference to `_Py_Sigset_Converter'
/tmp/cccV00H7.lto.o: In function `PyUnicode_FSDecoder':
:(.text+0x315fed): undefined reference to `PyOS_FSPath'
/tmp/cccV00H7.lto.o: In function `mkpwent':
:(.text+0x31a78c): undefined reference to `_PyLong_FromUid'
:(.text+0x31a7a1): undefined reference to `_PyLong_FromGid'
/tmp/cccV00H7.lto.o: In function `pwd_getpwuid':
:(.text+0x31afb6): undefined reference to `_Py_Uid_Converter'
:(.text+0x31b1df): undefined reference to `_PyLong_FromUid'
/tmp/cccV00H7.lto.o: In function `PyUnicode_FSConverter':
:(.text+0x349247): undefined reference to `PyOS_FSPath'
/tmp/cccV00H7.lto.o: In function `_io_open':
:(.text+0x38781d): undefined reference to `PyOS_FSPath'
/tmp/cccV00H7.lto.o:(.data+0x74528): undefined reference to `PyInit_posix'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:603: python] Error 1
make[3]: *** Waiting for unfinished jobs
/usr/bin/ld: Dwarf Error: Could not find abbrev number 6864.
/tmp/ccMUbctW.lto.o: In function `fill_siginfo':
:(.text+0x1f010b): undefined reference to `_PyLong_FromUid'
/tmp/ccMUbctW.lto.o: In function `signal_sigwait':
:(.text+0x2a6d80): undefined reference to `_Py_Sigset_Converter'
/tmp/ccMUbctW.lto.o: In function `signal_sigwaitinfo':
:(.text+0x2a821e): undefined reference to `_Py_Sigset_Converter'
/tmp/ccMUbctW.lto.o: In function `signal_pthread_sigmask':
:(.text+0x2b05bc): undefined reference to `_Py_Sigset_Converter'
/tmp/ccMUbctW.lto.o: In function `signal_sigtimedwait':
:(.text+0x2b2536): undefined reference to `_Py_Sigset_Converter'
/tmp/ccMUbctW.lto.o: In function `PyUnicode_FSDecoder':
:(.text+0x30d08d): undefined reference to `PyOS_FSPath'
/tmp/ccMUbctW.lto.o: In function `mkpwent':
:(.text+0x30edac): undefined reference to `_PyLong_FromUid'
:(.text+0x30edc1): undefined reference to `_PyLong_FromGid'
/tmp/ccMUbctW.lto.o: In function `pwd_getpwuid':
:(.text+0x30f5d6): undefined reference to `_Py_Uid_Converter'
:(.text+0x30f7ff): undefined reference to `_PyLong_FromUid'
/tmp/ccMUbctW.lto.o: In function `PyUnicode_FSConverter':
:(.text+0x33b157): undefined reference to `PyOS_FSPath'
/tmp/ccMUbctW.lto.o: In function `_io_open':
:(.text+0x377d0d): undefined reference to `PyOS_FSPath'
/tmp/ccMUbctW.lto.o:(.data+0x84748): undefined reference to `PyInit_posix'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:744: Programs/_testembed] Error 1
make[3]: Leaving directory 
'/home/buildbot/buildarea/3.x.cstratak-RHEL8-x86_64.lto-pgo/build'
make[2]: *** [Makefile:533: build_all_generate_profile] Error 2
make[2]: Leaving directory 
'/home/buildbot/buildarea/3.x.cstratak-RHEL8-x86_64.lto-pgo/build'
make[1]: *** [Makefile:509: profile-gen-stamp] Error 2
make[1]: Leaving directory 
'/home/buildbot/buildarea/3.x.cstratak-RHEL8-x86_64.lto-pgo/build'
make: *** [Makefile:521: profile-run-stamp] Error 2
program finished with exit code 2
elapsedTime=157.205212

--
components: Build
messages: 395386
nosy: pablogsal, vstinner
priority: normal
severity: normal
status: open
title: AMD64 RHEL8 LTO + PGO 3.x build failed with: /usr/bin/ld: Dwarf Error: 
Offset (2487097600) greater than or equal to .debug_str size (571933).
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



[issue44351] distutils.sysconfig.parse_makefile() regression in Python 3.10

2021-06-09 Thread Petr Viktorin


Petr Viktorin  added the comment:

IMO, the functionality should only be preserved until distutils is removed. So:

- distutils.sysconfig.parse_makefile should use TextFile as before, so projects 
that use it aren't broken *yet*
- nothing else should call distutils.sysconfig.parse_makefile, so it doesn't 
block removing distutils

Would that make sense?

--

___
Python tracker 

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



[issue44359] test_ftplib fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched

2021-06-09 Thread STINNER Victor

New submission from STINNER Victor :

test_ftplib fails with "env changed" if a socket operation times out in a 
thread (in the "dummy FTP server").

Example on AMD64 Fedora Rawhide LTO 3.10:
https://buildbot.python.org/all/#/builders/653/builds/95

0:02:41 load avg: 8.20 [394/427/1] test_ftplib failed (env changed) -- running: 
test_lib2to3 (33.9 sec), test_peg_generator (2 min 37 sec), 
test_concurrent_futures (1 min 53 sec), test_gdb (1 min 37 sec)
Warning -- Uncaught thread exception: Exception
Exception in thread Thread-34:
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/asyncore.py",
 line 83, in read
obj.handle_read_event()
  File 
"/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/asyncore.py",
 line 420, in handle_read_event
self.handle_read()
  File 
"/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/asynchat.py",
 line 171, in handle_read
self.found_terminator()
  File 
"/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/test/test_ftplib.py",
 line 129, in found_terminator
method(arg)
  File 
"/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/test/test_ftplib.py",
 line 154, in cmd_pasv
conn, addr = sock.accept()
  File 
"/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/socket.py",
 line 293, in accept
fd, addr = self._accept()
TimeoutError: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/threading.py",
 line 1006, in _bootstrap_inner
self.run()
  File 
"/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/test/test_ftplib.py",
 line 292, in run
asyncore.loop(timeout=0.1, count=1)
  File 
"/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/asyncore.py",
 line 207, in loop
poll_fun(timeout, map)
  File 
"/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/asyncore.py",
 line 150, in poll
read(obj)
  File 
"/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/asyncore.py",
 line 87, in read
obj.handle_error()
  File 
"/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/test/test_ftplib.py",
 line 134, in handle_error
raise Exception
Exception

test_abort (test.test_ftplib.TestFTPClass) ... ok
(...)
test__all__ (test.test_ftplib.MiscTestCase) ... ok

--

Ran 94 tests in 8.491s

OK (skipped=2)



A similar issue (is it the same one?) can be reproduced with attached 
test_ftplib_timeout.patch which sets the timeout to 1 nanosecond and the 
command:

$ ./python -m test test_ftplib -v --fail-env-changed -m 
test.test_ftplib.TestFTPClass.test_retrlines
== CPython 3.11.0a0 (heads/main:257e400a19, Jun 8 2021, 18:04:17) [GCC 11.1.1 
20210531 (Red Hat 11.1.1-3)]
== Linux-5.12.8-300.fc34.x86_64-x86_64-with-glibc2.33 little-endian
== cwd: /home/vstinner/python/main/build/test_python_129053æ
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
0:00:00 load avg: 1.03 Run tests sequentially
0:00:00 load avg: 1.03 [1/1] test_ftplib
test_retrlines (test.test_ftplib.TestFTPClass) ... Warning -- Uncaught thread 
exception: Exception
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/home/vstinner/python/main/Lib/asyncore.py", line 83, in read
obj.handle_read_event()
  File "/home/vstinner/python/main/Lib/asyncore.py", line 420, in 
handle_read_event
self.handle_read()
  File "/home/vstinner/python/main/Lib/asynchat.py", line 171, in handle_read
self.found_terminator()
  File "/home/vstinner/python/main/Lib/test/test_ftplib.py", line 129, in 
found_terminator
method(arg)
  File "/home/vstinner/python/main/Lib/test/test_ftplib.py", line 154, in 
cmd_pasv
conn, addr = sock.accept()
  File "/home/vstinner/python/main/Lib/socket.py", line 293, in accept
fd, addr = self._accept()
TimeoutError: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vstinner/python/main/Lib/threading.py", line 1006, in 
_bootstrap_inner
self.run()
  File "/home/vstinner/python/main/Lib/test/test_ftplib.py", line 292, in run
asyncore.loop(timeout=0.1, count=1)
  File "/home/vstinner/python/main/Lib/asyncore.py", line 207, in loop
poll_fun(timeout, map)
  File "/home/vstinner/python/main/Lib/asyncore.py", line 150, in poll
read(obj)
  File "/home/vstinner/python/main/Lib/asyncore.py", line 87, in read
obj.handle_error()
  File "/home/vstinner/python/main/Lib/test/test_ftplib.py", line 134, in 
handle_error
raise Exception
Exception
ERROR

==
ERROR: test_retrlines (te

[issue44357] Add math.cbrt() function: Cube Root

2021-06-09 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

See also issue27353.

--
nosy: +lemburg, mark.dickinson, rhettinger, serhiy.storchaka, stutzbach
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



[issue44359] test_ftplib fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched

2021-06-09 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue44360] test_compile segfault on AMD64 Ubuntu 3.x

2021-06-09 Thread STINNER Victor

New submission from STINNER Victor :

test_compile and test_multiprocessing_forkserver crashed with segfault 
(SIGSEGV) on AMD64 Ubuntu 3.x:
https://buildbot.python.org/all/#/builders/708/builds/31

It *seems* like test_compile.test_stack_overflow() crashed, but the log is not 
reliable so I cannot confirm.

According to buildbot, the responsible change is:
"bpo-43693: Un-revert commit f3fa63e. (#26609)(10 hours ago)"
https://github.com/python/cpython/commit/3e1c7167d86a2a928cdcb659094aa10bb5550c4c

So Eric, can you please investigate the change? If nobody is available to fix 
the buildbot, I suggest to revert the change.


Python was built in debug mode with:

./configure --prefix '$(PWD)/target' --with-pydebug
make all


test.pythoninfo:

CC.version: gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0
os.uname: posix.uname_result(sysname='Linux', 
nodename='doxy.learntosolveit.com', release='5.11.0-18-generic', 
version='#19-Ubuntu SMP Fri May 7 14:22:03 UTC 2021', machine='x86_64')
platform.platform: Linux-5.11.0-18-generic-x86_64-with-glibc2.33
sys.thread_info: sys.thread_info(name='pthread', lock='semaphore', 
version='NPTL 2.33')


Logs:

./python  ./Tools/scripts/run_tests.py -j 1 -u all -W --slowest 
--fail-env-changed --timeout=900 -j2 --junit-xml test-results.xml 
== CPython 3.11.0a0 (heads/main:3e1c7167d8, Jun 8 2021, 22:09:42) [GCC 10.3.0]
== Linux-5.11.0-18-generic-x86_64-with-glibc2.33 little-endian
== cwd: 
/home/buildbot/buildarea/3.x.skumaran-ubuntu-x86_64/build/build/test_python_1439770æ
== CPU count: 1
== encodings: locale=UTF-8, FS=utf-8
Using random seed 5059550
0:00:00 load avg: 0.97 Run tests in parallel using 2 child processes (timeout: 
15 min, worker timeout: 20 min)
(...)
0:00:43 load avg: 2.22 running: test_compile (34.7 sec), test_signal (30.8 sec)
0:01:12 load avg: 3.84 [ 13/427/1] test_compile crashed (Exit code -9) -- 
running: test_signal (59.6 sec)
(...)
0:06:26 load avg: 1.84 running: test_concurrent_futures (42.0 sec), 
test_multiprocessing_forkserver (30.0 sec)
0:06:56 load avg: 3.91 running: test_concurrent_futures (1 min 12 sec), 
test_multiprocessing_forkserver (1 min)
0:07:26 load avg: 5.47 running: test_concurrent_futures (1 min 42 sec), 
test_multiprocessing_forkserver (1 min 30 sec)
0:07:58 load avg: 5.93 running: test_concurrent_futures (2 min 13 sec), 
test_multiprocessing_forkserver (2 min 2 sec)
0:08:30 load avg: 5.73 running: test_concurrent_futures (2 min 44 sec), 
test_multiprocessing_forkserver (2 min 33 sec)
0:08:48 load avg: 4.62 [ 85/427/2] test_multiprocessing_forkserver crashed 
(Exit code -9) -- running: test_concurrent_futures (3 min 3 sec)
(...)
2 tests failed:
test_compile test_multiprocessing_forkserver
(...)
0:27:56 load avg: 1.28 Re-running test_compile in verbose mode
test_and (test.test_compile.TestExpressionStackSize) ... ok
(...)
test_sequence_unpacking_error (test.test_compile.TestSpecifics) ... ok
test_single_statement (test.test_compile.TestSpecifics) ... ok
test_stack_overflow (test.test_compile.TestSpecifics) ... 
make: *** [Makefile:1256: buildbottest] Killed
program finished with exit code 2
elapsedTime=1684.973552

--
components: Tests
messages: 395390
nosy: eric.snow, pablogsal, vstinner
priority: normal
severity: normal
status: open
title: test_compile segfault on AMD64 Ubuntu 3.x
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



[issue44360] test_compile segfault on AMD64 Ubuntu 3.x

2021-06-09 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-44348 
"test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow 
on Windows debug builds".

--

___
Python tracker 

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



[issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds

2021-06-09 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-44360 "test_compile segfault on AMD64 Ubuntu 3.x".

--

___
Python tracker 

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



[issue44361] test_smtpnet failed with SMTPServerDisconnected on x86 Gentoo Non-Debug with X 3.10

2021-06-09 Thread STINNER Victor


New submission from STINNER Victor :

x86 Gentoo Non-Debug with X 3.10:
https://buildbot.python.org/all/#/builders/698/builds/112

This buildbot worker has Internet connection issues, so my concern is only how 
test_smtpnet handles Internet issues.

The two tests which fail use "with 
socket_helper.transient_internet(self.testServer):", but it seems like this 
context manager doesn't catch SMTPServerDisconnected.

Maybe transient_internet() should be modified to catch 
smtplib.SMTPServerDisconnected (or even the generic smtplib.SMTPException)?

==
ERROR: test_connect_default_port (test.test_smtpnet.SmtpSSLTest)
--
Traceback (most recent call last):
  File 
"/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/test/test_smtpnet.py",
 line 60, in test_connect_default_port
server = smtplib.SMTP_SSL(self.testServer)
  File 
"/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py",
 line 1045, in __init__
SMTP.__init__(self, host, port, local_hostname, timeout,
  File 
"/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py",
 line 255, in __init__
(code, msg) = self.connect(host, port)
  File 
"/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py",
 line 343, in connect
(code, msg) = self.getreply()
  File 
"/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py",
 line 400, in getreply
raise SMTPServerDisconnected("Connection unexpectedly closed")
smtplib.SMTPServerDisconnected: Connection unexpectedly closed

==
ERROR: test_connect_using_sslcontext (test.test_smtpnet.SmtpSSLTest)
--
Traceback (most recent call last):
  File 
"/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/test/test_smtpnet.py",
 line 70, in test_connect_using_sslcontext
server = smtplib.SMTP_SSL(self.testServer, self.remotePort, context=context)
  File 
"/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py",
 line 1045, in __init__
SMTP.__init__(self, host, port, local_hostname, timeout,
  File 
"/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py",
 line 255, in __init__
(code, msg) = self.connect(host, port)
  File 
"/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py",
 line 343, in connect
(code, msg) = self.getreply()
  File 
"/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py",
 line 400, in getreply
raise SMTPServerDisconnected("Connection unexpectedly closed")
smtplib.SMTPServerDisconnected: Connection unexpectedly closed

--
components: Tests
messages: 395393
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_smtpnet failed with SMTPServerDisconnected on x86 Gentoo Non-Debug 
with X 3.10
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



[issue44355] Allow spaces in format strings

2021-06-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Syntax of format strings cannot be the same as in f-strings. {0} means the 
first positional argument in format string an integer literal 0 in f-string. 
{a[x]} means the value of literal string key "x" of keyword argument a in 
format string, and indexing variable a with variable index/key x in f-string. 
Such things as {if}, {+.name} or {0[-]} are not even valid in f-strings.

Since we cannot get rid of all differences between format strings and 
f-strings, I do not think that this one change is worth. It will only make 
differences more complex. Not mentioning that it is a compatibility breaking 
change, and can break user code.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue44360] test_compile segfault on AMD64 Ubuntu 3.x

2021-06-09 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue44361] test_smtpnet failed with SMTPServerDisconnected on x86 Gentoo Non-Debug with X 3.10

2021-06-09 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue44357] Add math.cbrt() function: Cube Root

2021-06-09 Thread Ajith Ramachandran


Change by Ajith Ramachandran :


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

___
Python tracker 

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



[issue44358] AMD64 RHEL8 LTO + PGO 3.x build failed with: /usr/bin/ld: Dwarf Error: Offset (2487097600) greater than or equal to .debug_str size (571933).

2021-06-09 Thread STINNER Victor


STINNER Victor  added the comment:

On OFTC #gcc, I'm told that it can this known issue fixed in 2018:
https://sourceware.org/bugzilla/show_bug.cgi?id=23425

--

___
Python tracker 

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



[issue44357] Add math.cbrt() function: Cube Root

2021-06-09 Thread Mark Dickinson


Mark Dickinson  added the comment:

+1. This is part of C99, so if it's also supported by Visual Studio, then this 
seems like a no-brainer. If it's _not_ also supported by Visual Studio, or if 
there are implementations that have serious numerical problems (as was the case 
with fma) we'll need to write our own fallback implementation, which is less 
simple.

In principle it should be relatively easy for a math library to provide a 
correctly-rounded cbrt.

--

___
Python tracker 

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



[issue44343] Adding the "with" statement support to ContextVar

2021-06-09 Thread Joongi Kim


Joongi Kim  added the comment:

After checking out PEP-567 (https://www.python.org/dev/peps/pep-0567/),
I'm adding njs to the nosy list.

--
nosy: +njs

___
Python tracker 

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



[issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf

2021-06-09 Thread Steven D'Aprano


Change by Steven D'Aprano :


--
nosy: +steven.daprano

___
Python tracker 

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



[issue44344] Documentation for pow() should include the possibility of complex numbers as a return type

2021-06-09 Thread Steven D'Aprano


Change by Steven D'Aprano :


--
nosy: +steven.daprano

___
Python tracker 

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



[issue44362] improve documentation of SSL deprecations

2021-06-09 Thread Thomas Grainger


New submission from Thomas Grainger :

> I can see in the 3.10 release notes, that ssl.PROTOCOL_TLS becomes 
> deprecated. Is there any further context explaining why, and what the 
> preferred usage is instead, so that I (and anyone else) can understand this a 
> bit more thoroughly?

https://github.com/encode/httpx/issues/1670#issuecomment-857509311

--
messages: 395398
nosy: alex, christian.heimes, dstufft, graingert, janssen
priority: normal
severity: normal
status: open
title: improve documentation of SSL deprecations
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



[issue44357] Add math.cbrt() function: Cube Root

2021-06-09 Thread Mark Dickinson


Mark Dickinson  added the comment:

BTW, to forestall questions about adding cmath.cbrt: it's not obvious how to 
extend the real cube root function to a complex cube root, so it might make 
sense to wait for actual use-cases before doing so.

The issue is that the most natural way to define a complex cube root would use 
a branch cut along the negative real axis (the same branch cut that cmath.sqrt 
and cmath.log use). But then the principal branch would *not* be an extension 
of math.cbrt: it would return non-real values on the negative real axis. (The 
*real* cube roots of negative numbers would fall on the two non-principal 
branches.)

See for example 
https://math.stackexchange.com/questions/71775/extending-the-cube-root-function-to-mathbbc

--

___
Python tracker 

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



[issue44362] improve documentation of SSL deprecations

2021-06-09 Thread Thomas Grainger


Thomas Grainger  added the comment:

It's also confusing that other not deprecated flags are described in terms of 
this deprecated flag. These will need rewriting when the deprecated flag is 
removed

--

___
Python tracker 

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



[issue44358] AMD64 RHEL8 LTO + PGO 3.x build failed with: /usr/bin/ld: Dwarf Error: Offset (2487097600) greater than or equal to .debug_str size (571933).

2021-06-09 Thread STINNER Victor


STINNER Victor  added the comment:

I reported the compiler bug to RHEL: 
https://bugzilla.redhat.com/show_bug.cgi?id=1969775

--

___
Python tracker 

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



[issue44362] improve documentation of SSL deprecations

2021-06-09 Thread Christian Heimes


Change by Christian Heimes :


--
assignee:  -> docs@python
components: +Documentation, SSL
nosy: +docs@python
type:  -> enhancement

___
Python tracker 

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



[issue44354] ssl deprecation warnings erganomics

2021-06-09 Thread Christian Heimes


Change by Christian Heimes :


--
assignee:  -> christian.heimes
components: +SSL
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue44354] ssl deprecation warnings erganomics

2021-06-09 Thread Christian Heimes


Change by Christian Heimes :


--
assignee: christian.heimes -> 

___
Python tracker 

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



[issue44351] distutils.sysconfig.parse_makefile() regression in Python 3.10

2021-06-09 Thread Miro Hrončok

Miro Hrončok  added the comment:

Yes, for the purposes of this bug, bringing TextFile-powered parse_makefile() 
back to distutils (and distutils only) is the right thing to do.

Whether or not Python needs a public standard library function to parse 
makefiles and whether that function in sysconfig is imperfect and needs 
improvements, that is an entirely different discussion.

--

___
Python tracker 

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



[issue44363] Likely false positive for address sanitizer after fork

2021-06-09 Thread Mark Shannon


New submission from Mark Shannon :

Running the buildbot for https://github.com/python/cpython/pull/26595
results in failures:
https://buildbot.python.org/all/#/builders/581/builds/63
Which claim that the address calculation in `LOAD_ATTR_MODULE` is out of bounds.

The tests pass with an added assert to verify that the address in question is 
in bounds. 

All failures seem to happen after a fork, which seems to be a longstanding 
weakness of the address sanitizer.

I'd like to merge https://github.com/python/cpython/pull/26595. I'd also like 
to keep the buildbots working. Dichotomy.

--
messages: 395403
nosy: Mark.Shannon, pablogsal
priority: normal
severity: normal
status: open
title: Likely false positive for address sanitizer after fork

___
Python tracker 

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



[issue44355] Allow spaces in format strings

2021-06-09 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I agree that we cannot make the syntax of format string identifal to
f-strings. F-strings support arbitrary expressions, while format strings 
support only a small subset of possible identifiers.

My comment was not to make format strings identical to f-strings, which 
would be impossible, but to point out that whitespace around identifiers 
and indices is not significant in most contexts, including f-strings.

* in code `1 + a [ key ]` is the same as `1+a[key]`
* the name ` spam ` is the same as `spam`
* in f-strings `f'{ spam }'` and `f'{spam}'` are the same

etc. Places (apart from indentation and newlines) where whitespace has 
meaning is very rare. But inside format braces it is treated as 
significant.

In a format string, we cannot make spaces part of the keyword parameter:

'{ } { 1 } { x }'.format(' '=20, ' 1 '=30, ' x '=40)

is not valid syntax.

I think that, for the format method, any whitespace in the `{}` will 
prevent the method from working and will raise KeyError. Unless I have 
missed something, I think that it is *impossible* for anyone to use 
spaces in the format method without an exception, and so it is safe for 
us to change the behaviour.

Right now, the only reason spaces will appear inside the braces of a 
format string will be by mistake, which will raise. So unless I have 
missed something, this would be a safe enhancement for the `format` 
method that would make format strings behave more like other parts of 
Python code. One less surprise.

The format_map method is a little bit different:

>>> '{ x }'.format_map({'x': 10, ' x ': 20})
'20'

So it is *possible*, but unlikely, that people are using keys with 
spaces in format_map calls. So we have some alternatives:

1. Reject this enhancement and do nothing.

2. Have the format method alone strip spaces, and format_map preserve 
   them. This would be backwards compatible, but a surprising 
   difference between the two methods.

3. Give format_map a keyword-only parameter, "preserve_spaces". The 
   format method will always strip spaces; format_map will only strip 
   them if the preserve_spaces parameter is False.

4. Probably nobody is *actually* using spaces in format_map either. It
   would be a very unusual and rare thing to do. So maybe we break
   backwards compatibility and don't bother with the extra keyword 
   parameter.

I think that option 3, with a default of True, would be safe. Option 3 
with a default of False would technically break backwards compatibility, 
but would allow people who wanted the old behaviour to get it. Since I 
doubt that there are many people, I think that option 3 with a default 
of False is acceptable.

--

___
Python tracker 

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



[issue44357] Add math.cbrt() function: Cube Root

2021-06-09 Thread Ajith Ramachandran


Ajith Ramachandran  added the comment:

When I needed a function to find cube root, I couldn't find one in the math 
module. Also found the `cbrt()` function in C. I didn't account for the complex 
numbers. I didn't wanted to make it a complex function unnecessarily. So I used 
the `cbrt()` function directly and it was working well for my test cases. And 
it is supported by visual studio.

--

___
Python tracker 

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



[issue41165] [Python 3.10] Remove APIs deprecated long enough

2021-06-09 Thread Inada Naoki


Change by Inada Naoki :


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



[issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds

2021-06-09 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
nosy: +orsenthil

___
Python tracker 

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



[issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds

2021-06-09 Thread Mark Shannon


Change by Mark Shannon :


--
nosy: +Mark.Shannon
nosy_count: 9.0 -> 10.0
pull_requests: +25208
pull_request: https://github.com/python/cpython/pull/26623

___
Python tracker 

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



[issue44363] Likely false positive for address sanitizer after fork

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Buildbots have the priority, please don't merge anything that breaks the 
buildbots. We should figure out how to silence the false positive if indeed is 
one, but I don't think it is. The address sanitizer is not speculative, it 
literally checks if someone has written out of bounds

--

___
Python tracker 

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



[issue44355] Allow spaces in format strings

2021-06-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

See msg395383 for how it's an incompatible change even to .format().

In the 15 years since I implemented .format(), this is the first I've ever 
heard of someone being confused by adding extra spaces. I don't think it's 
worth changing this.

--

___
Python tracker 

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



[issue44360] test_compile segfault on AMD64 Ubuntu 3.x

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I don't think that's a segfault. That seems that the process was killed no? 
Also, the buildbot is green so this is not happening in the latest builds

--

___
Python tracker 

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



[issue44146] Format string fill not handling brace char

2021-06-09 Thread Martin Panter


Martin Panter  added the comment:

Another workaround:

>>> '{:{brace}>10d}'.format(5, brace='{')
'{5'

--
nosy: +martin.panter

___
Python tracker 

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



[issue44363] Likely false positive for address sanitizer after fork

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I can reproduce that failure of address sanitizer with GCC and clang 
separately, so it doesn't seem like a false positive.

--

___
Python tracker 

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



[issue44357] Add math.cbrt() function: Cube Root

2021-06-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am surprised that this was not proposed before. Perhaps because it is so easy 
to write x**(1/3), and if you want a real root of negative argument, it is 
-(-x)**(1/3). It can be slightly less accurate that the result of C library 
function cbrt(), but good enough for any practical applications.

Ajith, was you aware of x**(1/3)?

--

___
Python tracker 

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



[issue44363] Likely false positive for address sanitizer after fork

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Also, I can reproduce locally without any fork whatsoever:

./python -m test test_lib2to3

SUMMARY: AddressSanitizer: heap-buffer-overflow Python/ceval.c:3549 in 
_PyEval_EvalFrameDefault
Shadow bytes around the buggy address:
  0x0c1c8003ec40: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x0c1c8003ec50: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa
  0x0c1c8003ec60: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c1c8003ec70: 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa
  0x0c1c8003ec80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c1c8003ec90: 00 00 00 00 fa[fa]fa fa fa fa fa fa fd fd fd fd
  0x0c1c8003eca0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa
  0x0c1c8003ecb0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x0c1c8003ecc0: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa
  0x0c1c8003ecd0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c1c8003ece0: 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:   00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:   fa
  Freed heap region:   fd
  Stack left redzone:  f1
  Stack mid redzone:   f2
  Stack right redzone: f3
  Stack after return:  f5
  Stack use after scope:   f8
  Global redzone:  f9
  Global init order:   f6
  Poisoned by user:f7
  Container overflow:  fc
  Array cookie:ac
  Intra object redzone:bb
  ASan internal:   fe
  Left alloca redzone: ca
  Right alloca redzone:cb
  Shadow gap:  cc
==14183==ABORTING

--

___
Python tracker 

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



[issue44363] Likely false positive for address sanitizer after fork

2021-06-09 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

Even valgrind sees the problem:

❯ valgrind ./python -m test test_lib2to3
==27010== Memcheck, a memory error detector
==27010== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==27010== Using Valgrind-3.17.0 and LibVEX; rerun with -h for copyright info
==27010== Command: ./python -m test test_lib2to3
==27010==
0:00:00 load avg: 1.53 Run tests sequentially
0:00:00 load avg: 1.53 [1/1] test_lib2to3
==27010== Invalid read of size 8
==27010==at 0x2363E1: _PyEval_EvalFrameDefault (ceval.c:3549)
==27010==by 0x23B270: _PyEval_EvalFrame (pycore_ceval.h:46)
==27010==by 0x23B270: _PyEval_Vector (ceval.c:5174)
==27010==by 0x172498: _PyFunction_Vectorcall (call.c:342)
==27010==by 0x2278AF: _PyObject_VectorcallTstate (abstract.h:114)
==27010==by 0x22C88F: PyObject_Vectorcall (abstract.h:123)
==27010==by 0x22C88F: call_function (ceval.c:6001)
==27010==by 0x239642: _PyEval_EvalFrameDefault (ceval.c:4200)
==27010==by 0x23B270: _PyEval_EvalFrame (pycore_ceval.h:46)
==27010==by 0x23B270: _PyEval_Vector (ceval.c:5174)
==27010==by 0x172498: _PyFunction_Vectorcall (call.c:342)
==27010==by 0x2278AF: _PyObject_VectorcallTstate (abstract.h:114)
==27010==by 0x22C88F: PyObject_Vectorcall (abstract.h:123)
==27010==by 0x22C88F: call_function (ceval.c:6001)
==27010==by 0x239642: _PyEval_EvalFrameDefault (ceval.c:4200)
==27010==by 0x23B270: _PyEval_EvalFrame (pycore_ceval.h:46)
==27010==by 0x23B270: _PyEval_Vector (ceval.c:5174)
==27010==  Address 0x62c5e28 is 8 bytes after a block of size 160 alloc'd
==27010==at 0x483E7C5: malloc (vg_replace_malloc.c:380)
==27010==by 0x1B2911: _PyMem_RawMalloc (obmalloc.c:99)
==27010==by 0x1B4702: PyObject_Malloc (obmalloc.c:697)
==27010==by 0x1A1EF9: clone_combined_dict_keys (dictobject.c:678)
==27010==by 0x1A2216: dict_merge (dictobject.c:2453)
==27010==by 0x1A2A59: PyDict_Merge (dictobject.c:2603)
==27010==by 0x1A2AF1: dict_update_arg (dictobject.c:2273)
==27010==by 0x1A2D4E: dict_update_common (dictobject.c:2298)
==27010==by 0x1A2DD1: dict_update (dictobject.c:2316)
==27010==by 0x33FCBA: method_vectorcall_VARARGS_KEYWORDS (descrobject.c:346)
==27010==by 0x2278AF: _PyObject_VectorcallTstate (abstract.h:114)
==27010==by 0x22C88F: PyObject_Vectorcall (abstract.h:123)
==27010==by 0x22C88F: call_function (ceval.c:6001)
==27010==

--

___
Python tracker 

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



[issue44363] Likely false positive for address sanitizer after fork

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I'm closing this as 3 different tools complain about the same thing, with a 
very simple reproducer.

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



[issue44357] Add math.cbrt() function: Cube Root

2021-06-09 Thread Ajith Ramachandran


Ajith Ramachandran  added the comment:

Yes I was aware of x**(1/3) and used that. I just thought it would be useful if 
it was present in math module as it is also used in many situations like 
`sqrt()`.

--

___
Python tracker 

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



[issue44363] Likely false positive for address sanitizer after fork

2021-06-09 Thread Mark Shannon


Mark Shannon  added the comment:

If I run the following on main
./configure --with-address-sanitizer
make clean
make -j12 test

I get 22 failures.

So something is broken.

test_lib2to3 does fork; at least it does when I run it under gdb.

--

___
Python tracker 

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



[issue44357] Add math.cbrt() function: Cube Root

2021-06-09 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Perhaps because it is so easy to write x**(1/3), and if you want a real root 
> of negative argument, it is -(-x)**(1/3).

I consider `x**(1/3)` to be a trap and a bug magnet: many people won't realise 
that the correct spelling for their situation is actually `def f(x): return 
-((-x)**(1/3)) if x < 0 else x**(1/3)` and the failure mode of `x**(1/3)` for 
negative `x` seems suboptimal, in that it happily returns a complex number 
rather than raising a `ValueError` with a clear message indicating what was 
wrong. I've seen a good number of Stack Overflow questions from users confused 
about this exact thing.

And not only is that correct spelling unwieldy, but it _still_ doesn't do the 
right thing for `-0.0`, and if you care about getting that corner case right 
then the right spelling becomes even more unwieldy.

Of course, even with `math.cbrt` in the standard library people will still fall 
into the `x**(1/3)` trap, but at least we then have a decent replacement to 
point them to.

--

___
Python tracker 

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



[issue44357] Add math.cbrt() function: Cube Root

2021-06-09 Thread Mark Dickinson


Mark Dickinson  added the comment:

There's also a decent chance that a libm implementation of cbrt will be 
correctly rounded, while `x**(1/3)` is highly unlikely to be so.

--

___
Python tracker 

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



[issue44360] test_compile segfault on AMD64 Ubuntu 3.x

2021-06-09 Thread STINNER Victor


STINNER Victor  added the comment:

> I don't think that's a segfault. That seems that the process was killed no? 
> Also, the buildbot is green so this is not happening in the latest builds

* (1) 0:01:12, test_compile child process was killed by signal -9
* (2) 0:08:48, test_multiprocessing_forkserver child process was killed by 
signal -9
* (3) 0:27:56, test_compile main process was killed (unknown signal... I bet on 
signal -9, SIGSEGV)

Maybe it was a manual action, but it sounds like a strange coincidence that 3 
processes were killed in the same build, and it wasn't at the same time.

--

___
Python tracker 

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



[issue44206] Add a version number to dict keys.

2021-06-09 Thread Mark Shannon


Change by Mark Shannon :


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



[issue44357] Add math.cbrt() function: Cube Root

2021-06-09 Thread STINNER Victor


STINNER Victor  added the comment:

I didn't know the "cbrt" function name. It seems like it exists in the libc, 
but also in numpy. So it's a good idea to reuse this name ;-)

numpy.cbrt(): Return the cube-root of an array, element-wise.
https://numpy.org/doc/stable/reference/generated/numpy.cbrt.html

--
nosy: +vstinner

___
Python tracker 

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



[issue44357] Add math.cbrt() function: Cube Root

2021-06-09 Thread Mark Dickinson


Mark Dickinson  added the comment:

@Victor: Yep, the name is pretty standard. Not just C, but JavaScript, Java, R, 
and likely a lot of other languages that I haven't checked.

--

___
Python tracker 

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



[issue44187] Implement infrastructure for quickening and specializing

2021-06-09 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +25209
pull_request: https://github.com/python/cpython/pull/26624

___
Python tracker 

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



[issue44360] test_compile segfault on AMD64 Ubuntu 3.x

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

But SIGSEGV is signal 11, not -9

--

___
Python tracker 

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



[issue44363] Likely false positive for address sanitizer after fork

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

As I mentioned in https://bugs.python.org/issue43693, the way to run it is the 
following:

$ export ASAN_OPTIONS=detect_leaks=0:allocator_may_return_null=1:handle_segv=0
$ ./configure --with-address-sanitizer --without-pymalloc
$ make -j -s
$ ./python -m test test_lib2to3


There are known failures with things like ctypes and libcript so the following 
tests are ignored:

test_ctypes test_capi test_crypt test_decimal test_faulthandler 
test_interpreters

-

test_lib2to3 does one fork for this call:

https://github.com/python/cpython/blob/main/Lib/lib2to3/tests/test_parser.py#L64

but that doesn't matter. Comment that and keeps falining

--

___
Python tracker 

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



[issue44345] The first line (comment) of the parser.c is incorrect.

2021-06-09 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:


New changeset aef1b58dc8889e1bebaddf1e30f67b63a1b20f90 by Akira Nonaka in 
branch 'main':
bpo-44345: Fix 'generated by' comment in parser.c (GH-26615)
https://github.com/python/cpython/commit/aef1b58dc8889e1bebaddf1e30f67b63a1b20f90


--
nosy: +lys.nikolaou

___
Python tracker 

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



[issue44345] The first line (comment) of the parser.c is incorrect.

2021-06-09 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


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



[issue44360] test_compile segfault on AMD64 Ubuntu 3.x

2021-06-09 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Isn't this just an (explicit) SIGKILL? The _exit code_ seems to be -9, not the 
signal number.

--

___
Python tracker 

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



[issue44360] test_compile segfault on AMD64 Ubuntu 3.x

2021-06-09 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue44361] test_smtpnet failed with SMTPServerDisconnected on x86 Gentoo Non-Debug with X 3.10

2021-06-09 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Mark Shannon


Mark Shannon  added the comment:

I still get quite a few failures on the main branch.
It seems like ceval.c:1600 upsets the sanitizer, at least for gcc.

There isn't anything wrong with that line, but as I plan to change it anyway I 
guess it doesn't matter:
https://github.com/python/cpython/pull/26595

I plan to get the main branch passing the tests with address sanitization (at 
least on my machine with my gcc :)

Running the tests doesn't seem to take that long (at least not compared with 
refleak tests).
Do you think it would be it feasible to run the address sanitizer on all PRs, 
so that we can keep it passing?

--
title: Likely false positive for address sanitizer after fork -> Address 
sanitizer (gcc version) is generating false positives

___
Python tracker 

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



[issue44364] Add non integral tests for `sqrt()`

2021-06-09 Thread Ajith Ramachandran


Change by Ajith Ramachandran :


--
components: Tests
nosy: AjithRamachandran
priority: normal
severity: normal
status: open
title: Add non integral tests for `sqrt()`
type: enhancement
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



[issue44364] Add non integral tests for `sqrt()`

2021-06-09 Thread Ajith Ramachandran


Change by Ajith Ramachandran :


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

___
Python tracker 

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



[issue44365] Bad dataclass post-init example

2021-06-09 Thread Micael Jarniac


New submission from Micael Jarniac :

https://docs.python.org/3/library/dataclasses.html#post-init-processing

https://github.com/python/cpython/blob/3.9/Doc/library/dataclasses.rst#post-init-processing

In the example, a base class "Rectangle" is defined, and then a "Square" class 
inherits from it.

On reading the example, it seems like the Square class is meant to be used like:

>>> square = Square(5)

Since the Square class seems to be supposed to be a "shortcut" to creating a 
Rectangle with equal sides.

However, the Rectangle class has two required init arguments, and when Square 
inherits from it, those arguments are still required, so using Square like in 
the above example, with a single argument, results in an error:

>>> square = Square(5)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __init__() missing 2 required positional arguments: 'width' and 
'side'

To "properly" use the Square class, it'd need to be instantiated like so:

>>> square = Square(0, 0, 5)
>>> square
Square(height=5, width=5, side=5)

Which, in my opinion, is completely counter-intuitive, and basically 
invalidates this example.

--
assignee: docs@python
components: Documentation
messages: 395427
nosy: MicaelJarniac, docs@python
priority: normal
severity: normal
status: open
title: Bad dataclass post-init example
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Do you think it would be it feasible to run the address sanitizer on all PRs, 
> so that we can keep it passing?


That's a good idea,let me see how easy doing that would be

--

___
Python tracker 

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



[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

> It seems like ceval.c:1600 upsets the sanitizer, at least for gcc.

Even if you don't trust the sanitizer, you can also use valgrind, it shows the 
same error:

❯ valgrind ./python -m test test_lib2to3
==27010== Memcheck, a memory error detector
==27010== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==27010== Using Valgrind-3.17.0 and LibVEX; rerun with -h for copyright info
==27010== Command: ./python -m test test_lib2to3
==27010==
0:00:00 load avg: 1.53 Run tests sequentially
0:00:00 load avg: 1.53 [1/1] test_lib2to3
==27010== Invalid read of size 8
==27010==at 0x2363E1: _PyEval_EvalFrameDefault (ceval.c:3549)
==27010==by 0x23B270: _PyEval_EvalFrame (pycore_ceval.h:46)

For running valgrind, make sure do disable pymalloc:

export PYTHONMALLOC=malloc

--

___
Python tracker 

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



[issue44365] Bad dataclass post-init example

2021-06-09 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +eric.smith

___
Python tracker 

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



[issue44357] Add math.cbrt() function: Cube Root

2021-06-09 Thread Mark Dickinson


Mark Dickinson  added the comment:

If we *really* wanted to bikeshed on the name, back in 1991 Kahan wrote:

> Perhaps the last problem is the hardest: choosing the program's name. Ideally 
> it should need no explanation, but a limitation upon its length may preclude 
> that. Although "CBRT" has seen use, I prefer "QBRT" in order that the prefix 
> "C" may be reserved for use with complex-valued functions.

Source: https://csclub.uwaterloo.ca/~pbarfuss/qbrt.pdf

But that was 30 years ago, and I think the "CBRT"-shaped ship has long since 
sailed.

--

___
Python tracker 

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



[issue44364] Add non integral tests for `sqrt()`

2021-06-09 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue44242] enum.IntFlag regression: missing values cause TypeError

2021-06-09 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset eea8148b7dff5ffc7b84433859ac819b1d92a74d by Ethan Furman in 
branch 'main':
bpo-44242: [Enum] remove missing bits test from Flag creation (GH-26586)
https://github.com/python/cpython/commit/eea8148b7dff5ffc7b84433859ac819b1d92a74d


--

___
Python tracker 

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



[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

This is not a false positive. I break into gdb at the moment the sanitizer 
makes the report and inspecting the values that apparently are wrong. I did 
that by breaking into __sanitizer::ColorizeReports which is called for making 
the report. THis is what I did:

$export CFLAGS='-g3 -O0'
$export ASAN_OPTIONS=detect_leaks=0:allocator_may_return_null=1:handle_segv=0
$./configure --with-address-sanitizer --without-pymalloc
$make -j -s
$gdb --args ./python -m test test_lib2to3 -v -m test_prefix_preservation
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
== CPython 3.11.0a0 (heads/specialize-load-attr-dirty:e858ea1571, Jun 9 2021, 
17:34:14) [GCC 11.1.0]
[Detaching after vfork from child process 18105]
== Linux-5.12.9-arch1-1-x86_64-with-glibc2.33 little-endian
== cwd: /home/pablogsal/github/python/master/build/test_python_18103æ
== CPU count: 36
== encodings: locale=UTF-8, FS=utf-8
0:00:00 load avg: 1.64 Run tests sequentially
0:00:00 load avg: 1.64 [1/1] test_lib2to3
test_prefix_preservation (lib2to3.tests.test_fixers.Test_dict) ... ok
test_prefix_preservation (lib2to3.tests.test_fixers.Test_except) ... 
=

Breakpoint 1, __sanitizer::ColorizeReports ()
at 
/build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_symbolizer_report.cpp:62
62  
/build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_symbolizer_report.cpp:
 No such file or directory.
(gdb) up
#1  0x775f6af1 in 
__sanitizer::SanitizerCommonDecorator::SanitizerCommonDecorator 
(this=)
at 
/build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_report_decorator.h:26
26  
/build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_report_decorator.h: 
No such file or directory.
(gdb)
#2  __asan::Decorator::Decorator (this=) at 
/build/gcc/src/gcc/libsanitizer/asan/asan_descriptions.h:45
45  /build/gcc/src/gcc/libsanitizer/asan/asan_descriptions.h: No such file 
or directory.
(gdb)
#3  __asan::ErrorGeneric::Print (this=this@entry=0x77710908 
<__asan::ScopedInErrorReport::current_error_+8>)
at /build/gcc/src/gcc/libsanitizer/asan/asan_errors.cpp:574
574 /build/gcc/src/gcc/libsanitizer/asan/asan_errors.cpp: No such file or 
directory.
(gdb)
#4  0x7768531e in __asan::ErrorDescription::Print (
this=this@entry=0x77710900 
<__asan::ScopedInErrorReport::current_error_>)
at /build/gcc/src/gcc/libsanitizer/asan/asan_errors.h:440
440 /build/gcc/src/gcc/libsanitizer/asan/asan_errors.h: No such file or 
directory.
(gdb)
#5  0x77685528 in __asan::ScopedInErrorReport::~ScopedInErrorReport 
(this=0x7ffd12e6,
__in_chrg=) at 
/build/gcc/src/gcc/libsanitizer/asan/asan_report.cpp:141
141 /build/gcc/src/gcc/libsanitizer/asan/asan_report.cpp: No such file or 
directory.
(gdb)
#6  0x77684d8d in __asan::ReportGenericError (pc=93824995352503, 
bp=bp@entry=140737488166752,
sp=sp@entry=140737488166736, addr=106515189666344, 
is_write=is_write@entry=false, access_size=access_size@entry=8,
exp=0, fatal=true) at 
/build/gcc/src/gcc/libsanitizer/asan/asan_report.cpp:478
478 in /build/gcc/src/gcc/libsanitizer/asan/asan_report.cpp
(gdb)
#7  0x77685c1c in __asan::__asan_report_load8 (addr=)
at /build/gcc/src/gcc/libsanitizer/asan/asan_rtl.cpp:121
121 /build/gcc/src/gcc/libsanitizer/asan/asan_rtl.cpp: No such file or 
directory.
(gdb)
#8  0x5584dfb7 in _PyEval_EvalFrameDefault (tstate=0x61200040, 
f=0x608b08b0, throwflag=0)
at Python/ceval.c:3549
3549DEOPT_IF(ep->me_key != name, LOAD_ATTR);
(gdb) p ep->me_key
$3 = (PyObject *) 0x60eb1250
(gdb) p ep->me_key->ob_refcnt
$4 = 652835033347

That ep->me_key is obviously corrupted.

--

___
Python tracker 

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



[issue44356] Abstract enum mixins not allowed

2021-06-09 Thread Jordan Ephron

Jordan Ephron  added the comment:

> But what is an `UnexpectedString()`

Sorry, that’s maybe less relevant to the example. It’s just a subclass of 
string with some marker to make it detectable later on, similar to schemes that 
taint user input to prevent sql injection or whatever

> On Jun 8, 2021, at 23:20, Ethan Furman  wrote:
> 
> 
> Ethan Furman  added the comment:
> 
> Excellent bug report.
> 
> But what is an `UnexpectedString()` ?
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Mark Shannon


Mark Shannon  added the comment:

What commit are you running that on?

--

___
Python tracker 

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



[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

commit e858ea15718709bc8ec3c13bd8451ff7d62cbe80 (HEAD -> specialize-load-attr)
Author: Mark Shannon 
Date:   Wed Jun 9 09:33:13 2021 +0100

Assert that address is in bounds (ASAN thinks it might not be).

diff --git a/Python/ceval.c b/Python/ceval.c
index 06a02b40f9..784d0244e8 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3517,6 +3517,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, 
PyFrameObject *f, int throwflag)
 DEOPT_IF(!PyModule_CheckExact(owner), LOAD_ATTR);
 PyDictObject *dict = (PyDictObject *)((PyModuleObject 
*)owner)->md_dict;
 DEOPT_IF(dict->ma_keys->dk_version != cache1->dk_version_or_hint, 
LOAD_ATTR);
+assert(cache0->index < dict->ma_keys->dk_nentries);
 PyDictKeyEntry *ep = DK_ENTRIES(dict->ma_keys) + cache0->index;
 res = ep->me_value;
 DEOPT_IF(res == NULL, LOAD_ATTR);

--

___
Python tracker 

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



[issue44366] Define functions without parentheses (if no parameters given)

2021-06-09 Thread Boštjan Mejak

New submission from Boštjan Mejak :

The syntax to define a class looks like this:

class MyClass:
pass

Nice and neat.

***
And the syntax to define a function looks like this:

def my_function():
pass

Hmmm...

***
What if we could define functions (that don't have any parameters) like this:

def my_function:
pass

***
Is that a possible scenario at this point, or even desirable?

--
components: Interpreter Core
messages: 395436
nosy: PedanticHacker
priority: normal
severity: normal
status: open
title: Define functions without parentheses (if no parameters given)
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



[issue44367] Python Code for WebView2 Exe Testing

2021-06-09 Thread Bhavna Sewani


New submission from Bhavna Sewani :

I have an application developed using webview2.
It is a web application that would be driven by Microsoft Edge(Chromium). It 
would give a feel of Native/Desktop app
instead of web app to the end user.

I want to automate testing for this app using Python/Robot framework. 
I found an documentation which uses Dotnet, Selenium and Edge drivers for 
testing it.

https://docs.microsoft.com/en-us/microsoft-edge/webview2/how-to/webdriver

Can someone help how can we write below code in Python and Robot to test the 
same using Selenium Library:

static void Main(string[] args)
{

EdgeOptions edgeOptions = new EdgeOptions(false, "webview2");
edgeOptions.BinaryLocation = @"C:\path\to\your\webview2\project.exe";
string msedgedriverDir = @"C:\path\to\your\msededriver.exe's\directory";
string msedgedriverExe = @"msedgedriver.exe";
EdgeDriverService service = 
EdgeDriverService.CreateDefaultService(msedgedriverDir, msedgedriverExe, false);

EdgeDriver e = new EdgeDriver(service, edgeOptions);
e.Url = @"https://www.microsoft.com";; //myexe or webpage path
e.Quit();
}

--
components: Library (Lib)
messages: 395437
nosy: bhavna.sewani, gvanrossum, ncoghlan
priority: normal
severity: normal
status: open
title: Python Code for WebView2 Exe Testing
versions: Python 3.7

___
Python tracker 

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



[issue44358] AMD64 RHEL8 LTO + PGO 3.x build failed with: /usr/bin/ld: Dwarf Error: Offset (2487097600) greater than or equal to .debug_str size (571933).

2021-06-09 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue44366] Define functions without parentheses (if no parameters given)

2021-06-09 Thread Irit Katriel


Irit Katriel  added the comment:

The python-ideas mailing list is a better place for such questions than the bug 
tracker.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue44283] Add jump table for certain safe match-case statements

2021-06-09 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Mark Shannon


Mark Shannon  added the comment:

This line seems to be responsible for most of the failures:
https://github.com/python/cpython/blob/main/Objects/frameobject.c#L985

Which does appear to be a true positive.

--

___
Python tracker 

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



[issue44366] Define functions without parentheses (if no parameters given)

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Closing as this would obviously need a PEP, please open a discusion first on 
python-ideas

--
nosy: +pablogsal
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue44360] test_compile segfault on AMD64 Ubuntu 3.x

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I am quite sure this is not a segmentation fault, Victor.

--

___
Python tracker 

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



[issue44360] test_compile segfault on AMD64 Ubuntu 3.x

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

We'll wait for more builds, but for now the buildbot is green so I think this 
should be closed and reopened if we see it again.

--

___
Python tracker 

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



[issue44187] Implement infrastructure for quickening and specializing

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Is anything left in this issue?

--
nosy: +pablogsal

___
Python tracker 

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



[issue44187] Implement infrastructure for quickening and specializing

2021-06-09 Thread Mark Shannon


Mark Shannon  added the comment:

No, this is done

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-09 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +25212
pull_request: https://github.com/python/cpython/pull/26626

___
Python tracker 

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



[issue44367] Python Code for WebView2 Exe Testing

2021-06-09 Thread Guido van Rossum


Guido van Rossum  added the comment:

Sorry, this tracker is not for getting help, only for submitting changes to 
Python itself.

Try https://discuss.python.org/c/users/7 instead.

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

___
Python tracker 

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



[issue44356] Abstract enum mixins not allowed

2021-06-09 Thread Jordan Ephron


Jordan Ephron  added the comment:

Oh, on further investigation I see that the example wouldn't have worked on 3.8 
anyway, due to issue34536 adding some checks to the type returned by _missing_, 
so maybe I'm pushing Enum too far in that case.

--

___
Python tracker 

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



[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

>From the gdb session looks to me that you are reading freed or invalid memory 
>from the dictionary keys. Well, I'm quite sure you are doing that, but I don't 
>know why they is happening.

--

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-09 Thread Eric Snow


Eric Snow  added the comment:


New changeset e6e34e45222b9c7a63ba92386612acf768082ba0 by Eric Snow in branch 
'main':
bpo-43693: Do not check co_cell2arg if a non-cell offset. (gh-26626)
https://github.com/python/cpython/commit/e6e34e45222b9c7a63ba92386612acf768082ba0


--

___
Python tracker 

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



[issue44365] Bad dataclass post-init example

2021-06-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Agreed that that's not a good (or even workable) example. Thanks for pointing 
it out.

I'll come up with something better.

--
assignee: docs@python -> eric.smith
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



[issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds

2021-06-09 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +25213
pull_request: https://github.com/python/cpython/pull/26627

___
Python tracker 

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



[issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds

2021-06-09 Thread Ken Jin


Ken Jin  added the comment:

@Steve thanks for the info,

> This is already what we do, so if someone has increased stack usage, they 
> should also decrease the value here.

I see the recursion limit set in _PyEval_InitState but I don't see any special 
settings for windows. Is it somewhere else or am I missing something here :( ?

BTW, I'm thinking about changing the CI checks for windows to test on debug 
builds. I find it strange that the macOS and ubuntu CIs test on debug builds 
while windows seemingly doesn't[1]. If we change it, similar errors may be 
caught earlier at the PR stage rather than when it's committed and causes the 
buildbots to fail. What do you think?

[1] https://github.com/python/cpython/blob/main/.github/workflows/build.yml#L95

--

___
Python tracker 

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



[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Eric Snow


Eric Snow  added the comment:

This was my bad.  I only partially fixed original problem when un-reverting 
3fa63e in gh-26609.  I've merged the rest of the fix in gh-26626.  Sorry about 
that.

--
nosy: +eric.snow

___
Python tracker 

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



[issue44347] Unclear documentation for shutil.copytree()

2021-06-09 Thread Irit Katriel


Irit Katriel  added the comment:

>From the code, this arg is simply passed to os.mkdirs() here:
https://github.com/python/cpython/blob/e6e34e45222b9c7a63ba92386612acf768082ba0/Lib/shutil.py#L450

os.mkdir is documented here: 
https://docs.python.org/3/library/os.html#os.makedirs

and says just "If exist_ok is False (the default), an FileExistsError is raised 
if the target directory already exists."

So I agree that the sentence you highlighted can be improved.

Would you like to submit a patch?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue44347] Unclear documentation for shutil.copytree()

2021-06-09 Thread Irit Katriel


Change by Irit Katriel :


--
components: +Library (Lib)
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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Brandt Bucher


New submission from Brandt Bucher :

Here are a few that I found. Not sure when they were introduced:

match ...:
case {**rest, "key": value}:
pass

match ...:
case {"first": first, **rest, "last": last}:
pass

match ...:
case {**_}:
pass

These all give the following error while parsing the second line:

  File "", line 1
match ...:
^
SyntaxError: invalid syntax. Perhaps you forgot a comma?

--
components: Parser
messages: 395453
nosy: brandtbucher, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Invalid mapping patterns give confusing SyntaxErrors
type: behavior
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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Brandt Bucher


Brandt Bucher  added the comment:

Perhaps we need something like invalid_mapping_pattern or 
invalid_mapping_pattern_double_star rules?

--

___
Python tracker 

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



[issue44360] test_compile killed by SIGKILL on AMD64 Ubuntu 3.x

2021-06-09 Thread STINNER Victor


STINNER Victor  added the comment:

Oh right, exit code -9 means killed by SIGKILL, it doesn't not mean killed 
SIGSEGV. Sorry about the confusion.

How can a signal be killed by SIGKILL? Can it be related to Linux OOM Killer?

Senthil: Would you mind to have a look at the server logs to see if you see 
anything suspicious?

--
nosy: +orsenthil
title: test_compile segfault on AMD64 Ubuntu 3.x -> test_compile killed by 
SIGKILL on AMD64 Ubuntu 3.x

___
Python tracker 

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



  1   2   >