[issue44072] Doc: power operator (`**`) present for numbers.Complex, not added in numbers.Integral

2021-05-08 Thread Rory Yorke


New submission from Rory Yorke :

Checked at commit 42fcad2, HEAD of main circa 8 May 2021.

cpython/Doc/library/numbers.rst says numbers.Complex subtypes "include the 
operations [...] ``+``, ``-``, ``*``, ``/``, :func:`abs`, :meth:`conjugate`, 
``==``, and ``!=``"

and for numbers.Integral: "Adds abstract methods for ``**`` and"

However, in cpython/Lib/numbers.py, the class Complex has `__pow__` and 
`__rpow__` methods, which makes sense mathematically.  The numbers.Class 
docstring is also missing a mention of `**`.

class.Integral does define a three-argument __pow__ for three-argument pow().

--
assignee: docs@python
components: Documentation
messages: 393240
nosy: docs@python, roryyorke
priority: normal
severity: normal
status: open
title: Doc: power operator (`**`) present for numbers.Complex, not added in 
numbers.Integral
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



[issue44073] [sqlite3] drop statement in_use field in favour of sqlite3_stmt_busy()

2021-05-08 Thread Erlend E. Aasland


New submission from Erlend E. Aasland :

sqlite3_stmt_busy() has been around since SQLite 3.7.10. I suggest to drop the 
in_use field of pysqlite_Statement in favour of sqlite3_stmt_busy(); we do not 
need to duplicate functionality already present in SQLite.

There was a bugfix for sqlite3_stmt_busy() in SQLite 3.8.6 regarding rollback 
statements, but we normally reset all our statements after use, so it should 
not be a problem. There are some corner cases in _pysqlite_query_execute() 
where a sqlite3_stmt may not be reset upon return, but that's easily fixable 
(and it would be a nice side-effect).

Pro's:
- statement objects have one less member
- no duplication of SQLite functionality
- cleaner exit paths from _pysqlite_query_execute()
- less lines of code, easier to maintain

Con's:
- the current code works / "code churn"

--
assignee: erlendaasland
components: Extension Modules
keywords: easy (C)
messages: 393241
nosy: berker.peksag, erlendaasland, serhiy.storchaka
priority: normal
severity: normal
status: open
title: [sqlite3] drop statement in_use field in favour of sqlite3_stmt_busy()
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



[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-05-08 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> Hm, I guess we could use sqlite3_stmt_busy() instead of the in_use flag.

I opened bpo-44073 for this.

--

___
Python tracker 

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



[issue44073] [sqlite3] drop statement in_use field in favour of sqlite3_stmt_busy()

2021-05-08 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

$ git diff --stat
 Modules/_sqlite/connection.c |  1 -
 Modules/_sqlite/cursor.c |  5 +
 Modules/_sqlite/statement.c  | 14 +-
 Modules/_sqlite/statement.h  |  2 --
 4 files changed, 2 insertions(+), 20 deletions(-)

--

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2021-05-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24635
pull_request: https://github.com/python/cpython/pull/25983

___
Python tracker 

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



[issue44074] patchcheck checks against branch "master" not "main"

2021-05-08 Thread Rory Yorke


New submission from Rory Yorke :

I'm probably missing something, but "master" seems hard-coded into 
patchcheck.py, and I couldn't find any related issues on bpo.

Checked on branch off 42fcad2.

When I ran patchcheck:

rory@rory-latitude:~/src/cpython$ ./python Tools/scripts/patchcheck.py
Getting base branch for PR ... origin/master
Getting the list of files that have been added/changed ... fatal: ambiguous 
argument 'origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git  [...] -- [...]'
0 files


The obvious offender is line 81 of Tools/scripts/patchcheck.py:

base_branch = "master"

Changing this to "main" results in useful output, but I imagine one
would want to check for both "master" and "main" for a while yet?

--
components: Demos and Tools
messages: 393244
nosy: roryyorke
priority: normal
severity: normal
status: open
title: patchcheck checks against branch "master" not "main"

___
Python tracker 

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



[issue44073] [sqlite3] drop statement in_use field in favour of sqlite3_stmt_busy()

2021-05-08 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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

___
Python tracker 

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



[issue37903] IDLE Shell sidebar.

2021-05-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Yes, lets discuss actual problems and various possible solutions.

Raymond's example is incomplete as it omits multiline statements, which is 
where the real problems lie and the reason a fix was sorely needed.  This has 
been more or less agreed on since at least 2005.

Old:
--
>>> if a:
print('okay:'
else:
if a is None:
print('none:')
else:
print('else:')

else:
--

Possible confusion between input and output is a pre-existing issue.  For the 
default themes, Shell User Output has the same background color as Code or 
Normal Text.  The foreground is blue.  The lack of contrast is worse on the 
dark theme.  I think using the same background was a mistake, but so far 
changing the default has been considered off limits. The pre-existing fix for 
distinguishing output is to customize colors for Shell User Output, as I have 
done. I have also given Shell User Exceptions more contrast.  One can make both 
as different as one wants.

In 2014, #7676, Raymond said that the indent mess was a "major PITA" and the 
impossibility of copy-pasting correctly indented code into an editor  "has been 
a continual source of frustration for students in my Python courses as well.  
I'm looking forward to it being fixed."

At the time, I had no more idea how to fix this than Kurt Kaiser did in the 
2000s.  But I eventually realized that the problem is entirely due to the first 
line of multiline statements being indented relative to following code lines, 
unlike the REPL.  The fix (and the only acceptible fix) was and is to stop 
doing that.

The day before the beta1 release*, Tal and I merged a beta-quality release that 
we said would need improvement before production release.
--
>>> if a:
... print('okay:'
... else:
... if a is None:
... print('none:')
... else:
... print('else:')
...
else:
--
I am sure that a graphics designer would consider this improved.  Unindented 
code now lines up, and the indents are that same as in any decent python-aware 
editor.  In any case, the above is identical to the REPL except that in the 
REPL, the output starts at the left, under the prompts.

If one selects the above lines, easily done by clicking and dragging on the 
sidebar, just as with line numbers, right clicks, and selects 'Copy with 
prompts' on the context menu, one gets the above *with*  output 'else' to the 
left.  IDLE is now as useful for interactive snippets as the REPL.  This is 
mentioned in the IDLE What's New and News items.

I can imagine a possible alternative fix that would put output under the 
prompts in Shell, not just in the clipboard copy.  It would involve a fixed 
input prompt above the code entry area and side prompts in the history area.  
This would be a variation on the two-text solution that I discussed on #37892.

As for copying code to paste into an editor: As I believe was mentioned above, 
we had 'Copy only code' on the context menus, but removed it because it also 
copied user input in response to user code prompts, which is currently tagged 
the same as code entered in response to the Shell's prompts.  Fixing this will 
be a high priority issue.  When it is, we will list both new option on the 
Shell menu.

I will soon open another issue for the sidebar colors.  I consider the current 
colors to be placeholders.  We set that aside to get the sidebar otherwise 
ready.  Some might prefer a background matching the general shell background so 
that there is no vertical separation.


* Not by choice.  We were delayed 6 months because Azure Pipelines, on Ubuntu 
and Windows, changes the test environment by grabbing sys.stdout.  Shell 
receives input on sys.stdout.  So when test code sent text to shell via 
sys.stdout, it went to Pipelines instead of Shell, breaking the tests.  We 
should have ignored those failures, but didn't.  Once we realized the problem, 
less that 2 weeks before the beta, we had the test steal sys.stdout back for 
each test and moved forward.

--

___
Python tracker 

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



[issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1

2021-05-08 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

I know the deb-src problem and I've added that a long time ago. The problem is 
that I don't know which repository has the unstable source. I'm on Ubuntu Focal 
Fossa. I successfully can fetch sources but they are not up-to-date. I can't 
figure out the repository and the component.

--

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2021-05-08 Thread miss-islington


miss-islington  added the comment:


New changeset 6e7fe1901631dc730abc02d1f546a99fd6b6fe83 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-31904: Correct error string in test_file_not_exists() for VxWorks 
(GH-25965) (GH-25983)
https://github.com/python/cpython/commit/6e7fe1901631dc730abc02d1f546a99fd6b6fe83


--

___
Python tracker 

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



[issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase"

2021-05-08 Thread Jürgen Gmach

Change by Jürgen Gmach :


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

___
Python tracker 

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



[issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase"

2021-05-08 Thread Jürgen Gmach

Jürgen Gmach  added the comment:

Thank you for the feedback. I created a PR.

--

___
Python tracker 

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



[issue44072] Doc: power operator (`**`) present for numbers.Complex, not added in numbers.Integral

2021-05-08 Thread Rory Yorke


Change by Rory Yorke :


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

___
Python tracker 

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



[issue43124] [security] smtplib multiple CRLF injection

2021-05-08 Thread Miguel Brito


Change by Miguel Brito :


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

___
Python tracker 

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



[issue25716] typeobject.c call_method & call_maybe can leak references on 'func'

2021-05-08 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue12638] urllib.URLopener prematurely deletes files on cleanup

2021-05-08 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue12638] urllib.URLopener prematurely deletes files on cleanup

2021-05-08 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> out of date

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2021-05-08 Thread Alex Willmer


Change by Alex Willmer :


--
nosy:  -Alex.Willmer

___
Python tracker 

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



[issue42725] PEP 563: Should the behavior change for yield/yield from's

2021-05-08 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 8.0 -> 9.0
pull_requests: +24640
pull_request: https://github.com/python/cpython/pull/25988

___
Python tracker 

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



[issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1

2021-05-08 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

It's also pretty problematic that Python depends on the system header code 
rather than fetched source code like we do in OS X or Windows. I would like to 
suggest that we fetch source code and then use that instead of system header 
files. This wouldn't be a problem to implement since OS X and Linux behave in 
the same way because both share the same UNIX kernel and it wouldn't break any 
code out there. In fact it would improve the code. This would reduce all the 
setup we have to do beforehand on Linux especially Debian distributions.

--

___
Python tracker 

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



[issue16866] libainstall doesn't create $(BINDIR) directory

2021-05-08 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

In 3.10 - 
https://github.com/python/cpython/commit/a2c72d52dddefbfbaa0745b0af54330fad03b29e

3.9 - 
https://github.com/python/cpython/commit/a25c46bd7dd47a2f95b32d17ee2f66de214892c6

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



[issue44075] Add a PEP578 audit hook for Asyncio loop stalls

2021-05-08 Thread Tom Forbes


New submission from Tom Forbes :

Detecting and monitoring loop stalls in a production asyncio application is 
more difficult than it could be.

Firstly you must enable debug mode for the entire loop then you need to look 
for warnings outputted via the asyncio logger. This makes it hard to send loop 
stalls to monitoring systems via something like statsd.

Ideally asyncio callbacks would always be timed and an auditevent always 
triggered if it passes a particular threshold. If debug mode is enabled then a 
warning is logged.

--
components: asyncio
messages: 393251
nosy: asvetlov, orf, yselivanov
priority: normal
severity: normal
status: open
title: Add a PEP578 audit hook for Asyncio loop stalls
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



[issue42725] PEP 563: Should the behavior change for yield/yield from's

2021-05-08 Thread miss-islington


miss-islington  added the comment:


New changeset 90d584a2ab91cc0f30e90a0a99f8c1447eb51302 by Miss Islington (bot) 
in branch '3.10':
bpo-42725: mention the changes on what's new (GH-25974)
https://github.com/python/cpython/commit/90d584a2ab91cc0f30e90a0a99f8c1447eb51302


--

___
Python tracker 

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



[issue24147] Dialect class defaults are not documented.

2021-05-08 Thread So Ukiyama


Change by So Ukiyama :


--
keywords: +patch
nosy: +uniocto
nosy_count: 7.0 -> 8.0
pull_requests: +24641
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/25989

___
Python tracker 

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



[issue44075] Add a PEP578 audit hook for Asyncio loop stalls

2021-05-08 Thread Christian Heimes


Christian Heimes  added the comment:

Are you proposing to use PEP 578 for monitoring the event loop?

--
nosy: +christian.heimes, steve.dower

___
Python tracker 

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



[issue44022] urllib http client possible infinite loop on a 100 Continue response

2021-05-08 Thread Łukasz Langa

Change by Łukasz Langa :


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

___
Python tracker 

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



[issue24147] Dialect class defaults are not documented.

2021-05-08 Thread So Ukiyama


So Ukiyama  added the comment:

I created a PR which apply Brandon Milam's patch.

So If I have offended you with my rudeness, I hope you will forgive me for 
taking this down.

--

___
Python tracker 

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



[issue44075] Add a PEP578 audit hook for Asyncio loop stalls

2021-05-08 Thread Tom Forbes


Tom Forbes  added the comment:

I don't see why we shouldn't use PEP 578 for this - the events provide rich 
monitoring information about what a Python process is "doing" with an easy, 
central way to register callbacks to receive these events and shovel them off 
to a monitoring solution.

Is there that much of a difference between monitoring the number of files, 
sockets, emails or even web browsers opened and the number of times an asyncio 
application has stalled?

The alternative would be to make the loop stalling some kind of hookable event, 
which just seems like reinventing `sys.audit()`.

--

___
Python tracker 

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



[issue44075] Add a PEP578 audit hook for Asyncio loop stalls

2021-05-08 Thread Tom Forbes


Change by Tom Forbes :


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

___
Python tracker 

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



[issue42725] PEP 563: Should the behavior change for yield/yield from's

2021-05-08 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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



[issue44076] issue with list in Python 3.8.5

2021-05-08 Thread Mohamed


New submission from Mohamed :

I am using Python under Windows 10 on Dell for a log time.
All of my applications on Python were working fine.
Suddenly from the beginning of May, 
My apps do not update a "list" data after a new insert, 
even with small data volume.

As well as choosing old data from a list, 
a message appears stating that the identifier is out of range, 
and is working properly after restart.
Programs that do not use a list work fine.

After investigation, it appears memory issues.
How I solve the issue?

--
components: Windows
messages: 393256
nosy: becky07, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: issue with list in Python 3.8.5
type: enhancement
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



[issue44076] issue with list in Python 3.8.5

2021-05-08 Thread Mohamed


Mohamed  added the comment:

I'm using tkinter 8.6 with Python

--

___
Python tracker 

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



[issue44074] patchcheck checks against branch "master" not "main"

2021-05-08 Thread Leonardo Lai


Change by Leonardo Lai :


--
keywords: +patch
nosy: +leoll2
nosy_count: 1.0 -> 2.0
pull_requests: +24644
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25991

___
Python tracker 

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



[issue44074] patchcheck checks against branch "master" not "main"

2021-05-08 Thread Leonardo Lai


Leonardo Lai  added the comment:

I've just created a patch for this. Now it can automatically detect the default 
branch name (`main`, `master` or whatever)

--

___
Python tracker 

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



[issue44006] symbol documentation still exists

2021-05-08 Thread Julien Palard


Julien Palard  added the comment:

I `rm -fr 3.10` on the doc server yesterday, so it started 3.10 from scratch 
today and the file were properly removed.

--

___
Python tracker 

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



[issue44076] issue with list in Python 3.8.5

2021-05-08 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Can you show an example code where this occurs? Which Python 3.8 subversion are 
you using? How do you conclude these are memory issues?

--
nosy: +shreyanavigyan

___
Python tracker 

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



[issue44077] IP_RECVTOS option is missing from socket module

2021-05-08 Thread Georg Sauthoff


New submission from Georg Sauthoff :

Currently, the socket module doesn't provide the IP_RECVTOS constant.

This constant is needed for receiving the TOS byte (or the DSCP bits) via 
ancillary data when calling recvmsg() or recvmsg_into().

That means it would be used in a setsockopt() call like this:

s.setsockopt(socket.IPPROTO_IP, socket.IP_RECVTOS, 1)

This socket option is available on Linux and perhaps other operating systems, 
as well.

See also https://manpath.be/f33/7/ip#L467

--
components: Library (Lib)
messages: 393261
nosy: gms
priority: normal
severity: normal
status: open
title: IP_RECVTOS option is missing from socket module
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



[issue44077] IP_RECVTOS option is missing from socket module

2021-05-08 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 1.0 -> 2.0
pull_requests: +24645
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25992

___
Python tracker 

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



[issue44078] Output relative path when using PurePath.relative_to

2021-05-08 Thread Mark Hammond


New submission from Mark Hammond :

Comparing two paths, PurePath.relative_to fails with ValueError if the second 
path is not in the first.

>>> Path('/a/b').relative_to('/a/b/c')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.9/pathlib.py", line 928, in relative_to
raise ValueError("{!r} is not in the subpath of {!r}"
ValueError: '/a/b' is not in the subpath of '/a/b/c' OR one path is relative 
and the other is absolute.

Please extend PurePath.relative_to so it is able to output a relative path in 
form of '..' instead of an error. Currently, the only way to do this is to use 
relpath from os.path but it would be very useful if Path was able to output the 
relative path.

--
components: Library (Lib)
messages: 393262
nosy: mhammondr
priority: normal
severity: normal
status: open
title: Output relative path when using PurePath.relative_to
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue44075] Add a PEP578 audit hook for Asyncio loop stalls

2021-05-08 Thread Steve Dower


Steve Dower  added the comment:

Fundamentally I don't have an issue with the audit hook. My only concern would 
be if there's anything that an application may do to _respond_ to a stall (e.g. 
is this valuable for applying backpressure? etc.)

If it's purely diagnostic, and there's nothing you'd do in production when it 
happens, then an audit hook is perfect.

--

___
Python tracker 

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



[issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1

2021-05-08 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

This problem doesn't exist in RPM Linux. Therefore creating a new DebianBuild 
directory (like there is PCBuild, Mac) just for Debian Linux. (I haven't tested 
RPM Linux and can't access any right now therefore I don't know if the problem 
exists there or not. But I'm gonna guess not for now.)

--

___
Python tracker 

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



[issue3014] file_dealloc() assumes errno is set when EOF is returned

2021-05-08 Thread Irit Katriel


Irit Katriel  added the comment:

I believe this is out of date - there is no longer file_dealloc or anything 
similar to the code in the report in fileobject.c

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

___
Python tracker 

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



[issue44076] issue with list in Python 3.8.5

2021-05-08 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I doubt it is a memory issue. Tell us what investigation you did that lead you 
to that conclusion.

Python code doesn't normally just stop working for no reason. I expect that you 
changed your code in some way and introduced a bug.

This is not a help desk for debugging your own code. If you need help with 
that, I recommend Reddit's r/learnpython, StackOverflow, or the Python-List 
mailing list.

If you still think that this is a bug in Python, not in your own code, please 
show us the smallest program you can that demonstrates the problem:

- what you did
- the result you expected
- the result that you actually got

For example, try this:

L = [1, 2, 3]
L.insert(0, 999)
print(L)
# you should get [999, 1, 2, 3]


If you get that result, your Python is working fine and the bug is in your code.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue44075] Add a PEP578 audit hook for Asyncio loop stalls

2021-05-08 Thread Tom Forbes


Tom Forbes  added the comment:

Actually reacting to a stall would require something more and probably should 
be done at some point.

But this is purely about monitoring - in our use case we'd send a metric via 
statsd that would be used to correlate stalls against other service level 
metrics. This seems pretty critical when running a large number of asyncio 
applications in production because you can only currently _infer_ that a stall 
is happening, and it's hard to trace the cause across service boundaries. An 
event hook that was sent the loop and handle would be ideal for this.

--

___
Python tracker 

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



[issue32924] Python 3.7 docs in docs.p.o points to GitHub's master branch

2021-05-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal
nosy_count: 4.0 -> 5.0
pull_requests: +24647
pull_request: https://github.com/python/cpython/pull/25994

___
Python tracker 

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



[issue32924] Python 3.7 docs in docs.p.o points to GitHub's master branch

2021-05-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 03acfc50ac0be8b49847b94dee93e21b1efa0e76 by Pablo Galindo in 
branch '3.10':
bpo-32924: Fix the Show Source url in the documentation (GH-25994)
https://github.com/python/cpython/commit/03acfc50ac0be8b49847b94dee93e21b1efa0e76


--

___
Python tracker 

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



[issue32924] Python 3.7 docs in docs.p.o points to GitHub's master branch

2021-05-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24648
pull_request: https://github.com/python/cpython/pull/25995

___
Python tracker 

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



[issue43149] Misleading error message for except with missing parens (3.10.a5)

2021-05-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +24649
pull_request: https://github.com/python/cpython/pull/25996

___
Python tracker 

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



[issue1606233] readline on popen3 file returns empty string before end

2021-05-08 Thread Irit Katriel


Irit Katriel  added the comment:

Closing as there is little chance we can do anything about a 15-year old issue 
with no reproducer (chances are it was already fixed by now if it was actually 
a bug).

--
nosy: +iritkatriel
resolution:  -> rejected
stage: test needed -> 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



[issue22953] Windows installer configures system PATH also when installing only for current user

2021-05-08 Thread Irit Katriel


Irit Katriel  added the comment:

Irrelevant since version 3.5.

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

___
Python tracker 

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



[issue32725] Instance of _multiprocessing.PipeConnection-subtype crash on deletion

2021-05-08 Thread Irit Katriel


Irit Katriel  added the comment:

2.7 is past EOL.

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

___
Python tracker 

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



[issue44070] __file__ is now fully qualified in 3.8 and 3.9

2021-05-08 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1

2021-05-08 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Here's a trick I often recommend:
Do as the CI; use the posix-deps-apt.sh script!

You'll find it in your CPython git repo:
$ cd cpython.git  # change working dir to the CPython git repo
$ cat .github/workflows/posix-deps-apt.sh 
#!/bin/sh
apt-get update

apt-get -yq install \
build-essential \
ccache \
gdb \
lcov \
libbz2-dev \
libffi-dev \
libgdbm-dev \
liblzma-dev \
libncurses5-dev \
libreadline6-dev \
libsqlite3-dev \
libssl-dev \
lzma \
lzma-dev \
tk-dev \
uuid-dev \
xvfb \
zlib1g-dev


Should work well on all Debian based Linux distros (that includes Ubuntu).

--
nosy: +erlendaasland

___
Python tracker 

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



[issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1

2021-05-08 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

I figured out the commands. The problem is they are not upgraded.

--

___
Python tracker 

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



[issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1

2021-05-08 Thread Ned Deily


Ned Deily  added the comment:

This isn't a bug with Python, it is a development environment issue.  The 
discussion would be more appropriate in help forums, like on discuss.python.org 
or Stackoverflow. And, if there si some deficiency in the devguide, there is a 
tracker for issues with it: https://github.com/python/devguide/issues

--
nosy: +ned.deily
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



[issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1

2021-05-08 Thread Christian Heimes


Christian Heimes  added the comment:

I have been following this issue for a while. I feel it's getting increasingly 
offtopic for Python bug tracker. Any concerns or problems with your distro are 
better suited for the help and discussion forums of your distribution.

Ah, Ned just closed the issue while I was typing.

--
nosy: +christian.heimes
resolution: not a bug -> 
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



[issue43149] Misleading error message for except with missing parens (3.10.a5)

2021-05-08 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1

2021-05-08 Thread Christian Heimes


Change by Christian Heimes :


--
resolution:  -> third party
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



[issue44035] Regenerating the configure script fails even if dependencies are satisfied

2021-05-08 Thread Christian Heimes


Christian Heimes  added the comment:

Pablo, could you please give the container a try?

--

___
Python tracker 

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



[issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1

2021-05-08 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

I never said this was a bug. But what I'm saying is there should be a different 
build for Debian because Debian has a reputation of using outdated packages.

--

___
Python tracker 

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



[issue32924] Python 3.7 docs in docs.p.o points to GitHub's master branch

2021-05-08 Thread miss-islington


miss-islington  added the comment:


New changeset 20fcd8363452506d51bf820c835bd11b6d00e0e7 by Miss Islington (bot) 
in branch '3.9':
bpo-32924: Fix the Show Source url in the documentation (GH-25994)
https://github.com/python/cpython/commit/20fcd8363452506d51bf820c835bd11b6d00e0e7


--

___
Python tracker 

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



[issue32924] Python 3.7 docs in docs.p.o points to GitHub's master branch

2021-05-08 Thread Ned Deily


Ned Deily  added the comment:

I think the only reason this is still open is as a reminder to have a permanent 
process fix. Pablo, would it be possible to include this step in the new 
release-tools automation?  If so, we can open an issue there and close this one.

--

___
Python tracker 

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



[issue32924] Python 3.7 docs in docs.p.o points to GitHub's master branch

2021-05-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I created an issue on the release repo.

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



[issue44035] Regenerating the configure script fails even if dependencies are satisfied

2021-05-08 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

Seems to work like a charm:

❯ docker run -v`pwd`:/src tiran/cpython_autoconf
Rebuilding configure script
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: configure.ac: not using Automake
autoreconf: Leaving directory `.'
Done

--

___
Python tracker 

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



[issue44079] [sqlite3] optimisation: remove statement weak ref list from connection object

2021-05-08 Thread Erlend E. Aasland


New submission from Erlend E. Aasland :

Today, the sqlite3 extension module keeps two[1] lists of statements:

 1. The statement cache[2], stored in pysqlite_Connection.statement_cache
 2. A weak ref. list (hard coded limited to 200 statements in 
_pysqlite_drop_unused_statement_references()), stored in 
pysqlite_Connection.statements

AFAICS, there's no benefit in keeping both. Suggesting to remove the latter.

Pro's:
- less lines of code to maintain
- clearer code
- one less data member in pysqlite_Connection
- improved test coverage (there are currently no coverage for 
_pysqlite_drop_unused_statement_references()[3])

Con's:
- the current code works / "code churn"


$ git diff --shortstat 
 1 file changed, 13 insertions(+), 60 deletions(-)


[1] Actually, there's three lists: SQLite also keeps a list, available using 
sqlite3_stmt_next()
[2] See bpo-42862 for suggested improvements to the current cache implementation
[3] See bpo-43553 for improving the code coverage of the sqlite3 extension 
module

--
assignee: erlendaasland
components: Extension Modules
messages: 393282
nosy: berker.peksag, erlendaasland, serhiy.storchaka
priority: normal
severity: normal
status: open
title: [sqlite3] optimisation: remove statement weak ref list from connection 
object
type: resource usage
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



[issue44079] [sqlite3] optimisation: remove statement weak ref list from connection object

2021-05-08 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Berker/Serhiy, weak ref. list question:
Could also the pysqlite_Statement.in_weakreflist member go? Seems to be ok:

$ git diff --shortstat
 3 files changed, 13 insertions(+), 72 deletions(-)
$ ./python.exe -m test -R : test_sqlite
0:00:00 load avg: 0.83 Run tests sequentially
0:00:00 load avg: 0.83 [1/1] test_sqlite
beginning 9 repetitions
123456789
.

== Tests result: SUCCESS ==

1 test OK.

Total duration: 5.7 sec
Tests result: SUCCESS

--

___
Python tracker 

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



[issue44079] [sqlite3] optimisation: remove statement weak ref list from connection object

2021-05-08 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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

___
Python tracker 

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



[issue44079] [sqlite3] remove superfluous statement weak ref list from connection object

2021-05-08 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
title: [sqlite3] optimisation: remove statement weak ref list from connection 
object -> [sqlite3] remove superfluous statement weak ref list from connection 
object

___
Python tracker 

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



[issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase"

2021-05-08 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

https://dictionary.cambridge.org/us/dictionary/english/lower-case lists 
lower-case as a valid variant for nouns as well as adjectives.

--
nosy: +andrei.avk

___
Python tracker 

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



[issue44080] Bias in random.choices(long_sequence)

2021-05-08 Thread Dennis Sweeney


New submission from Dennis Sweeney :

Problem: Random.choices() never returns sequence entries at large
odd indices. For example:

>>> import random
>>> [x % 2 for x in random.choices(range(2**53), k=20)]
[0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1]
>>> [x % 2 for x in random.choices(range(2**54), k=20)]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

This might require a 64-bit build.

Possible solutions:

1) Do nothing.

Document the quirk, and recommend using
[seq[randrange(len(seq))] for i in range(k)]

2) Use integer arithmetic rather than random().

Using _randbelow() in the unweighted case alone breaks
test_random.test_choices_algorithms(), but adding a case for
`if isinstance(total, int)` and using _randbelow() there as
well creates a difference between the reproducability
of weights=[1]*n versus weights=[1.0]*n.

3) Raise an Exception or Warning when loss of precision is likely to occur.

Something like `if n > 2.0 ** BPF: raise OverFlowError(...)`.
All smaller integers are exactly representable, but that doesn't
quite eliminate the bias (see below).


---

There is bias in random.choices() even when n <= 2**53:

>>> Counter(val % 3 for val in
... choices(range(2**53 - 2**51), k=1_000_000))
Counter({1: 374976, 0: 333613, 2: 291411})

>>> Counter(val % 3 for val in
... choices(range(2**53 - 2**51), k=1_000_000)
... if val < 2**51)
Counter({0: 19, 1: 83664, 2: 83293})


For some explanation, imagine floats have
only 3 bits of precision. Then random.choices() would do something
like this on a sequence of length 7:

# Random 3-significant-bit floats
def random():
return randrange(8) / 8

# selecting from a pool of size 2**BPF - 1
>>> Counter(floor(random() * 7) for _ in range(1_000_000))
Counter({0: 249566, 5: 125388, 6: 125251, 2: 125202, 1: 125149, 3: 124994, 4: 
124450})

Issue: both 0/8 and 7/8 fall in [0, 1).

Similar biases:

>>> Counter(floor(randrange(16)/16*15) for _ in range(1_000_000))
Counter({0: 124549, 5: 62812, 14: 62807, 6: 62766, 10: 62740, 3: 62716, 12: 
62658, 13: 62649, 9: 62473, 8: 62376, 2: 62373, 4: 62346, 11: 62293, 1: 62278, 
7: 62164})

>>> Counter(floor(randrange(16)/16*14) for _ in range(1_000_000))
Counter({7: 125505, 0: 124962, 11: 62767, 9: 62728, 6: 62692, 10: 62684, 4: 
62625, 3: 62465, 12: 62428, 13: 62397, 2: 62332, 8: 62212, 5: 62176, 1: 62027})

>>> def bias(bits, n):
... c = Counter(floor(randrange(2**bits)/(2**bits) * n)
... for _ in range(1_000_000))
... m = min(c.values())
... preferred = [k for k, v in c.items() if v / m > 1.5]
... preferred.sort()
... return preferred

>>> bias(bits=4, n=15)
[0]
>>> bias(bits=4, n=14)
[0, 7]
>>> bias(bits=8, n=250)
[0, 41, 83, 125, 166, 208]

# Observation of which numbers may be biased toward
# I have no proof that this is universally true
>>> [250 * i // (2**8 - 250) for i in range(6)]
[0, 41, 83, 125, 166, 208]

If using the OverflowError approach, I think using a threshold of 2**BPF/2
would only make some "bins" (indices) have 1.5x the probability of
others rather than 2x, and thus would not remove the problem either.

--
components: Library (Lib)
messages: 393285
nosy: Dennis Sweeney, rhettinger
priority: normal
severity: normal
status: open
title: Bias in random.choices(long_sequence)
type: behavior
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



[issue44078] Output relative path when using PurePath.relative_to

2021-05-08 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

duplicate of https://bugs.python.org/issue40358 , which has an open patch.

--
nosy: +andrei.avk

___
Python tracker 

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



[issue44074] patchcheck checks against branch "master" not "main"

2021-05-08 Thread Ned Deily


Change by Ned Deily :


--
nosy: +pablogsal

___
Python tracker 

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



[issue44076] issue with list in Python 3.8.5

2021-05-08 Thread Mohamed


Mohamed  added the comment:

I'm using tkinter for a long time, my application was running fine till 1st 
May, and suddenly happen this issue.

After adding a new data to a list, it showing in some places of tkinter 
components. For example, in treeview, it shows based on running specfic 
function, but on click it appear this message:

Traceback (most recent call last):
  File 
"C:\Users\xx\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py",
 line 1883, in __call__
return self.func(*args)
  File "xxx.py", line 1423, in OnDoubleClick
itemXid = assetinfo_lst[xrec][1]
IndexError: list index out of range

in OnDoubleClick:
xrec = self.treedata.selection()[0]
xrec = int(xrec[1:], 16) - 1

itemXid = assetinfo_lst[xrec][1]

However, after exiting the program and restarting it, it is working properly.

it could be the mainloop is not working:
if __name__ == "__main__":
root = Tk()
App = MasterApp(root)
root.mainloop()

Is an issue with a new update of Windows 10? MS suggest to reinstall tkinter 
and recover Windows

--

___
Python tracker 

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



[issue43417] ast.unparse: Simplify buffering logic

2021-05-08 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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



[issue44081] ast.unparse: dont use redundant space separator for lambdas with no parameters

2021-05-08 Thread Batuhan Taskaya


New submission from Batuhan Taskaya :

Previously:

>>> import ast
>>> ast.unparse(ast.parse("lambda: 'hey!'"))
"lambda : 'hey!'"

Expected:

>>> import ast
>>> ast.unparse(ast.parse("lambda: 'hey!'"))
"lambda: 'hey!'"

--
assignee: BTaskaya
components: Library (Lib)
messages: 393288
nosy: BTaskaya
priority: normal
severity: normal
status: open
title: ast.unparse: dont use redundant space separator for lambdas with no 
parameters
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



[issue41830] "NameError: name 'AttributeError' is not defined"

2021-05-08 Thread Irit Katriel


Irit Katriel  added the comment:

The link to the logs is not working now, and without more info there isn't much 
we can do. Sanka, are you able to reproduce this on a newer python version and 
tell us how?

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

___
Python tracker 

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



[issue43109] When using Apple Clang, --with-lto builds should not check for llvm-ar

2021-05-08 Thread Rishav Kundu


Change by Rishav Kundu :


--
keywords: +patch
nosy: +xrisk
nosy_count: 2.0 -> 3.0
pull_requests: +24652
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25999

___
Python tracker 

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



[issue43568] Drop support for Mac OS X < 10.3 module linking

2021-05-08 Thread Joshua Root


Joshua Root  added the comment:

The part that is a bug is that the whole version was checked, not just the 
major version--you couldn't target macOS 11.0 if your Python was built for 
11.3, for example. MacPorts users getting an error in that situation was the 
original motivation for coming up with the distutils change.

--

___
Python tracker 

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



[issue44081] ast.unparse: dont use redundant space separator for lambdas with no parameters

2021-05-08 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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

___
Python tracker 

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



[issue43568] Drop support for Mac OS X < 10.3 module linking

2021-05-08 Thread Joshua Root


Change by Joshua Root :


--
pull_requests: +24654
pull_request: https://github.com/python/cpython/pull/26001

___
Python tracker 

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



[issue44082] Add a method to check interpolation errors in configparser

2021-05-08 Thread Munir Contractor


New submission from Munir Contractor :

Currently, the interpolation of values is done lazily in ConfigParser, only 
when the value is read. The documentation for this can be improved and also a 
method to check for such errors can be provided. Providing such a method can 
help with tests and detecting potential problems earlier in an application.

--
components: Library (Lib)
messages: 393291
nosy: lukasz.langa, munircontractor
priority: normal
severity: normal
status: open
title: Add a method to check interpolation errors in configparser
type: enhancement

___
Python tracker 

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



[issue44082] Add a method to check interpolation errors in configparser

2021-05-08 Thread Munir Contractor


Change by Munir Contractor :


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

___
Python tracker 

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



[issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase"

2021-05-08 Thread Eric V. Smith


Eric V. Smith  added the comment:

The stdlib seems to have settled on lowercase for the noun version, though. My 
two cents: no sense not being consist just because lower-case might also work.

--

___
Python tracker 

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



[issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase"

2021-05-08 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

On Sat, May 8, 2021 at 10:38 PM Eric V. Smith 
wrote:

>
> Eric V. Smith  added the comment:
>
> The stdlib seems to have settled on lowercase for the noun version,
> though. My two cents: no sense not being consist just because lower-case
> might also work.
>

 Sounds good to me, I'm not opposed to consistency!

--

___
Python tracker 

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



[issue44057] Inconsitencies in `__init_subclass__` in a generic class

2021-05-08 Thread Ken Jin


Ken Jin  added the comment:

Since this only affects 3.6 which is no longer receiving bugfixes, I'm closing 
this issue.

3.7 and higher do not have this bug. So one way forward is to upgrade to 3.7 or 
3.8 - both of which are supported by most major libraries.

If this bug reappears again in 3.10, please do not hesitate to re-open this 
issue. Thanks!

--
components:  -Interpreter Core
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
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



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

2021-05-08 Thread Ken Jin


Ken Jin  added the comment:

> IMO you need to implement LOAD_METHOD support for all kinds of calls, 
> including the ones that use kwargs, to see any improvement.

Recently I played around with that idea and extended LOAD/CALL_METHOD to 
keyword arguments (so CALL_FUNCTION_KW is replaced). I then reapplied Pablo's 
patch. Here's the pyperformance results (LTO + PGO):

> pyperf compare_to 2021-05-08_03-25-general_load_method-42fcad26a487.json.gz 
> 2021-05-08_08-50-general_load_method-dd24d58ce940.json.gz -G --min-speed=1

Slower (5):
- pathlib: 50.3 ms +- 0.8 ms -> 51.9 ms +- 1.1 ms: 1.03x slower
- unpack_sequence: 141 ns +- 2 ns -> 144 ns +- 7 ns: 1.02x slower
- telco: 16.6 ms +- 0.6 ms -> 16.9 ms +- 0.5 ms: 1.02x slower
- unpickle: 33.4 us +- 0.5 us -> 33.9 us +- 0.8 us: 1.01x slower
- nqueens: 239 ms +- 2 ms -> 242 ms +- 2 ms: 1.01x slower

Faster (23):
- logging_silent: 438 ns +- 16 ns -> 411 ns +- 18 ns: 1.07x faster
- go: 572 ms +- 55 ms -> 539 ms +- 8 ms: 1.06x faster
- pickle_pure_python: 1.10 ms +- 0.01 ms -> 1.06 ms +- 0.02 ms: 1.04x faster
- meteor_contest: 274 ms +- 4 ms -> 265 ms +- 4 ms: 1.03x faster
- logging_simple: 20.6 us +- 0.3 us -> 19.9 us +- 0.4 us: 1.03x faster
- hexiom: 23.0 ms +- 1.0 ms -> 22.2 ms +- 0.2 ms: 1.03x faster
- mako: 37.0 ms +- 0.5 ms -> 35.9 ms +- 0.4 ms: 1.03x faster
- json_dumps: 32.3 ms +- 0.4 ms -> 31.4 ms +- 0.3 ms: 1.03x faster
- scimark_sor: 496 ms +- 7 ms -> 484 ms +- 7 ms: 1.03x faster
- spectral_norm: 372 ms +- 5 ms -> 363 ms +- 4 ms: 1.02x faster
- richards: 177 ms +- 5 ms -> 173 ms +- 4 ms: 1.02x faster
- django_template: 114 ms +- 1 ms -> 112 ms +- 1 ms: 1.02x faster
- dulwich_log: 170 ms +- 2 ms -> 167 ms +- 2 ms: 1.02x faster
- pyflate: 1.65 sec +- 0.02 sec -> 1.62 sec +- 0.02 sec: 1.02x faster
- xml_etree_iterparse: 282 ms +- 5 ms -> 278 ms +- 3 ms: 1.02x faster
- unpickle_list: 12.1 us +- 0.1 us -> 11.9 us +- 0.2 us: 1.02x faster
- nbody: 343 ms +- 5 ms -> 338 ms +- 7 ms: 1.02x faster
- logging_format: 22.6 us +- 0.4 us -> 22.3 us +- 0.5 us: 1.01x faster
- sympy_str: 833 ms +- 7 ms -> 822 ms +- 7 ms: 1.01x faster
- float: 271 ms +- 3 ms -> 268 ms +- 5 ms: 1.01x faster
- scimark_fft: 1.05 sec +- 0.01 sec -> 1.03 sec +- 0.01 sec: 1.01x faster
- deltablue: 17.9 ms +- 0.3 ms -> 17.6 ms +- 0.4 ms: 1.01x faster
- scimark_lu: 403 ms +- 9 ms -> 399 ms +- 9 ms: 1.01x faster

Benchmark hidden because not significant (30): (...)
Geometric mean: 1.01x faster

Most benchmarks don't use keyword arguments. I'm going to try extend 
LOAD_METHOD to *args and **kwargs next.

For anyone interested, here's the diff (unstable) 
https://github.com/python/cpython/compare/main...Fidget-Spinner:general_load_method

I hope this helps :).

--
nosy: +kj

___
Python tracker 

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



[issue41730] Show deprecation warnings for tkinter.tix

2021-05-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Unfortunately this commit has introduced some reference leaks, see:

https://buildbot.python.org/all/#/builders/684/builds/5

Could someone take a look?

--
nosy: +pablogsal
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



[issue39228] traceback.FrameSummary does not handle exceptions from `repr()`

2021-05-08 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

This probably shouldn't be done, for all of the reasons above.

For the sake of an argument, if we really wanted to do something like this (as 
it may be convenient in some cases), a better way might be to add a 
`__tb_repr__ = __repr__` which can be overridden, and `traceback` would use 
that instead of plain repr.

--
nosy: +andrei.avk

___
Python tracker 

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



[issue43656] StackSummary.format fails if str(value) fails

2021-05-08 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

@Martin it's more that logic in a function may raise exception and it will be 
handled somewhere upstream, but a repr should just give you a simple 
representation of an object, it would make no sense for upstream logic to be 
"object repr failed with such exception, instead we should do this now". It's 
hard to imagine when this would make sense.

--
nosy: +andrei.avk

___
Python tracker 

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



[issue44083] problem with updated 3.9.5

2021-05-08 Thread Swarnila Chakma


New submission from Swarnila Chakma :

the codes were running okay with the version 3.9.4. But yesterday after 
updating the new version 3.9.5, the same codes are showing error. For example, 
if I were to write a code about swapping numbers, i write the code:

print('Enter two variables')
a = input() #suppose 2 nilam
b = input()#suppose 3 nilam
x = int(a)
y = int(b)
x = x-y #now we stored value of x-y in x variable
y = x+y #now we stored value of x+y in y variable
x = y-x
print(x)
print(y)

And I get the following output:

File "C:/Users/Asus/PycharmProjects/celsius to fahrenheit/main.py", line 4, in 

x = int(a)
ValueError: invalid literal for int() with base 10: ''

I tried reinstalling the version 3.9.4, but it's the same result. It would be 
appreciable if it can be solved soon.

--
components: Windows
files: main.py
messages: 393299
nosy: paul.moore, steve.dower, swarnila707, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: problem with updated 3.9.5
versions: Python 3.9
Added file: https://bugs.python.org/file50026/main.py

___
Python tracker 

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



[issue41730] Show deprecation warnings for tkinter.tix

2021-05-08 Thread Zachary Ware


Change by Zachary Ware :


--
pull_requests: +24657
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/26005

___
Python tracker 

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



[issue41930] Wrap sqlite3_serialize API in sqlite3 module

2021-05-08 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

What would be the use case for this?

--
nosy: +erlendaasland

___
Python tracker 

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



[issue44084] Can't mark match, case, _ as keywords in docs

2021-05-08 Thread Tal Einat


New submission from Tal Einat :

Beginning in Python 3.10, `match`, `case` and `_` are "soft keywords", i.e. 
they are considered keywords only in specific parts of the syntax.

However, they cannot be tagged with a :keyword:`...` role in our docs.

This appears to be due to not appearing in the list of keywords in the Python 
lexer in Pygments, which is used by Sphinx.

I've opened an issue on the Pygments repo about this:
https://github.com/pygments/pygments/issues/1797

--
assignee: docs@python
components: Documentation
messages: 393301
nosy: docs@python, taleinat
priority: normal
severity: normal
status: open
title: Can't mark match, case, _ as keywords in docs
type: behavior
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



[issue41730] Show deprecation warnings for tkinter.tix

2021-05-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24658
pull_request: https://github.com/python/cpython/pull/26006

___
Python tracker 

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