[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-13 Thread Hai Shi


Hai Shi  added the comment:

> The only thing the proposed PR adds is a way to set ht_module, which actually 
> isn't very useful (it's used for module state access.

Hm, there have some static types. so I create the 
PyStructSequence_FromModuleAndDes() could receive tp_flags and try convert 
those static types to the heap type. eg: 
https://github.com/python/cpython/blob/main/Python/sysmodule.c#L2837-L2839
We can not do this converting operation by calling PyStructSequence_NewType(), 
no?

This is my *reason* to create PR-28573 :)

--

___
Python tracker 

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



[issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch

2021-10-13 Thread Ned Deily


Ned Deily  added the comment:

> The point I was trying to make is that clang 13 generically implemented 
> --print-multiarch and the triple logic in configure related to MULTIARCH 
> applies to all platforms, not just macOS.

If there are still issues on other supported platforms, PRs are welcome.

--

___
Python tracker 

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



[issue45456] operator 'pass' in 'if-else' linear expression

2021-10-13 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Evgeniy, please leave this closed and take the proposal to the python-ideas 
mailing list.   There is no further progress that can be made in this tracker 
issue.  We can’t discern any part of your proposal that would make sense for 
improving the language.

--
nosy: +rhettinger
status: open -> closed

___
Python tracker 

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



[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-13 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I am going to call the file util.py and will work on a PR.

--

___
Python tracker 

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



[issue45456] operator 'pass' in 'if-else' linear expression

2021-10-13 Thread Evgeniy Ivanov


Evgeniy Ivanov  added the comment:

What about this?

if x > 2: my_func(x)

ok this code at 1 line, this code work, but...

PEP 8: E701 multiple statements on one line (colon)


Well f//k it with a pass
Why not add an empty action operator? What is the problem? Such an instruction 
has existed since the days of assembler - nop

--
status: closed -> open

___
Python tracker 

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



[issue40413] Py_RunMain() crashes on subsequence call

2021-10-13 Thread Gregory Szorc


Gregory Szorc  added the comment:

I can't remember the circumstances of me reproducing this. The added test 
demonstrating that the interpreter can be initialized/finalized within a single 
process seems like a reasonable solution to ensure this is supported.

--

___
Python tracker 

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



[issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch

2021-10-13 Thread Gregory Szorc


Gregory Szorc  added the comment:

> Can you be more specific? This particular issue isn't about cross-compiling.

The point I was trying to make is that clang 13 generically implemented 
--print-multiarch and the triple logic in configure related to MULTIARCH 
applies to all platforms, not just macOS.

I was able to perturb this same error on Linux with an x86_64 Clang 13 with 
configure options --build=x86_64-unknown-linux-gnu 
--host=i686-unknown-linux-gnu. 
https://github.com/indygreg/python-build-standalone/runs/3853832124?check_suite_focus=true
 should work if you are logged into GitHub. Not the exact same failure, but 
related since it involves --print-multiarch suddenly working.

--

___
Python tracker 

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



[issue45444] test.test_concurrent_futures fail in x86_ 64 architecture

2021-10-13 Thread tongxiaoge


tongxiaoge  added the comment:

I reproduced the same problem in Python 3-3.11.0a1 and increased two failure 
test cases: test_ exceptions and test_ Tools, detailed log is as follows:

[ 1937s] 0:27:53 load avg: 5.11 running: test_capi (27 min 51 sec)
[ 1966s] 0:28:23 load avg: 5.03 [423/423/3] test_capi passed (28 min 19 sec)
[ 1966s]
[ 1966s] == Tests result: FAILURE ==
[ 1966s]
[ 1966s] 401 tests OK.
[ 1966s]
[ 1966s] 10 slowest tests:
[ 1966s] - test_capi: 28 min 19 sec
[ 1966s] - test_faulthandler: 21 min 7 sec
[ 1966s] - test_concurrent_futures: 18 min 53 sec
[ 1966s] - test_io: 3 min 23 sec
[ 1966s] - test_peg_generator: 3 min 5 sec
[ 1966s] - test_subprocess: 2 min 49 sec
[ 1966s] - test_multiprocessing_spawn: 2 min 36 sec
[ 1966s] - test_audit: 2 min 15 sec
[ 1966s] - test_multiprocessing_forkserver: 1 min 43 sec
[ 1966s] - test_regrtest: 1 min 42 sec
[ 1966s]
[ 1966s] 3 tests failed:
[ 1966s] test_concurrent_futures test_exceptions test_tools
[ 1966s]
[ 1966s] 19 tests skipped:
[ 1966s] test_curses test_devpoll test_ioctl test_kqueue test_msilib
[ 1966s] test_ossaudiodev test_smtpnet test_socketserver test_startfile
[ 1966s] test_tix test_tk test_ttk_guionly test_urllib2net test_urllibnet
[ 1966s] test_winconsoleio test_winreg test_winsound test_xmlrpc_net
[ 1966s] test_zipfile64
[ 1966s] 0:28:23 load avg: 5.03
[ 1966s] 0:28:23 load avg: 5.03 Re-running failed tests in verbose mode
[ 1966s] 0:28:23 load avg: 5.03 Re-running test_exceptions in verbose mode 
(matching: test_name_error_suggestions_do_not_trigger_for_too_many_locals)
[ 1966s] test_name_error_suggestions_do_not_trigger_for_too_many_locals 
(test.test_exceptions.NameErrorTests) ... test test_exceptions failed
[ 1966s] FAIL
[ 1966s]
[ 1966s] ==
[ 1966s] FAIL: test_name_error_suggestions_do_not_trigger_for_too_many_locals 
(test.test_exceptions.NameErrorTests)
[ 1966s] --
[ 1966s] Traceback (most recent call last):
[ 1966s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.11.0a1/Lib/test/test_exceptions.py", line 
1843, in test_name_error_suggestions_do_not_trigger_for_too_many_locals
[ 1966s] self.assertNotIn("a1", err.getvalue())
[ 1966s] ^^
[ 1966s] AssertionError: 'a1' unexpectedly found in 'Traceback (most recent 
call last):\n  File 
"/home/abuild/rpmbuild/BUILD/Python-3.11.0a1/Lib/test/test_exceptions.py", line 
1838, in test_name_error_suggestions_do_not_trigger_for_too_many_locals\n
f()\n^^^\n  File 
"/home/abuild/rpmbuild/BUILD/Python-3.11.0a1/Lib/test/test_exceptions.py", line 
1835, in f\nprint(a0)\n  ^^\nNameError: name \'a0\' is not 
defined\n'
[ 1966s]
[ 1966s] --
[ 1966s] Ran 1 test in 0.004s
[ 1966s]
[ 1966s] FAILED (failures=1)
[ 1966s] 0:28:23 load avg: 5.03 Re-running test_tools in verbose mode 
(matching: test_sundry)
[ 1966s] test_analyze_dxp_import 
(test.test_tools.test_sundry.TestSundryScripts) ... ok
[ 1966s] test_sundry (test.test_tools.test_sundry.TestSundryScripts) ... ERROR
[ 1966s] test_sundry_windows (test.test_tools.test_sundry.TestSundryScripts) 
... test test_tools failed
[ 1966s] skipped 'Windows-only test'
[ 1966s]
[ 1966s] ==
[ 1966s] ERROR: test_sundry (test.test_tools.test_sundry.TestSundryScripts)
[ 1966s] --
[ 1966s] Traceback (most recent call last):
[ 1966s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.11.0a1/Lib/test/test_tools/test_sundry.py",
 line 43, in test_sundry
[ 1966s] import_tool(name)
[ 1966s] ^
[ 1966s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.11.0a1/Lib/test/test_tools/__init__.py", 
line 35, in import_tool
[ 1966s] return importlib.import_module(toolname)
[ 1966s]^
[ 1966s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.11.0a1/Lib/importlib/__init__.py", line 
126, in import_module
[ 1966s] return _bootstrap._gcd_import(name[level:], package, level)
[ 1966s]
[ 1966s]   File "", line 1072, in _gcd_import
[ 1966s]   File "", line 1044, in _find_and_load
[ 1966s]   File "", line 1015, in 
_find_and_load_unlocked
[ 1966s]   File "", line 689, in _load_unlocked
[ 1966s]   File "", line 894, in 
exec_module
[ 1966s]   File "", line 241, in 
_call_with_frames_removed
[ 1966s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.11.0a1/Tools/scripts/freeze_modules.py", 
line 37, in 
[ 1966s] sys.exit("ERROR: missing _freeze_module")
[ 1966s] ^
[ 1966s] SystemExit: ERROR: missing _freeze_module
[ 1966s]
[ 1966s] --
[ 

Re: Selenium py3.8+ DepreciationWarnings - where to find doc to update code?

2021-10-13 Thread Tony Oliver


On Wednesday, 13 October 2021 at 16:16:46 UTC+1, jkk wrote:
> Selenium 3.141+ 
> python 3.8+ 
> ubuntu 20.04 or windows 10 
> 
> I'm trying to upgrade code from py3.6+ to py3.8+ and I'm getting several 
> DepreciationWarnings. 
> 
> Can someone point me to where I can find the documentation that explains how 
> to to remedy these warnings. What are the new preferred coding practices? 
> 
> For example, here is a "DepreciationWarning" that I figured out: 
> 
> py3.6+ 
> from selenium import webdriver 
> browser = browser = webdriver.Firefox() 
> browser.get(url) 
> tables = browser.find_elements_by_tag_name("table") 
> 
> 
> py3.8+ 
> from selenium import webdriver 
> from selenium.webdriver.common.by import By 
> browser = browser = webdriver.Firefox() 
> browser.get(url) 
> tables = browser.find_elements(By.TAG_NAME, "table") 
> or 
> tables = browser.find_elements(By.XPATH, "//table")

I cannot help you with your immediate problem but am intrigued to discover what 
your “browser = browser = “ idiom does that differs from “browser = 
“.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: spyder does not work under root! [linux]

2021-10-13 Thread Michael Torrie
On 10/13/21 12:09 PM, Paulo da Silva wrote:
> spyder and eric are both python editors/debuggers! Why are they related
> with web browsers?!

Good point. I was going off of the chromium bug report. My bad.  I
mistook Spyder for Selenium, which is a web scraping scripting engine
that does use a real browser.  Oops.

However, for better or worse, browser engines power all kinds of apps
these days, including IDEs. I do not know if Spyder is powered by
Chromium or not.  VS Code, for example,  is powered by a web browser engine.

As to Eric and Qt, I can't speak to that.


-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed

2021-10-13 Thread Jack Wong


Change by Jack Wong :


--
nosy: +iforapsy

___
Python tracker 

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



[issue45465] logging messages are needlessly reformatted for every handler

2021-10-13 Thread Роман Донченко

New submission from Роман Донченко :

Consider this code:

```
import logging

class MyLogRecord(logging.LogRecord):
def getMessage(self):
print("Help! I am being formatted!")
return super().getMessage()

logging.setLogRecordFactory(MyLogRecord)

logger = logging.getLogger("test")
logger.addHandler(logging.StreamHandler())
logger.addHandler(logging.StreamHandler())

logger.error("%d", 123)
```

Its output is:

```
Help! I am being formatted!
123
Help! I am being formatted!
123
```

In other words, the record's `getMessage` method is called once for every 
handler. That seems quite unnecessary, especially since the formatted message 
is saved in the `message` field of the record by `Formatter.format`. 
`Formatter` could check whether the message has already been formatted, and if 
so, use the saved message.

--
components: Library (Lib)
messages: 403879
nosy: SpecLad
priority: normal
severity: normal
status: open
title: logging messages are needlessly reformatted for every handler
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



[issue45439] [C API] Move usage of tp_vectorcall_offset from public headers to the internal C API

2021-10-13 Thread STINNER Victor


STINNER Victor  added the comment:

Using LTO, the PR 28893 *increases* the stack memory usage. It's the opposite 
:-)


PyObject_CallOneArg(): 672 bytes/call => 688 bytes/call (+16 bytes)
PyObject_CallNoArg(): 640 bytes/call => 672 bytes/call (+32 bytes)
_PyObject_CallNoArg(): 640 bytes/call => 672 bytes/call (+32 bytes)


clang with LTO:

./configure --with-lto CC=clang LD=lld LDFLAGS="-fuse-ld=lld"
make

=== ref ===

$ ./python stack_overflow-4.py
test_python_call: 9187 calls before crash, stack: 912 bytes/call
test_python_getitem: 15868 calls before crash, stack: 528 bytes/call
test_python_iterator: 11901 calls before crash, stack: 704 bytes/call
test_callonearg: 12468 calls before crash, stack: 672 bytes/call
test_callnoargs: 13091 calls before crash, stack: 640 bytes/call
test_callnoargs_inline: 13092 calls before crash, stack: 640 bytes/call

=> total: 75607 calls, 4096 bytes

=== PR ===

$ ./python stack_overflow-4.py
test_python_call: 9186 calls before crash, stack: 912 bytes/call
test_python_getitem: 15400 calls before crash, stack: 544 bytes/call
test_python_iterator: 11384 calls before crash, stack: 736 bytes/call
test_callonearg: 12177 calls before crash, stack: 688 bytes/call
test_callnoargs: 12468 calls before crash, stack: 672 bytes/call
test_callnoargs_inline: 12467 calls before crash, stack: 672 bytes/call

=> total: 73082 calls, 4224 bytes

--

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-10-13 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +27229
pull_request: https://github.com/python/cpython/pull/28940

___
Python tracker 

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



[issue45439] [C API] Move usage of tp_vectorcall_offset from public headers to the internal C API

2021-10-13 Thread STINNER Victor


STINNER Victor  added the comment:

I measured the stack consumption using attached sys_call.patch and 
stack_overflow-4.py.

Using gcc -O3, the stack consumption with PR 28893 is *way better* on the 6 
benchmarks (6 ways to call functions), especially:

PyObject_CallOneArg(): 624 bytes/call => 528 bytes/call (-96 bytes)
PyObject_CallNoArg(): 608 bytes/call => 512 bytes/call (-96 bytes)
_PyObject_CallNoArg(): 608 bytes/call => 512 bytes/call (-96 bytes)


Python built in release mode with gcc -O3:

   ./configure && make

=== ref ===

$ ./python stack_overflow-4.py
test_python_call: 10070 calls before crash, stack: 832 bytes/call
test_python_getitem: 16894 calls before crash, stack: 496 bytes/call
test_python_iterator: 12773 calls before crash, stack: 656 bytes/call
test_callonearg: 13428 calls before crash, stack: 624 bytes/call
test_callnoargs: 13779 calls before crash, stack: 608 bytes/call
test_callnoargs_inline: 13782 calls before crash, stack: 608 bytes/call

=> total: 80726 calls, 3824 bytes


=== PR ===

$ ./python stack_overflow-4.py
test_python_call: 11901 calls before crash, stack: 704 bytes/call
test_python_getitem: 18703 calls before crash, stack: 448 bytes/call
test_python_iterator: 14961 calls before crash, stack: 560 bytes/call
test_callonearg: 15868 calls before crash, stack: 528 bytes/call
test_callnoargs: 16366 calls before crash, stack: 512 bytes/call
test_callnoargs_inline: 16365 calls before crash, stack: 512 bytes/call

=> total: 94164 calls, 3264 bytes

--
Added file: https://bugs.python.org/file50356/stack_overflow-4.py

___
Python tracker 

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



[issue45439] [C API] Move usage of tp_vectorcall_offset from public headers to the internal C API

2021-10-13 Thread STINNER Victor


Change by STINNER Victor :


Added file: https://bugs.python.org/file50355/sys_call.patch

___
Python tracker 

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



[issue30528] ipaddress.IPv{4,6}Network.reverse_pointer is broken

2021-10-13 Thread Foster Snowhill


Change by Foster Snowhill :


--
nosy: +forst

___
Python tracker 

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



[issue44559] Enum: revert to 3.9

2021-10-13 Thread Ethan Furman


Ethan Furman  added the comment:

Going back through the various bug fixes that got cut from 3.10 to re-add to 
3.10.1.

--

___
Python tracker 

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



[issue42248] Raised exception in Enum keeping user objects alive unnecessarily

2021-10-13 Thread Ethan Furman


Ethan Furman  added the comment:

Going back through the various bug fixes that got cut from 3.10 to re-add to 
3.10.1.

--

___
Python tracker 

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



[issue45461] UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 8191: \ at end of string

2021-10-13 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue45440] [C API] Py_IS_INFINITY() macro doesn't work in the limited C API if isinf() is not defined

2021-10-13 Thread STINNER Victor


STINNER Victor  added the comment:

> [C API] Py_IS_INFINITY() macro doesn't work in the limited C API if isinf() 
> is not defined

Well, the final fix is to remove the code path when isinf() is not available 
and require it to build Python ;-)

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



[issue45440] [C API] Py_IS_INFINITY() macro doesn't work in the limited C API if isinf() is not defined

2021-10-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 194a9526d8ee6abbbe58ef48520ec87a7e83f327 by Victor Stinner in 
branch 'main':
bpo-45440: Require math.h isinf() to build (GH-28894)
https://github.com/python/cpython/commit/194a9526d8ee6abbbe58ef48520ec87a7e83f327


--

___
Python tracker 

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



Re: spyder does not work under root! [linux]

2021-10-13 Thread Peter J. Holzer
On 2021-10-13 19:09:43 +0100, Paulo da Silva wrote:
> Às 02:08 de 12/10/21, Michael Torrie escreveu:
> > On 10/8/21 4:32 PM, Paulo da Silva wrote:
> >> Às 22:56 de 08/10/21, Paulo da Silva escreveu:
> >>> I need to debug a python3 script under root. I tried spyder but it does
> >>> not work.
> >>>
> >>> Running as root without --no-sandbox is not supported. See
> >>> https://crbug.com/638180.
> >>>
> >>> Thanks for any comments including alternative solutions to debug as root.
> >>>
> >> I also tried with eric and curiously it gave the same message!!
> >>
> >> This seems crazy.
> > 
> > Not so crazy. It's incredibly dangerous to run a web browser as root.

Mostly because a web browser is usually used to interpret untrusted
content from other sites ...

> > There's no reason I can think of for running a python script driving
> > a web browser as root.

... but this doesn't apply if the browser is just a display for a
locally running script. The script is already running as root. It can do
all the evil stuff without the help of a browser.

> spyder and eric are both python editors/debuggers! Why are they
> related with web browsers?!

They probably use a browser engine to implement the GUI. This isn't
uncommon. See Electron (https://www.electronjs.org/) for example. 

I didn't see anything on the Spyder website about how it is implemented
(I didn't look very hard) but the error message hints that there's a
Chromium hidden somewhere. And Eric uses Qt5, and Chromium is derived
from WebKit which is Qt's browser engine. It's a bit weird that this
also refers to Chromium's bug tracker and not Qt's, but there's
certainly a common ancestry here.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24444] In argparse empty choices cannot be printed in the help

2021-10-13 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks, Andrei! ✨  ✨

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

___
Python tracker 

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



[issue24444] In argparse empty choices cannot be printed in the help

2021-10-13 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset fb7203453855a43907048ff2b8f9b890305b3d15 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-2: fix an error in argparse help when help for an option is blank 
(GH-28050) (GH-28932)
https://github.com/python/cpython/commit/fb7203453855a43907048ff2b8f9b890305b3d15


--

___
Python tracker 

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



[issue45464] TypeError when inheriting from both OSError and AttributeError

2021-10-13 Thread Marek Marczykowski-Górecki

New submission from Marek Marczykowski-Górecki :

In Python 3.10 it is no longer possible to create an exception type that 
inherits from both OSError and AttributeError. This has worked in Python 3.9.
I don't see anything in changelog/release notes that would suggest it being 
intentional.

Behavior in Python 3.9:

Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class C(OSError, AttributeError): pass
... 
>>> C



Behavior in Python 3.10:

Python 3.10.0 (default, Oct  4 2021, 00:00:00) [GCC 11.2.1 20210728 (Red Hat 
11.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class C(OSError, AttributeError): pass
... 
Traceback (most recent call last):
  File "", line 1, in 
TypeError: multiple bases have instance lay-out conflict


My (very) wild guess is this being related to https://bugs.python.org/issue38530

--
components: Interpreter Core
messages: 403870
nosy: marmarek
priority: normal
severity: normal
status: open
title: TypeError when inheriting from both OSError and AttributeError
type: behavior
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



[Python-announce] [ANN] PyYAML-6.0 Released

2021-10-13 Thread Ingy dot Net
=
Announcing PyYAML-6.0
=

A new release of PyYAML is now available:
https://github.com/yaml/pyyaml/releases/tag/6.0

The previously-deprecated default loader selection in `yaml.load()` has
been removed; `Loader` is now a required argument.

Support for Python 2.7 and 3.5 has been dropped, and support for Python 3.10
added. It now includes libyaml 0.2.5 extension wheels for MacOS M1
(Apple Silicon/arm64), Linux s390x and Linux aarch64.

Numerous other bugfixes and code cleanups are included in this release.


Changes
===

* https://github.com/yaml/pyyaml/pull/327 -- Change README format to
Markdown
* https://github.com/yaml/pyyaml/pull/483 -- Add a test for YAML 1.1 types
* https://github.com/yaml/pyyaml/pull/497 -- fix float resolver to ignore
`.` and `._`
* https://github.com/yaml/pyyaml/pull/550 -- drop Python 2.7
* https://github.com/yaml/pyyaml/pull/553 -- Fix spelling of “hexadecimal”
* https://github.com/yaml/pyyaml/pull/556 -- fix representation of Enum
subclasses
* https://github.com/yaml/pyyaml/pull/557 -- fix libyaml extension compiler
warnings
* https://github.com/yaml/pyyaml/pull/560 -- fix ResourceWarning on leaked
file descriptors
* https://github.com/yaml/pyyaml/pull/561 -- always require `Loader` arg to
`yaml.load()`
* https://github.com/yaml/pyyaml/pull/564 -- remove remaining direct
distutils usage


Resources
=

PyYAML Matrix: https://matrix.to/#/#pyyaml:yaml.io
PyYAML IRC Channel: #pyyaml on irc.libera.chat
PyYAML homepage: https://github.com/yaml/pyyaml
PyYAML documentation: http://pyyaml.org/wiki/PyYAMLDocumentation
Source and binary installers: https://pypi.org/project/PyYAML/
GitHub repository: https://github.com/yaml/pyyaml/
Bug tracking: https://github.com/yaml/pyyaml/issues

YAML homepage: http://yaml.org/
YAML-core mailing list:
http://lists.sourceforge.net/lists/listinfo/yaml-core


About PyYAML


YAML is a data serialization format designed for human readability and
interaction with scripting languages. PyYAML is a YAML parser and emitter
for
Python.

PyYAML features a complete YAML 1.1 parser, Unicode support, pickle support,
capable extension API, and sensible error messages. PyYAML supports standard
YAML tags and provides Python-specific tags that allow to represent an
arbitrary Python object.

PyYAML is applicable for a broad range of tasks from complex configuration
files to object serialization and persistence.


Example
===

```
>>> import yaml

>>> yaml.full_load("""
... name: PyYAML
... description: YAML parser and emitter for Python
... homepage: https://github.com/yaml/pyyaml
... keywords: [YAML, serialization, configuration, persistence, pickle]
... """)
{'keywords': ['YAML', 'serialization', 'configuration', 'persistence',
'pickle'], 'homepage': 'https://github.com/yaml/pyyaml', 'description':
'YAML parser and emitter for Python', 'name': 'PyYAML'}

>>> print(yaml.dump(_))
name: PyYAML
homepage: https://github.com/yaml/pyyaml
description: YAML parser and emitter for Python
keywords: [YAML, serialization, configuration, persistence, pickle]
```

Maintainers
===

The following people are currently responsible for maintaining PyYAML:

* Ingy döt Net
* Matt Davis

and many thanks to all who have contributed!
See: https://github.com/yaml/pyyaml/pulls


Copyright
=

Copyright (c) 2017-2021 Ingy döt Net 
Copyright (c) 2006-2016 Kirill Simonov 

The PyYAML module was written by Kirill Simonov .
It is currently maintained by the YAML and Python communities.

PyYAML is released under the MIT license.
See the file LICENSE for more details.
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[ANN] PyYAML-6.0 Released

2021-10-13 Thread Ingy dot Net
=
Announcing PyYAML-6.0
=

A new release of PyYAML is now available:
https://github.com/yaml/pyyaml/releases/tag/6.0

The previously-deprecated default loader selection in `yaml.load()` has
been removed; `Loader` is now a required argument.

Support for Python 2.7 and 3.5 has been dropped, and support for Python 3.10
added. It now includes libyaml 0.2.5 extension wheels for MacOS M1
(Apple Silicon/arm64), Linux s390x and Linux aarch64.

Numerous other bugfixes and code cleanups are included in this release.


Changes
===

* https://github.com/yaml/pyyaml/pull/327 -- Change README format to
Markdown
* https://github.com/yaml/pyyaml/pull/483 -- Add a test for YAML 1.1 types
* https://github.com/yaml/pyyaml/pull/497 -- fix float resolver to ignore
`.` and `._`
* https://github.com/yaml/pyyaml/pull/550 -- drop Python 2.7
* https://github.com/yaml/pyyaml/pull/553 -- Fix spelling of “hexadecimal”
* https://github.com/yaml/pyyaml/pull/556 -- fix representation of Enum
subclasses
* https://github.com/yaml/pyyaml/pull/557 -- fix libyaml extension compiler
warnings
* https://github.com/yaml/pyyaml/pull/560 -- fix ResourceWarning on leaked
file descriptors
* https://github.com/yaml/pyyaml/pull/561 -- always require `Loader` arg to
`yaml.load()`
* https://github.com/yaml/pyyaml/pull/564 -- remove remaining direct
distutils usage


Resources
=

PyYAML Matrix: https://matrix.to/#/#pyyaml:yaml.io
PyYAML IRC Channel: #pyyaml on irc.libera.chat
PyYAML homepage: https://github.com/yaml/pyyaml
PyYAML documentation: http://pyyaml.org/wiki/PyYAMLDocumentation
Source and binary installers: https://pypi.org/project/PyYAML/
GitHub repository: https://github.com/yaml/pyyaml/
Bug tracking: https://github.com/yaml/pyyaml/issues

YAML homepage: http://yaml.org/
YAML-core mailing list:
http://lists.sourceforge.net/lists/listinfo/yaml-core


About PyYAML


YAML is a data serialization format designed for human readability and
interaction with scripting languages. PyYAML is a YAML parser and emitter
for
Python.

PyYAML features a complete YAML 1.1 parser, Unicode support, pickle support,
capable extension API, and sensible error messages. PyYAML supports standard
YAML tags and provides Python-specific tags that allow to represent an
arbitrary Python object.

PyYAML is applicable for a broad range of tasks from complex configuration
files to object serialization and persistence.


Example
===

```
>>> import yaml

>>> yaml.full_load("""
... name: PyYAML
... description: YAML parser and emitter for Python
... homepage: https://github.com/yaml/pyyaml
... keywords: [YAML, serialization, configuration, persistence, pickle]
... """)
{'keywords': ['YAML', 'serialization', 'configuration', 'persistence',
'pickle'], 'homepage': 'https://github.com/yaml/pyyaml', 'description':
'YAML parser and emitter for Python', 'name': 'PyYAML'}

>>> print(yaml.dump(_))
name: PyYAML
homepage: https://github.com/yaml/pyyaml
description: YAML parser and emitter for Python
keywords: [YAML, serialization, configuration, persistence, pickle]
```

Maintainers
===

The following people are currently responsible for maintaining PyYAML:

* Ingy döt Net
* Matt Davis

and many thanks to all who have contributed!
See: https://github.com/yaml/pyyaml/pulls


Copyright
=

Copyright (c) 2017-2021 Ingy döt Net 
Copyright (c) 2006-2016 Kirill Simonov 

The PyYAML module was written by Kirill Simonov .
It is currently maintained by the YAML and Python communities.

PyYAML is released under the MIT license.
See the file LICENSE for more details.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: spyder does not work under root! [linux]

2021-10-13 Thread Paulo da Silva
Às 02:08 de 12/10/21, Michael Torrie escreveu:
> On 10/8/21 4:32 PM, Paulo da Silva wrote:
>> Às 22:56 de 08/10/21, Paulo da Silva escreveu:
>>> Hi!
>>>
>>> I need to debug a python3 script under root. I tried spyder but it does
>>> not work.
>>>
>>> Running as root without --no-sandbox is not supported. See
>>> https://crbug.com/638180.
>>>
>>> Thanks for any comments including alternative solutions to debug as root.
>>>
>> I also tried with eric and curiously it gave the same message!!
>>
>> This seems crazy.
> 
> Not so crazy. It's incredibly dangerous to run a web browser as root.
> There's no reason I can think of for running a python script driving a
> web browser as root.
spyder and eric are both python editors/debuggers! Why are they related
with web browsers?!

Thanks

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: spyder does not work under root! [linux]

2021-10-13 Thread Paulo da Silva
Às 22:54 de 11/10/21, Chris Angelico escreveu:
> On Tue, Oct 12, 2021 at 8:52 AM Paulo da Silva
>  wrote:
>>
>> Hi!
>>
>> I need to debug a python3 script under root. I tried spyder but it does
>> not work.
>>
>> Running as root without --no-sandbox is not supported. See
>> https://crbug.com/638180.
>>
>> Thanks for any comments including alternative solutions to debug as root.
>>
> 
> Did you try reading the linked bug report? Or running it with --no-sandbox?
> 
Yes. It is about a web browser! Why are 2 python debuggers related with
a web browser?!
As per spyder, there is no such switch --no-sandbox!

Thanks.

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45448] PIP package installation failure for multiple packages

2021-10-13 Thread Zayden Micheal James


Zayden Micheal James  added the comment:

I am using Python 3.10 and PIP 21.2.4. All installations worked fine with 
Python 3.9. 

I tried combinations such as:

["pip", "pip3", "python3 -m pip", "python -m pip3", "python -m pip","python3 -m 
pip3"]

So far documented modules with problems are:

["numpy", "pandas", "tensorflow", "matplotlib"]

It is impossible for all of these libraries to be broken all at once with 
Python 3.10, PIP 21.2.4 and not be a problem with Python/PIP.

--

___
Python tracker 

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



[issue45126] [sqlite3] cleanup and harden Connection and Cursor __init__

2021-10-13 Thread Diego Ramirez


Change by Diego Ramirez :


--
nosy: +DiddiLeija

___
Python tracker 

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



[issue45448] PIP package installation failure for multiple packages

2021-10-13 Thread Zayden Micheal James


Zayden Micheal James  added the comment:

This issue is still persisting with other libraries aswell such as matplotlib 
and the above mentioned.

--
nosy:  -eric.smith
resolution: third party -> 
status: closed -> open
type: compile error -> behavior

___
Python tracker 

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



[issue45461] UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 8191: \ at end of string

2021-10-13 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8

___
Python tracker 

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



[issue35228] Index search in CHM help crashes viewer

2021-10-13 Thread Stephen Paul Chappell


Change by Stephen Paul Chappell :


--
nosy: +Zero

___
Python tracker 

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



RE: sum() vs. loop

2021-10-13 Thread Avi Gross via Python-list
Yes, Stefan, I realized that and did not test more thoroughly. Chris pointed
it out too. I indeed deleted the names but a second reference remained so I
may be wrong and the function may just keep track of the position and return
one tuple at a time. That would be a good design, unless there was a worry
the original might be changed out from under. 

My apologies if it was understood to mean I had shown it was copied.

-Original Message-
From: Python-list  On
Behalf Of Stefan Ram
Sent: Tuesday, October 12, 2021 9:49 PM
To: python-list@python.org
Subject: Re: sum() vs. loop

"Avi Gross"  writes:
>I did a test where I made two list called A and B and used zip to make 
>an object holding the two and then removed A and B. I was able to print 
>the list of tuples just fine with print(list(C)) so clearly it is not 
>so much a pure iterator as one that holds yet another copy of both lists!

  You may have "deleted the names", but not the lists.

a =[ 10, 11, 12 ]
b =[ 20, 21, 22 ]
c = zip( a, b )
del a[ 0 ], a[ 0 ], a[ 0 ]
del b[ 0 ], b[ 0 ], b[ 0 ]
print( a, b, list( c ))

  prints

[] [] []

  here.


--
https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45386] xmlrpc.client unimportable due to strfmt ValueError

2021-10-13 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks, R! ✨  ✨

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> behavior
versions: +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



[issue45386] xmlrpc.client unimportable due to strfmt ValueError

2021-10-13 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 9210eff61b75edabbe9263df0c4a303fc2149a22 by Miss Islington (bot) 
in branch '3.9':
bpo-45386: Handle strftime's ValueError graciously in xmlrpc.client (GH-28765) 
(GH-28935)
https://github.com/python/cpython/commit/9210eff61b75edabbe9263df0c4a303fc2149a22


--

___
Python tracker 

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



[issue45386] xmlrpc.client unimportable due to strfmt ValueError

2021-10-13 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset f40b230df91f29fa4a84c1d127b4eab56a6eda27 by Miss Islington (bot) 
in branch '3.10':
bpo-45386: Handle strftime's ValueError graciously in xmlrpc.client (GH-28765) 
(GH-28934)
https://github.com/python/cpython/commit/f40b230df91f29fa4a84c1d127b4eab56a6eda27


--

___
Python tracker 

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



[issue45463] Documentation inconsistency on the number of identifiers allowed in global stmt

2021-10-13 Thread Luca


New submission from Luca :

The global statement allows specifying a list of identifiers, as correctly 
reported in the "Simple statements" chapter: 
https://docs.python.org/3/reference/simple_stmts.html#the-global-statement.

Inconsistently, however, the "Execution model" chapter describes the global 
statement as if it only allowed one single name.

This can be addressed by pluralizing the word "name" in the appropriate places 
in the "Execution model" chapter.

--
assignee: docs@python
components: Documentation
messages: 403864
nosy: docs@python, lucach
priority: normal
pull_requests: 27227
severity: normal
status: open
title: Documentation inconsistency on the number of identifiers allowed in 
global stmt

___
Python tracker 

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



[issue44559] Enum: revert to 3.9

2021-10-13 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

It seems the revert was not done properly: it removed from 3.10 some bugfixes 
that had been applied to 3.9 (see issue42248 for an example).

--
nosy: +pitrou
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



[issue42248] Raised exception in Enum keeping user objects alive unnecessarily

2021-10-13 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

It seems the problem is that bpo-44559 reset the enum module to a previous 
state without the bugfix.

--

___
Python tracker 

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



[issue42248] Raised exception in Enum keeping user objects alive unnecessarily

2021-10-13 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Indeed, changeset  8c14f5a787b21d5a1eae5d5ee981431d1c0e055f is part of git 
main, but is not on the 3.10 branch AFAICT.

--

___
Python tracker 

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



[issue42248] Raised exception in Enum keeping user objects alive unnecessarily

2021-10-13 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

It appears this is *not* fixed in 3.10.0:

Python 3.10.0 (default, Oct 13 2021, 08:45:17) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import signal, gc
>>> class App: pass
... 
>>> def create_app():
...   app = App()
...   signal.signal(signal.SIGINT, signal.SIG_DFL)
... 
>>> [obj for obj in gc.get_objects() if type(obj) is App]
[]
>>> create_app()
>>> [obj for obj in gc.get_objects() if type(obj) is App]
[<__main__.App object at 0x7f2d3f3f1c30>]

--
nosy: +pitrou
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset aac29af6785712019d34f1a7f15b3c408a4f68ae by Victor Stinner in 
branch 'main':
bpo-45434: pyport.h no longer includes  (GH-28914)
https://github.com/python/cpython/commit/aac29af6785712019d34f1a7f15b3c408a4f68ae


--

___
Python tracker 

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



[issue24444] In argparse empty choices cannot be printed in the help

2021-10-13 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset fd2be6da2ffec2301a58aefa92f17f0c567fbc55 by Miss Islington (bot) 
in branch '3.10':
bpo-2: fix an error in argparse help when help for an option is blank 
(GH-28050) (GH-28931)
https://github.com/python/cpython/commit/fd2be6da2ffec2301a58aefa92f17f0c567fbc55


--

___
Python tracker 

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



[issue45239] email.utils.parsedate_tz raises UnboundLocalError if time has more than 2 dots in it

2021-10-13 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset f8473f6f7603f8cc3307d4cb853587be41b3 by Łukasz Langa in 
branch '3.10':
[3.10] bpo-45239: Fix parsedate_tz when time has more than 2 dots in it 
(GH-28452) (GH-28930)
https://github.com/python/cpython/commit/f8473f6f7603f8cc3307d4cb853587be41b3


--

___
Python tracker 

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



[issue45229] Always use unittest for collecting tests in regrtests

2021-10-13 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 5d747130933a25a3984f78ae32d2e74a0d2dc5d1 by Łukasz Langa in 
branch '3.9':
[3.9] bpo-45229: Make tkinter tests discoverable (GH-28637) (GH-28929)
https://github.com/python/cpython/commit/5d747130933a25a3984f78ae32d2e74a0d2dc5d1


--

___
Python tracker 

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



[issue45239] email.utils.parsedate_tz raises UnboundLocalError if time has more than 2 dots in it

2021-10-13 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks, Ben! ✨  ✨

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue45445] Fail if an invalid -X option is provided

2021-10-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset db2b6a20cd35781b2f5e798e880e57e6cf9b97aa by Pablo Galindo Salgado 
in branch 'main':
bpo-45445: Fail if an invalid X-option is provided in the command line 
(GH-28823)
https://github.com/python/cpython/commit/db2b6a20cd35781b2f5e798e880e57e6cf9b97aa


--

___
Python tracker 

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



[issue45461] UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 8191: \ at end of string

2021-10-13 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



Re: Mailing list activity low

2021-10-13 Thread Ken Peng
Maybe bounced by your mail provider. Try changing to another ESP such as
gmail.

On Wed, Oct 13, 2021 at 1:45 AM Antoon Pardon  wrote:

> Have I missed something and has the maillinglist been moved. Activity is
> very low here, about one message every five days.
>
> Antoon Pardon.
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45229] Always use unittest for collecting tests in regrtests

2021-10-13 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 151234f5da4b1922e3d91233a6eddda92d7269b0 by Miss Islington (bot) 
in branch '3.10':
bpo-45229: Make tkinter tests discoverable (GH-28637) (GH-28927)
https://github.com/python/cpython/commit/151234f5da4b1922e3d91233a6eddda92d7269b0


--

___
Python tracker 

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



[issue45239] email.utils.parsedate_tz raises UnboundLocalError if time has more than 2 dots in it

2021-10-13 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 5638618845752f713c00d69dbe705fed16761948 by Miss Islington (bot) 
in branch '3.9':
bpo-45239: Fix parsedate_tz when time has more than 2 dots in it (GH-28452) 
(GH-28928)
https://github.com/python/cpython/commit/5638618845752f713c00d69dbe705fed16761948


--

___
Python tracker 

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



Re: sum() vs. loop

2021-10-13 Thread Oscar Benjamin
On Mon, 11 Oct 2021 at 23:00, Christian Gollwitzer  wrote:
>
> Am 10.10.21 um 10:49 schrieb Steve Keller:
> > I have found the sum() function to be much slower than to loop over the
> > operands myself:
> >
> > def sum_products(seq1, seq2):
> >  return sum([a * b for a, b in zip(seq1, seq2)])
> >
> > def sum_products2(seq1, seq2):
> >  sum = 0
> >  for a, b in zip(seq1, seq2):
> >  sum += a * b
> >  return sum
> >
> > In a program I generate about 14 million pairs of sequences of ints each
> > of length 15 which need to be summed.  The first version with sum() needs
> > 44 seconds while the second version runs in 37 seconds.
>
> The first version constructs a list, sums it up and throws the list
> away, while the second version only keeps the running sum in memory. How
> about a generator expression instead, i.e.
>
>
>  sum((a * b for a, b in zip(seq1, seq2)))

What really matters in cases like this is interpreter overhead.
Typically a generator expression has slightly more overhead compared
to a list comprehension. You get a slightly slower per-item speed in
exchange for O(1) memory consumption.

A list comprehension like

result = sum([expr for foo in bar])

Translates internally to something like:

def _func():
data = []
for foo in bar:
data.append(foo)
return foo

_stuff = _func()
result = sum(_stuff)

Running this really does bring in the overhead of a function call
_func() because it needs to create a frame with locals and so on.
However it is only the cost of a single function call. Afterwards if
the elements in the list _stuff are built in types like int etc with
builtin __add__ methods then sum(_stuff) does not involve the
interpreter at all: it's a built-in function operating on a built-in
container of built-in objects.

With a generator expression like

result = sum(expr for foo in bar)

This translates internally to

def _genfunc():
for foo in bar:
yield foo

_gen = _genfunc()
result = sum(_gen)

Now the _genfunc() function call simply creates the generator and sets
up its frame which I think is more or less equivalent to the overhead
of the _func() function call. However the sum(_gen) line is no longer
a pure built-in operation. Internally each time sum calls
_gen.__next__() the execution frame for _genfunc() is reactivated so
that the interpreter can execute the bytecodes taking the frame from
one yield to the next. This is almost the overhead of a function call
for each item in bar although this is often unnoticeable in practice
and other factors can affect this.

The fastest version eliminates the interpreter altogether at least
when operating on pure built-in elements:

In [7]: nums1 = nums2 = list(range(10**5))

In [10]: %timeit sum([a*b for a, b in zip(nums1, nums2)])
9.83 ms ± 21.2 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)

In [11]: %timeit sum((a*b for a, b in zip(nums1, nums2)))
10.3 ms ± 109 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)

In [12]: from operator import mul

In [13]: %timeit sum(map(mul, nums1, nums2))
7.25 ms ± 33 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)

Of course if the elements being multiplied and summed have pure-Python
__add__/__mul__ methods or the container has a pure Python
__iter__/__next__ then any of those methods will typically dominate
the runtime over any of the overheads considered here.

--
Oscar
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45256] Remove the usage of the C stack in Python to Python calls

2021-10-13 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +27226
pull_request: https://github.com/python/cpython/pull/28937

___
Python tracker 

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



[issue45462] Speed up re.match with pre-compiled patterns

2021-10-13 Thread Jonas H.


Change by Jonas H. :


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

___
Python tracker 

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



[issue45462] Speed up re.match with pre-compiled patterns

2021-10-13 Thread Jonas H.


New submission from Jonas H. :

re.match(p, ...) with a pre-compiled pattern p = re.compile(...) can be much 
slower than calling p.match(...). Probably mostly in cases with "easy" patterns 
and/or short strings.

The culprit is that re.match -> re._compile can spend a lot of time looking up 
p its internal _cache, where it will never find p:

def _compile(pattern, flags):
...
try:
return _cache[type(pattern), pattern, flags]
except KeyError:
pass
if isinstance(pattern, Pattern):
...
return pattern
...
_cache[type(pattern), pattern, flags] = p
...

_compile will always return before the _cache is set if given a Pattern object.

By simply reordering the isinstance(..., Pattern) check we can safe a lot of 
time.

I've seen speedups in the range of 2x-5x on some of my data. As an example:

Raw speed of re.compile(p, ...).match():
time ./python.exe -c 'import re'\n'pat = re.compile(".").match'\n'for _ in 
range(1_000_000): pat("asdf")'
Executed in  190.59 millis

Speed with this optimization:
time ./python.exe -c 'import re'\n'pat = re.compile(".")'\n'for _ in 
range(1_000_000): re.match(pat, "asdf")'
Executed in  291.39 millis

Speed without this optimization:
time ./python.exe -c 'import re'\n'pat = re.compile(".")'\n'for _ in 
range(1_000_000): re.match(pat, "asdf")'
Executed in  554.42 millis

--
components: Regular Expressions
messages: 403851
nosy: ezio.melotti, jonash, mrabarnett
priority: normal
severity: normal
status: open
title: Speed up re.match with pre-compiled patterns
type: performance
versions: Python 3.11

___
Python tracker 

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



[issue45386] xmlrpc.client unimportable due to strfmt ValueError

2021-10-13 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45386] xmlrpc.client unimportable due to strfmt ValueError

2021-10-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27223
pull_request: https://github.com/python/cpython/pull/28935

___
Python tracker 

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



[issue45386] xmlrpc.client unimportable due to strfmt ValueError

2021-10-13 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 1c831353816ff699b54e804047a7242a09e98f5b by rtobar in branch 
'main':
bpo-45386: Handle strftime's ValueError graciously in xmlrpc.client (GH-28765)
https://github.com/python/cpython/commit/1c831353816ff699b54e804047a7242a09e98f5b


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue24444] In argparse empty choices cannot be printed in the help

2021-10-13 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue24444] In argparse empty choices cannot be printed in the help

2021-10-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27221
pull_request: https://github.com/python/cpython/pull/28932

___
Python tracker 

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



[issue24444] In argparse empty choices cannot be printed in the help

2021-10-13 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 6fafc25aea8689048314b5bf7a9bb986bb1ce238 by andrei kulakov in 
branch 'main':
bpo-2: fix an error in argparse help when help for an option is blank 
(GH-28050)
https://github.com/python/cpython/commit/6fafc25aea8689048314b5bf7a9bb986bb1ce238


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45239] email.utils.parsedate_tz raises UnboundLocalError if time has more than 2 dots in it

2021-10-13 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +27219
pull_request: https://github.com/python/cpython/pull/28930

___
Python tracker 

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



[issue45229] Always use unittest for collecting tests in regrtests

2021-10-13 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +27218
pull_request: https://github.com/python/cpython/pull/28929

___
Python tracker 

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



[issue45461] UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 8191: \ at end of string

2021-10-13 Thread Matthew Barnett


Matthew Barnett  added the comment:

It can be shortened to this:

buffer = b"a" * 8191 + b"\\r\\n"

with open("bug_csv.csv", "wb") as f:
f.write(buffer)

with open("bug_csv.csv", encoding="unicode_escape", newline="") as f:
f.readline()

To me it looks like it's reading in blocks of 8K and then decoding them,  but 
it isn't correctly handling an escape sequence that happens to cross a block 
boundary.

--
nosy: +mrabarnett

___
Python tracker 

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



[issue45239] email.utils.parsedate_tz raises UnboundLocalError if time has more than 2 dots in it

2021-10-13 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45239] email.utils.parsedate_tz raises UnboundLocalError if time has more than 2 dots in it

2021-10-13 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset b9e687618d3489944f29adbd2be50b46940c9e70 by Ben Hoyt in branch 
'main':
bpo-45239: Fix parsedate_tz when time has more than 2 dots in it (GH-28452)
https://github.com/python/cpython/commit/b9e687618d3489944f29adbd2be50b46940c9e70


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45229] Always use unittest for collecting tests in regrtests

2021-10-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27216
pull_request: https://github.com/python/cpython/pull/28927

___
Python tracker 

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



[issue45229] Always use unittest for collecting tests in regrtests

2021-10-13 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset f59ed3c310a7ceebf2a56a84ea969a7f75d95b64 by Serhiy Storchaka in 
branch 'main':
bpo-45229: Make tkinter tests discoverable (GH-28637)
https://github.com/python/cpython/commit/f59ed3c310a7ceebf2a56a84ea969a7f75d95b64


--

___
Python tracker 

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



[issue45446] Add a way to hide fields in dataclasses

2021-10-13 Thread Eric V. Smith


Eric V. Smith  added the comment:

"hide" is not a good name for this.

Does attrs have anything equivalent? This seems like a pretty niche usage, so 
I'm not inclined to include it without evidence of a wide-spread need for it.

--
assignee:  -> eric.smith

___
Python tracker 

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



[issue45410] python -m test -jN: write stderr in stdout to get messages in order

2021-10-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 676201a59f90caace606d11d4172aa74c1cd4992 by Victor Stinner in 
branch 'main':
bpo-45410: regrtest replaces print_warning.orig_stderr (GH-28926)
https://github.com/python/cpython/commit/676201a59f90caace606d11d4172aa74c1cd4992


--

___
Python tracker 

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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-13 Thread STINNER Victor


STINNER Victor  added the comment:

PyRun_InteractiveOneObjectEx() returns a single error code of errcode.h: E_EOF 
(11):

if (mod == NULL) {
_PyArena_Free(arena);
if (errcode == E_EOF) {
PyErr_Clear();
return E_EOF;
}
return -1;
}

--

___
Python tracker 

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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 713bb19356bce9b8f2b95461834fe1dae505f889 by Victor Stinner in 
branch 'main':
bpo-45434: Mark the PyTokenizer C API as private (GH-28924)
https://github.com/python/cpython/commit/713bb19356bce9b8f2b95461834fe1dae505f889


--

___
Python tracker 

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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-13 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, Include/errcode.h *is* used by PyRun_InteractiveOneFlags() and its 
variants. It's mentioned in its documentation:

   Returns ``0`` when the input was
   executed successfully, ``-1`` if there was an exception, or an error code
   from the :file:`errcode.h` include file distributed as part of Python if
   there was a parse error.  (Note that :file:`errcode.h` is not included by
   :file:`Python.h`, so must be included specifically if needed.)

--

___
Python tracker 

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



Selenium py3.8+ DepreciationWarnings - where to find doc to update code?

2021-10-13 Thread jkk
Selenium 3.141+
python 3.8+
ubuntu 20.04 or windows 10

I'm trying to upgrade code from py3.6+ to py3.8+ and I'm getting several 
DepreciationWarnings.

Can someone point me to where I can find the documentation that explains how to 
to remedy these warnings. What are the new preferred coding practices?

For example, here is a "DepreciationWarning" that I figured out:

py3.6+
from selenium import webdriver
browser = browser = webdriver.Firefox()
browser.get(url)
tables = browser.find_elements_by_tag_name("table")


py3.8+
from selenium import webdriver
from selenium.webdriver.common.by import By
browser = browser = webdriver.Firefox()
browser.get(url)
tables = browser.find_elements(By.TAG_NAME, "table")
or
tables = browser.find_elements(By.XPATH, "//table")

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45410] python -m test -jN: write stderr in stdout to get messages in order

2021-10-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27215
pull_request: https://github.com/python/cpython/pull/28926

___
Python tracker 

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



[issue45461] UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 8191: \ at end of string

2021-10-13 Thread Anatoly Myachev


Anatoly Myachev  added the comment:

Hello!

I can reduce it a little.
The buffer shoudln't be decreased, as it seems there is a some kind relation 
with the buffer size for IO operations.

buffer = 
b'col1,col2,col3,col4,col5,col6\\r\\n0,2000-01-01,0,00:00:00,DuBFsyerJU,1809.3924826424557\\r\\n10,2000-01-01,10,01:00:00,AlwGHbVPpB,2853.2392617952996\\r\\n20,2000-01-01,20,02:00:00,TEkGgsYXYz,9933.278931158615\\r\\n30,2000-01-01,30,03:00:00,tfvnynVSfp,8574.917426248916\\r\\n40,2000-01-01,40,04:00:00,YOGjhztMWe,3768.71871233428\\r\\n50,2000-01-01,50,05:00:00,vkTOJSeQmU,6330.252072351792\\r\\n60,2000-01-01,60,06:00:00,LeolDfaGyv,5052.618993456892\\r\\n70,2000-01-01,70,07:00:00,OcyrbYVtyr,4287.371622852719\\r\\n80,2000-01-01,80,08:00:00,VUwDPNhcFV,3589.697826814614\\r\\n90,2000-01-01,90,09:00:00,KOadtzcNyK,4794.158259020925\\r\\n100,2000-01-01,100,10:00:00,rdSOjXJBWC,8826.736894397129\\r\\n110,2000-01-01,110,11:00:00,qzwVBOklhk,8086.105782454443\\r\\n120,2000-01-01,120,12:00:00,UTRlqVfKoD,1012.5061461339624\\r\\n130,2000-01-01,130,13:00:00,wKqEkRhkfw,2511.3137510933934\\r\\n140,2000-01-01,140,14:00:00,LxklWJbgxo,406.7116346419042\\r\\n150,2000-01-01,150,15:00:00,SxmZkdUgHv,84
 
24.978062284761\\r\\n160,2000-01-01,160,16:00:00,nEvzypASGb,9890.252156059063\\r\\n170,2000-01-01,170,17:00:00,xiFkkjoDPB,2728.8359201479675\\r\\n180,2000-01-01,180,18:00:00,boMmgpBXgL,4231.680208002166\\r\\n190,2000-01-01,190,19:00:00,dXLJXWiXZI,7757.44902751916\\r\\n200,2000-01-01,200,20:00:00,PBdjwKoCMD,4915.090357003991\\r\\n210,2000-01-01,210,21:00:00,zGWLALpmoA,359.5243650158153\\r\\n220,2000-01-01,220,22:00:00,CfpZJoOqGZ,704.7990862762942\\r\\n230,2000-01-01,230,23:00:00,DrkxpLhpEN,520.3290677592321\\r\\n240,2000-01-02,240,00:00:00,TDKEBbZAzQ,5218.671660857721\\r\\n250,2000-01-02,250,01:00:00,gULwzvNeWO,4218.66872701774\\r\\n260,2000-01-02,260,02:00:00,ogSyzHWmNY,9026.657391329585\\r\\n270,2000-01-02,270,03:00:00,NetmmthtzN,2027.8312539582244\\r\\n280,2000-01-02,280,04:00:00,PoYiHipTzR,7667.627476518046\\r\\n290,2000-01-02,290,05:00:00,MjHIRGmsoq,4144.001792539834\\r\\n300,2000-01-02,300,06:00:00,qESRSNnNnO,5348.024681284471\\r\\n310,2000-01-02,310,07:00:00,sSIjcXWhLC,3622.46
 
73907599413\\r\\n320,2000-01-02,320,08:00:00,IvjrlljbeB,7500.419388155823\\r\\n330,2000-01-02,330,09:00:00,aVWVRXZjZy,3686.5972529264213\\r\\n340,2000-01-02,340,10:00:00,QKeTjcNlCG,1228.9751449454411\\r\\n350,2000-01-02,350,11:00:00,phEdHCVsbe,4254.15983968718\\r\\n360,2000-01-02,360,12:00:00,ursHJjQxRK,6099.131673115221\\r\\n370,2000-01-02,370,13:00:00,JvjcRlYcYG,1503.3586866746164\\r\\n380,2000-01-02,380,14:00:00,gzCyqHPRRb,7816.898213939008\\r\\n390,2000-01-02,390,15:00:00,lQZmobRwzt,8295.113759829599\\r\\n400,2000-01-02,400,16:00:00,qspiYGfTou,1987.8215069414816\\r\\n410,2000-01-02,410,17:00:00,mcqWMMzomf,15.878728570531964\\r\\n420,2000-01-02,420,18:00:00,fiPsxulpGU,5380.485947841902\\r\\n430,2000-01-02,430,19:00:00,gTAyTkpeez,4720.7159908343565\\r\\n440,2000-01-02,440,20:00:00,hzFbhAPvFX,946.5797295044975\\r\\n450,2000-01-02,450,21:00:00,NYNcYxsyVl,7333.850198973723\\r\\n460,2000-01-02,460,22:00:00,wvgMmIxLzo,7399.341315026157\\r\\n470,2000-01-02,470,23:00:00,bZoyzAGgEC,5464.0
 
53510955946\\r\\n480,2000-01-03,480,00:00:00,jZNaceUYyr,1390.8829937709977\\r\\n490,2000-01-03,490,01:00:00,sbfLgcCpru,9626.900131786555\\r\\n500,2000-01-03,500,02:00:00,MHpAkHfnmV,9406.471079089133\\r\\n510,2000-01-03,510,03:00:00,ENdFBGtRCq,3740.8773019724517\\r\\n520,2000-01-03,520,04:00:00,FzqXhMLHLY,4270.3585910905\\r\\n530,2000-01-03,530,05:00:00,wWinjEGhAj,8548.152649813675\\r\\n540,2000-01-03,540,06:00:00,LcxAImCvxt,4097.693176523874\\r\\n550,2000-01-03,550,07:00:00,sDhzGBYKpt,1673.7466277500146\\r\\n560,2000-01-03,560,08:00:00,jhagjcZhGU,4103.702089490347\\r\\n570,2000-01-03,570,09:00:00,ZIkRwPWyWP,9368.662605679918\\r\\n580,2000-01-03,580,10:00:00,uphgoCQwZY,3321.0096306747137\\r\\n590,2000-01-03,590,11:00:00,jEKaqqScLF,8442.084614664149\\r\\n600,2000-01-03,600,12:00:00,kSIJFBHVnL,4065.19226287942\\r\\n610,2000-01-03,610,13:00:00,YRhoANskYn,5089.668482943252\\r\\n620,2000-01-03,620,14:00:00,SnlwCSdkWf,5738.46737129545\\r\\n630,2000-01-03,630,15:00:00,ANfpLOiJTV,393.7754525
 

[issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch

2021-10-13 Thread David Bohman


David Bohman  added the comment:

Thank you for your help, Ned.

--

___
Python tracker 

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



[issue45461] UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 8191: \ at end of string

2021-10-13 Thread STINNER Victor


STINNER Victor  added the comment:

Can you please try write a simpler (shorter) reproducer?

--

___
Python tracker 

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



[issue45461] UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 8191: \ at end of string

2021-10-13 Thread Anatoly Myachev


New submission from Anatoly Myachev :

Expected behavior - if `read()` function works correctly, then `readline()` 
should also works.

Reproducer in file - just run: `python test.py`.

Traceback (most recent call last):
  File "test.py", line 11, in 
f.readline()
  File 
"C:\Users\amyachev\Miniconda3\envs\modin\lib\encodings\unicode_escape.py", line 
26, in decode
return codecs.unicode_escape_decode(input, self.errors)[0]
UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 
8191: \ at end of string

--
components: Unicode
files: test.py
messages: 403837
nosy: anmyachev, ezio.melotti, vstinner
priority: normal
severity: normal
status: open
title: UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in 
position 8191: \ at end of string
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file50354/test.py

___
Python tracker 

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



[issue45460] distutils.sysconfig.get_python_lib() does not respect sysconfig/distutils install schemes

2021-10-13 Thread Miro Hrončok

Miro Hrončok  added the comment:

> so distributors could patch the install schemes in there and distutils 
> (whether the one in the standard library or a third party fork).

Somehow, this sentence is not finished properly.

...so distributors could patch the install schemes in there and distutils 
(whether the one in the standard library or a third party fork) would respect 
it.

--

___
Python tracker 

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



[issue41282] Deprecate and remove distutils

2021-10-13 Thread Miro Hrončok

Miro Hrončok  added the comment:

Related: https://bugs.python.org/issue45460

--
nosy: +hroncok

___
Python tracker 

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



[issue45460] distutils.sysconfig.get_python_lib() does not respect sysconfig/distutils install schemes

2021-10-13 Thread Miro Hrončok

New submission from Miro Hrončok :

In https://github.com/python/cpython/pull/24549 (Load install schemes from 
sysconfig) we have assumed that distutils will simply read all information from 
sysconfig, so distributors could patch the install schemes in there and 
distutils (whether the one in the standard library or a third party fork).

However, in https://github.com/pypa/pip/issues/10151#issuecomment-942162384 we 
have figured out that distutils.sysconfig.get_python_lib() does not respect the 
schemes from sysconfig at all, instead, it creates the paths from scratch.

This might be too late for Python 3.10, but in Python 3.11 I'd like 
distutils.sysconfig.get_python_lib() to return paths defined by sysconfig 
install schemes. That way, we can more easily move that from the standard 
library to a third-party project with an independent delivery mechanism.

--
components: Distutils
messages: 403834
nosy: FFY00, dstufft, eric.araujo, frenzy, hroncok, jaraco, petr.viktorin, 
vstinner
priority: normal
severity: normal
status: open
title: distutils.sysconfig.get_python_lib() does not respect 
sysconfig/distutils install schemes
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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27214
pull_request: https://github.com/python/cpython/pull/28924

___
Python tracker 

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



[issue36424] Pickle fails on frozen dataclass that has slots

2021-10-13 Thread David Hagen


David Hagen  added the comment:

Because the implementation in GH-25786 relies on the new 
`dataclass(slots=True)` feature (i.e. it does not work if the slots are 
specified with `__slots__`), I don't think this can be trivially backported to 
versions before 3.10.

--

___
Python tracker 

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



[issue45256] Remove the usage of the C stack in Python to Python calls

2021-10-13 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 3901c081143ef29624f9c1cb49cc70a70321d139 by Pablo Galindo Salgado 
in branch 'main':
bpo-45256: Fix cleanup of stolen locals for Python-to-Python calls (GH-28905)
https://github.com/python/cpython/commit/3901c081143ef29624f9c1cb49cc70a70321d139


--

___
Python tracker 

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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bbe7497c5a44c2b4ec726605cf5a9086ba02daf1 by Victor Stinner in 
branch 'main':
bpo-45434: Remove pystrhex.h header file (GH-28923)
https://github.com/python/cpython/commit/bbe7497c5a44c2b4ec726605cf5a9086ba02daf1


--

___
Python tracker 

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



[issue45340] Lazily create dictionaries for plain Python objects

2021-10-13 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset a8b9350964f43cb648c98c179c8037fbf3ff8a7d by Mark Shannon in 
branch 'main':
bpo-45340: Don't create object dictionaries unless actually needed (GH-28802)
https://github.com/python/cpython/commit/a8b9350964f43cb648c98c179c8037fbf3ff8a7d


--

___
Python tracker 

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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 97308dfcdc0696e0b116c37386e2ff4d72e6c3f4 by Victor Stinner in 
branch 'main':
bpo-45434: Move _Py_BEGIN_SUPPRESS_IPH to pycore_fileutils.h (GH-28922)
https://github.com/python/cpython/commit/97308dfcdc0696e0b116c37386e2ff4d72e6c3f4


--

___
Python tracker 

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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27213
pull_request: https://github.com/python/cpython/pull/28923

___
Python tracker 

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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27212
pull_request: https://github.com/python/cpython/pull/28922

___
Python tracker 

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



[issue45459] Limited API support for Py_buffer

2021-10-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

ndim is not known before calling PyObject_GetBuffer(), so we will need a new 
API which combines PyObject_GetBuffer() and PyBuffer_New().

--

___
Python tracker 

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



[issue45410] python -m test -jN: write stderr in stdout to get messages in order

2021-10-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 773330773968f211c77abc7b5b525faa7b3c35a2 by Victor Stinner in 
branch 'main':
bpo-45410: regrtest -W leaves stdout/err FD unchanged (GH-28915)
https://github.com/python/cpython/commit/773330773968f211c77abc7b5b525faa7b3c35a2


--

___
Python tracker 

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



[issue45438] inspect not capturing type annotations created by __class_getitem__

2021-10-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The cause is that isinstance(list[int], type) returns True. It can cause bugs 
in other parts of the code which test for instance of type. For example:

>>> types.resolve_bases((typing.List[int],))
(, )
>>> types.resolve_bases((list[int],))
(list[int],)

>>> types.prepare_class('A', (int,), {'metaclass': typing.Type[int]})
(typing.Type[int], {}, {})
>>> types.prepare_class('A', (int,), {'metaclass': type[int]})
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/serhiy/py/cpython/Lib/types.py", line 125, in prepare_class
meta = _calculate_meta(meta, bases)
   
  File "/home/serhiy/py/cpython/Lib/types.py", line 139, in _calculate_meta
if issubclass(base_meta, winner):
   ^
TypeError: issubclass() argument 2 cannot be a parameterized generic

>>> @functools.singledispatch
... def g(a): pass
... 
>>> @g.register
... def g2(a: typing.List[int]): pass
... 
Traceback (most recent call last):
  File "", line 2, in 
  File "/home/serhiy/py/cpython/Lib/functools.py", line 863, in register
raise TypeError(

TypeError: Invalid annotation for 'a'. typing.List[int] is not a class.
>>> @g.register(list[int])
... def g2(a): pass
... 
>>> @g.register
... def g3(a: typing.List[int]): pass
... 
Traceback (most recent call last):
  File "", line 2, in 
  File "/home/serhiy/py/cpython/Lib/functools.py", line 863, in register
raise TypeError(

TypeError: Invalid annotation for 'a'. typing.List[int] is not a class.
>>> @g.register
... def g3(a: list[int]): pass
... 

And many other examples, too many to show here.

Was it mistake to make isinstance(list[int], type) returning True?

--

___
Python tracker 

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



[issue45459] Limited API support for Py_buffer

2021-10-13 Thread Christian Heimes


Christian Heimes  added the comment:

IIRC shape, strides, and suboffsets are all arrays of ndims length.

We could optimize allocation if we would require users to specify the value of 
ndims and don't allow them to change the value afterwards. PyBuffer_New(int 
ndims) then would allocate view of size sizeof(Py_buffer) + (3 * ndims * 
sizeof(Py_ssize_t *)). This would give us sufficient space to memcpy() shape, 
strides, and suboffsets arguments into memory after the Py_buffer struct.

--

___
Python tracker 

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



[issue45443] 'ThreadPoolExecutor' object has no attribute 'map'

2021-10-13 Thread Zohim Chandani


Zohim Chandani  added the comment:

Please see attached. I have printed out the python version. Running this on VS 
code.

--
Added file: https://bugs.python.org/file50353/Screenshot 2021-10-13 at 
12.45.04.png

___
Python tracker 

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



[issue45247] [C API] Add explicit support for Cython to the C API

2021-10-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I agree with Mark. Instead of exposing internal details in low-level API we 
should add more high-level API to satisfy concrete needs. It will give us more 
freedom of changing internals in future.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue45459] Limited API support for Py_buffer

2021-10-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

shape is a pointer to array of Py_ssize_t of size ndim. array and memoryview do 
a trick to avoid memory allocation, but _testbuffer.ndarray allocates it 
dynamically in the heap. We can add a small static buffer in Py_buffer to avoid 
additional memory allocation in common cases.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



  1   2   >