[issue44371] asyncio.wait_for does not cancel running tasks in the correct fashion

2021-06-19 Thread Ofek Kirzner


Ofek Kirzner  added the comment:

Kindly reminder.
Thx :)

--
resolution:  -> remind

___
Python tracker 

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



[issue44465] html.escape can be used in a few places in the standard lib instead of similar existing code

2021-06-19 Thread Andrei Kulakov


New submission from Andrei Kulakov :

There are a few places where old code does essentially the same thing as 
`html.escape()`, and can be replaced with html.escape():

 - more readable
 - less error prone on refactorings
 - will benefit if html.escape() performance is improved in the future
 - will be easier to grep for in case in the future html.escape() is enhanced 
with new escapes & it will be useful to consider applying it to all instances 
where it is used.

Here's what I found:

https://github.com/python/cpython/blob/main/Lib/difflib.py#L1914

https://github.com/python/cpython/blob/09eb81711597725f853e4f3b659ce185488b0d8c/Lib/plistlib.py#L158

https://github.com/python/cpython/blob/09eb81711597725f853e4f3b659ce185488b0d8c/Lib/pydoc.py#L525

https://github.com/python/cpython/blob/09eb81711597725f853e4f3b659ce185488b0d8c/Lib/xml/dom/minidom.py#L306

(^ keep existing escape of double quote)

https://github.com/python/cpython/blob/09eb81711597725f853e4f3b659ce185488b0d8c/Lib/xml/sax/saxutils.py#L27

https://github.com/python/cpython/blob/09eb81711597725f853e4f3b659ce185488b0d8c/Lib/xmlrpc/client.py#L149

I can add a PR if this sounds good.

--
components: Library (Lib)
messages: 396161
nosy: andrei.avk
priority: normal
severity: normal
status: open
title: html.escape can be used in a few places in the standard lib instead of 
similar existing code
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



Re: Subpixel positioning on Tk canvas

2021-06-19 Thread Terry Reedy

On 6/19/2021 12:42 AM, Christian Gollwitzer wrote:

Am 19.06.21 um 06:26 schrieb George Furbish:
On Saturday, June 19, 2021 at 12:22:31 AM UTC-4, Christian Gollwitzer 
wrote:

Am 19.06.21 um 02:03 schrieb George Furbish:
Does Tk support interpolation/subpixel positioning of canvas 
elements? (e.g. images, text.) I have moving elements on my canvas, 
but the movement isn't very smooth and it's especially obvious when 
I have text moving alongside an image, since the two elements tend 
to jump to the next pixel at different times, creating a little 
judder between the two.

There is an "improved canvas" available, tkpath, which supports
antialiasing on all platforms. It is part of, e.g. undroidwish, if you
want to experiment with it. Last time I tested it had problems on macOS
though.


How can I enable or access the improved canvas via Tkinter?



Probably by writing the wrapper for it ;)

Sorry for that answer, but Tkinter does not support many of the most 
useful extensions for Tcl/Tk, because someone has to write the wrappers. 
It only supports what is provided by base Tk. Among those I consider 
useful and use in almost any application are:


Are these extensions included with the tcl/tk distribution, or otherwise 
available from active state?  Are this extensions included with Linux 
installations of tcl/tk?  Or easily installed?


* TkDnD for native drag'n'drop support (there is an inferior python 
package of the same name which implements local DnD only)


* tablelist - complete widget for displaying trees and tables like 
ttk::treeview, but with almost every feature one could imagine


* pdf4tcl - create a PDF from a canvas content, e.g. for printing


Basically you call Tcl via the eval() method of tkinter; in principle 
you could do



import tkinter as tk
root=tk()

root.eval('package require tkpath')
root.eval('...here comes your tkpath code...')
root.call('.tkp', 'create', 'oval', )


tkpath is described here: https://wiki.tcl-lang.org/page/tkpath

For the wrapping, look at the implementation files of Tkinter, for say, 
the original canvas, and modify accordingly.


 Christian




--
Terry Jan Reedy


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


Re: Strange disassembly

2021-06-19 Thread Alan Bawden
Chris Angelico  writes:

   >>> sys.version
   '3.10.0b2+ (heads/3.10:33a7a24288, Jun  9 2021, 20:47:39) [GCC 8.3.0]'
   >>> def chk(x):
   ... if not(0 < x < 10): raise Exception
   ...
   >>> dis.dis(chk)
 2   0 LOAD_CONST   1 (0)
 2 LOAD_FAST0 (x)
 4 DUP_TOP
 6 ROT_THREE
 8 COMPARE_OP   0 (<)
10 POP_JUMP_IF_FALSE   11 (to 22)
12 LOAD_CONST   2 (10)
14 COMPARE_OP   0 (<)
16 POP_JUMP_IF_TRUE14 (to 28)
18 LOAD_GLOBAL  0 (Exception)
20 RAISE_VARARGS1
   >>   22 POP_TOP
24 LOAD_GLOBAL  0 (Exception)
26 RAISE_VARARGS1
   >>   28 LOAD_CONST   0 (None)
30 RETURN_VALUE
   >>>

   Why are there two separate bytecode blocks for the "raise Exception"?
   I'd have thought that the double condition would still be evaluated as
   one thing, or at least that the jump destinations for both the
   early-abort and the main evaluation should be the same.

Looks like in 3.8 it compiles more like the way you expected.

I didn't try 3.9, but it looks like a recent change to te compiler.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue43476] Enabling access to showsyntaxerror for IDLE's shell

2021-06-19 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The comment should be "# For 3rd party use.  See issue 43476."
Updates to the pypi url, now https://pypi.org/project/friendly/ should be 
recorded here on this issue. 

The undocumented name 'cache' is excluded from linecache.__all__ and therefore 
private.  We use it at our own risk (which should be extremely minimal).

I cannot think of anyway that adding another '<...>' pseudoname entry could 
hurt.  The only possibility is adding another copy of an entry, but they are 
small.

But are you sure that this is value for the key?  We could instead make the 
pseudotext be anything we want, such as a serialized version of the exception 
instance itself, including the error line.  Why reproduce the error instead of 
fetching it?  (If you do reproduce, you have to make sure you use the same 
compile options.)

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



[issue44464] Remove flake8 exception for deprecation warning (importlib.metadata)

2021-06-19 Thread Jason R. Coombs


Change by Jason R. Coombs :


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

___
Python tracker 

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



[issue44464] Remove flake8 exception for deprecation warning (importlib.metadata)

2021-06-19 Thread Jason R. Coombs


New submission from Jason R. Coombs :

importlib_metadata 4.5 
(https://importlib-metadata.readthedocs.io/en/latest/history.html#v4-5-0) 
removed the special exclusion for flake8 in the deprecation warning for 
deprecated interfaces in entry_points. For the same motivations there, do the 
same in importlib.metadata.

--
assignee: jaraco
components: Library (Lib)
messages: 396159
nosy: jaraco
priority: normal
severity: normal
status: open
title: Remove flake8 exception for deprecation warning (importlib.metadata)
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



[issue36621] shutil.rmtree follows junctions on windows

2021-06-19 Thread Irit Katriel


Irit Katriel  added the comment:

The documentation for rmtree[1] now says:

Changed in version 3.8: On Windows, will no longer delete the contents of a 
directory junction before removing the junction.

So I think this issue can be closed.

[1] https://docs.python.org/3/library/shutil.html#shutil.rmtree

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



[issue39452] Improve the __main__ module documentation

2021-06-19 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue17359] Mention "__main__.py" explicitly in command line docs

2021-06-19 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.11 -Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue24632] Improve documentation about __main__.py

2021-06-19 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.11 -Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue39452] Improve the __main__ module documentation

2021-06-19 Thread Irit Katriel


Irit Katriel  added the comment:

See also Issue24632 and Issue17359.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue24632] Improve documentation about __main__.py

2021-06-19 Thread Irit Katriel


Irit Katriel  added the comment:

See also Issue39452 and Issue17359.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue17359] Mention "__main__.py" explicitly in command line docs

2021-06-19 Thread Irit Katriel


Irit Katriel  added the comment:

See also Issue39452.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue44459] 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh

2021-06-19 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I submitted https://github.com/brechtm/rinohtype/pull/270 to address the issue 
in rinohtype. Please feel free to reopen and address the questions posed above 
if appropriate.

--
resolution:  -> wont fix
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



[issue44463] HTTP Cookiejar doesn't support samesite

2021-06-19 Thread Chris Wagner


New submission from Chris Wagner :

In 3.8 the samesite attributes was added to http.cookies module.
However it hasn't been added to http.cookiejar module. The method: 
_normalized_cookie_tuples seems to have a hardcoded list of allowable 
attributes.

While the updated standard is still in draft stage 
(https://datatracker.ietf.org/doc/draft-ietf-httpbis-rfc6265bis/)
samesite is widely implemented and used (Chrome added support in 2017).

--
components: Library (Lib)
messages: 396153
nosy: jwag956
priority: normal
severity: normal
status: open
title: HTTP Cookiejar doesn't support samesite
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



[issue44342] enum with inherited type won't pickle

2021-06-19 Thread Ethan Furman


Change by Ethan Furman :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



Re: Unable to remove setup of 3.9.5 from Windows 10

2021-06-19 Thread Mats Wichmann

On 6/19/21 10:14 AM, Manish Jain wrote:

Hello Team,

I have installed the Python 3.9.5 and trying to remove from the PC through
the Uninstall Program (All Possible ways - Through Control Panel or
Uninstall Python executable)

It just outputs saying Uninstall Successfully but nothing happening (Still
listed in Programs List) and even not allowing me to install again.

Please let me know if there is any alternate resolution

Thanks,
Manish



You could try this:

https://support.microsoft.com/en-us/topic/fix-problems-that-block-programs-from-being-installed-or-removed-cca7d1b6-65a9-3d98-426b-e9f927e1eb4d

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


[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2021-06-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue43476] Enabling access to showsyntaxerror for IDLE's shell

2021-06-19 Thread Andre Roberge


Andre Roberge  added the comment:

Would it be possible to add a single line of code to idlelib's pyshell.py, as 
indicated below:

def showsyntaxerror(self, filename=None):
"""... """
linecache.cache[""] = linecache.cache[filename]  # here
tkconsole = self.tkconsole
...

Of course, another name than "" could be chosen.

This would allow users (like me, with Friendly) to retrieve the code that 
caused a SyntaxError and process it as they wish. In my case, it would allow me 
to reproduce the SyntaxError and have Friendly provide an explanation and 
possible suggestions for fixing the error.

This would complement the new support for user defined sys.excepthook 
introduced in Python 3.10.

--

___
Python tracker 

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



[issue44462] multiprocessing.get hangs if the pool is closed in the signal handler

2021-06-19 Thread Chaitanya


New submission from Chaitanya :

This is similar to https://bugs.python.org/issue22393 but the child is killed 
in the Pool.terminate() using SIGTERM i.e., proper way.

Run the attached script that runs an indefinite method using 
multiprocessing.apply_async, and in the signal handler for SIGTERM does the 
pool clean up (close, terminate and join), on issuing a SIGTERM (`kill `), the cleanup works fine, but the parent process is stuck in get() as 
during termination the event is not set.

Able to repro with all 3.6/3.9/3.10.


See logs below
```
[DEBUG/MainProcess] created semlock with handle 140035884298240
[DEBUG/MainProcess] created semlock with handle 140035884294144
[DEBUG/MainProcess] created semlock with handle 140035884290048
[DEBUG/MainProcess] created semlock with handle 140035884285952
[DEBUG/MainProcess] created semlock with handle 140035884281856
[DEBUG/MainProcess] created semlock with handle 140035884277760
[DEBUG/MainProcess] added worker
[INFO/ForkPoolWorker-1] child process calling self.run()
[INFO/MainProcess] 
[INFO/MainProcess] 
[INFO/MainProcess] 
[INFO/ForkPoolWorker-1] Signals for 28462
[INFO/ForkPoolWorker-1] Handlers.SIG_DFL
[INFO/ForkPoolWorker-1] 
[INFO/ForkPoolWorker-1] Handlers.SIG_DFL
[INFO/MainProcess] 28461: Caught signal 15
[INFO/MainProcess] 28461: Closing pools
[INFO/MainProcess] 28461: Terminating pools
[DEBUG/MainProcess] terminating pool
[DEBUG/MainProcess] finalizing pool
[DEBUG/MainProcess] helping task handler/workers to finish
[DEBUG/MainProcess] removing tasks from inqueue until task handler finished
[DEBUG/MainProcess] joining worker handler
[DEBUG/MainProcess] worker handler exiting
[DEBUG/MainProcess] result handler found thread._state=TERMINATE
[DEBUG/MainProcess] ensuring that outqueue is not full
[DEBUG/MainProcess] result handler exiting: len(cache)=1, 
thread._state=TERMINATE
[DEBUG/MainProcess] task handler got sentinel
[DEBUG/MainProcess] task handler sending sentinel to result handler
[DEBUG/MainProcess] task handler sending sentinel to workers
[DEBUG/MainProcess] task handler exiting
[DEBUG/MainProcess] terminating workers
[DEBUG/MainProcess] joining task handler
[DEBUG/MainProcess] joining result handler
[DEBUG/MainProcess] joining pool workers
[DEBUG/MainProcess] cleaning up worker 28462
[INFO/MainProcess] 28461: Joining pools
[DEBUG/MainProcess] joining pool
[INFO/MainProcess] 28461: Closed pools
```

```
(gdb) py-bt
Traceback (most recent call first):
  File "/usr/lib/python3.9/threading.py", line 312, in wait
waiter.acquire()
  File "/usr/lib/python3.9/threading.py", line 574, in wait
signaled = self._cond.wait(timeout)
  File "/usr/lib/python3.9/multiprocessing/pool.py", line 762, in wait
self._event.wait(timeout)
  File "/usr/lib/python3.9/multiprocessing/pool.py", line 765, in get
self.wait(timeout)
  File "/home/tatac/workspaces/gerrit/bwt-device-health-manager/mp_test.py", 
line 66, in 
a.get()
(gdb) 
```

--
components: Library (Lib)
files: mp_test.py
messages: 396151
nosy: tkc17
priority: normal
severity: normal
status: open
title: multiprocessing.get hangs if the pool is closed in the signal handler
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file50121/mp_test.py

___
Python tracker 

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



[issue44337] Port LOAD_ATTR to adaptive interpreter

2021-06-19 Thread Guido van Rossum


Guido van Rossum  added the comment:

(That pull request doesn't have anything to do with this issue, but while 
testing it I did find a crash bug that I've bisected to this issue. See 
https://github.com/python/cpython/pull/26749#issuecomment-864454848.)

--

___
Python tracker 

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



[issue44337] Port LOAD_ATTR to adaptive interpreter

2021-06-19 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests:  -25387

___
Python tracker 

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



[issue44337] Port LOAD_ATTR to adaptive interpreter

2021-06-19 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum
nosy_count: 2.0 -> 3.0
pull_requests: +25387
pull_request: https://github.com/python/cpython/pull/26749

___
Python tracker 

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



[issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI

2021-06-19 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

See #44237 for another repeatedly failing (false positive) ssl test.  These and 
other randomly failing tests should be skipped for routine CI regression 
testing of PRs.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue44458] Duplicate symbol _BUFFER_BLOCK_SIZE when statically linking multiple modules

2021-06-19 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith

___
Python tracker 

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



[issue22018] signal.set_wakeup_fd() should accept sockets on Windows

2021-06-19 Thread Larry Hastings


Change by Larry Hastings :


--
nosy:  -larry

___
Python tracker 

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



[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2021-06-19 Thread Irit Katriel


Irit Katriel  added the comment:

I've reproduced this on 3.11 (though the AttributeError is now on __enter__ and 
not __exit__ as was the case in msg135484):

>>> import transaction
>>> with transaction: pass
...
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: __enter__

>>> import sys
>>> sys.__exit__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: module 'sys' has no attribute '__exit__'
>>>

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

___
Python tracker 

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



Re: Tkinter problem

2021-06-19 Thread Christian Gollwitzer

Am 19.06.21 um 07:16 schrieb Jach Feng:

Christian Gollwitzer 在 2021年6月19日 星期六下午12:27:54 [UTC+8] 的信中寫道:

Am 19.06.21 um 05:59 schrieb Jach Feng:

import tkinter as Tk
Tk



from tkinter import *
Tk



tkinter

Traceback (most recent call last):
File "", line 1, in 
NameError: name 'tkinter' is not defined



What's the point? That has no relation to the question.

"import A as B" does not define A. That's a feature, not a bug.

Christian

No, it's not. It's only because this line triggers my response:-)

label1 = tkinter.Label(master, text='Hello')


You have posted this as an answer to Liya's question about Google Colab. 
What you wrote has nothing to do with it and does not help with Liya's 
problem.


I guess you wanted to post another question? Then please open a new 
thread. In addition, the question is unclear, you just posted a 
transcript of three lines of Python.


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


Unable to remove setup of 3.9.5 from Windows 10

2021-06-19 Thread Manish Jain
Hello Team,

I have installed the Python 3.9.5 and trying to remove from the PC through
the Uninstall Program (All Possible ways - Through Control Panel or
Uninstall Python executable)

It just outputs saying Uninstall Successfully but nothing happening (Still
listed in Programs List) and even not allowing me to install again.

Please let me know if there is any alternate resolution

Thanks,
Manish
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Subpixel positioning on Tk canvas

2021-06-19 Thread Christian Gollwitzer

Am 19.06.21 um 06:26 schrieb George Furbish:

On Saturday, June 19, 2021 at 12:22:31 AM UTC-4, Christian Gollwitzer wrote:

Am 19.06.21 um 02:03 schrieb George Furbish:

Does Tk support interpolation/subpixel positioning of canvas elements? (e.g. 
images, text.) I have moving elements on my canvas, but the movement isn't very 
smooth and it's especially obvious when I have text moving alongside an image, 
since the two elements tend to jump to the next pixel at different times, 
creating a little judder between the two.

There is an "improved canvas" available, tkpath, which supports
antialiasing on all platforms. It is part of, e.g. undroidwish, if you
want to experiment with it. Last time I tested it had problems on macOS
though.


How can I enable or access the improved canvas via Tkinter?



Probably by writing the wrapper for it ;)

Sorry for that answer, but Tkinter does not support many of the most 
useful extensions for Tcl/Tk, because someone has to write the wrappers. 
It only supports what is provided by base Tk. Among those I consider 
useful and use in almost any application are:


* TkDnD for native drag'n'drop support (there is an inferior python 
package of the same name which implements local DnD only)


* tablelist - complete widget for displaying trees and tables like 
ttk::treeview, but with almost every feature one could imagine


* pdf4tcl - create a PDF from a canvas content, e.g. for printing


Basically you call Tcl via the eval() method of tkinter; in principle 
you could do



import tkinter as tk
root=tk()

root.eval('package require tkpath')
root.eval('...here comes your tkpath code...')
root.call('.tkp', 'create', 'oval', )


tkpath is described here: https://wiki.tcl-lang.org/page/tkpath

For the wrapping, look at the implementation files of Tkinter, for say, 
the original canvas, and modify accordingly.


Christian

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


Re: Tkinter problem

2021-06-19 Thread Terry Reedy

On 6/18/2021 2:28 AM, Liya Ann Sunny wrote:

I am using Colab. How could  solve this problem.
import tkinter as Tk


If you do this, import 'as tk'.


from tkinter import *


The second import overwrites the first since it imports tkinter.Tk as 
'Tk'.  Don't try to do both.



import sys
import os
#create main window
master = Tk()
master.title("tester")
master.geometry("300x100")


#make a label for the window
label1 = tkinter.Label(master, text='Hello')
# Lay out label
label1.pack()

# Run forever!
master.mainloop()
The error shows that :
 in ()
   9
  10 #create main window
---> 11 master = Tk()
  12 master.title("tester")
  13 master.geometry("300x100")

/usr/lib/python3.7/tkinter/__init__.py in __init__(self, screenName, baseName, 
className, useTk, sync, use)
2021 baseName = baseName + ext
2022 interactive = 0
-> 2023 self.tk = _tkinter.create(screenName, baseName, className, 
interactive, wantobjects, useTk, sync, use)
2024 if useTk:
2025 self._loadtk()

TclError: couldn't connect to display ":0.0"




--
Terry Jan Reedy

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


Re: Tkinter problem

2021-06-19 Thread Christian Gollwitzer

Am 19.06.21 um 05:59 schrieb Jach Feng:

import tkinter as Tk
Tk



from tkinter import *
Tk



tkinter

Traceback (most recent call last):
   File "", line 1, in 
NameError: name 'tkinter' is not defined




What's the point? That has no relation to the question.

"import A as B" does not define A. That's a feature, not a bug.

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


Re: Strange disassembly

2021-06-19 Thread Terry Reedy

On 6/18/2021 8:13 PM, Chris Angelico wrote:

On Sat, Jun 19, 2021 at 9:50 AM Terry Reedy  wrote:

Why are there two separate bytecode blocks for the "raise Exception"?


Because one block must POP_TOP and other must not.


I'd have thought that the double condition would still be evaluated as
one thing, or at least that the jump destinations for both the
early-abort and the main evaluation should be the same.


To reuse the exception block with POP_TOP, could jump over it after the
2nd compare.


Hmm, fair enough I guess. The compiler figured that it'd be faster to
duplicate the executable code rather than have the jump.


I would not assume that any alternative was considered.


It made for a
somewhat confusing disassembly, but I presume it's faster to run.


For the simplest and fasted bytecode, write normal logic and let x be
reloaded instead of duplicated and rotated.

  >>> import dis
  >>> def f(x):
... if x <= 0 or 10 <= x: raise Exception
...
...
  >>> dis.dis(f)
2   0 LOAD_FAST0 (x)
2 LOAD_CONST   1 (0)
4 COMPARE_OP   1 (<=)
6 POP_JUMP_IF_TRUE 8 (to 16)
8 LOAD_CONST   2 (10)
   10 LOAD_FAST0 (x)
   12 COMPARE_OP   1 (<=)
   14 POP_JUMP_IF_FALSE   10 (to 20)
  >>   16 LOAD_GLOBAL  0 (Exception)
   18 RAISE_VARARGS1
  >>   20 LOAD_CONST   0 (None)
   22 RETURN_VALUE
  >>>



Makes sense. I'm not sure if this would actually run faster, but I
can't really justify warping my code around the disassembly :)

Thanks for the explanation. I guess I just assumed the interpreter
would prefer a jump to the duplication, but that's a decision it's
free to take!


--
Terry Jan Reedy

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


Re: Tkinter problem

2021-06-19 Thread Jach Feng
Christian Gollwitzer 在 2021年6月19日 星期六下午1:54:46 [UTC+8] 的信中寫道:
> Am 19.06.21 um 07:16 schrieb Jach Feng:
> > Christian Gollwitzer 在 2021年6月19日 星期六下午12:27:54 [UTC+8] 的信中寫道: 
> >> Am 19.06.21 um 05:59 schrieb Jach Feng: 
> >> import tkinter as Tk 
> >> Tk 
> >>>  >>> 'C:\\Users\\jfong\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\tkinter\\__init__.py'>
> >>>  
> >> from tkinter import * 
> >> Tk 
> >>>  
> >> tkinter 
> >>> Traceback (most recent call last): 
> >>> File "", line 1, in  
> >>> NameError: name 'tkinter' is not defined 
> >> 
> >> What's the point? That has no relation to the question. 
> >> 
> >> "import A as B" does not define A. That's a feature, not a bug. 
> >> 
> >> Christian 
> > No, it's not. It's only because this line triggers my response:-) 
> >> label1 = tkinter.Label(master, text='Hello')
> You have posted this as an answer to Liya's question about Google Colab. 
> What you wrote has nothing to do with it and does not help with Liya's 
> problem. 
> 
> I guess you wanted to post another question? Then please open a new 
> thread. In addition, the question is unclear, you just posted a 
> transcript of three lines of Python. 
> 
> Christian
I posted to point out there is an error in Liya's script. It's not related to 
Colab, but it may relate to his problem. 

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


Re: Tkinter problem

2021-06-19 Thread Jach Feng
Christian Gollwitzer 在 2021年6月19日 星期六下午12:27:54 [UTC+8] 的信中寫道:
> Am 19.06.21 um 05:59 schrieb Jach Feng:
>  import tkinter as Tk 
>  Tk 
> >  > 'C:\\Users\\jfong\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\tkinter\\__init__.py'>
> >  
>  from tkinter import * 
>  Tk 
> >  
>  tkinter 
> > Traceback (most recent call last): 
> > File "", line 1, in  
> > NameError: name 'tkinter' is not defined 
> 
> What's the point? That has no relation to the question. 
> 
> "import A as B" does not define A. That's a feature, not a bug. 
> 
> Christian
No, it's not. It's only because this line triggers my response:-)
> label1 = tkinter.Label(master, text='Hello') 

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


Re: Tkinter problem

2021-06-19 Thread Jach Feng
liyaanns...@gmail.com 在 2021年6月18日 星期五下午2:28:35 [UTC+8] 的信中寫道:
> I am using Colab. How could solve this problem. 
> import tkinter as Tk 
> from tkinter import * 
> import sys 
> import os 
> #create main window 
> master = Tk() 
> master.title("tester") 
> master.geometry("300x100") 
> 
> 
> #make a label for the window 
> label1 = tkinter.Label(master, text='Hello') 
> # Lay out label 
> label1.pack() 
> 
> # Run forever! 
> master.mainloop() 
> The error shows that : 
>  in () 
> 9 
> 10 #create main window 
> ---> 11 master = Tk() 
> 12 master.title("tester") 
> 13 master.geometry("300x100") 
> 
> /usr/lib/python3.7/tkinter/__init__.py in __init__(self, screenName, 
> baseName, className, useTk, sync, use) 
> 2021 baseName = baseName + ext 
> 2022 interactive = 0 
> -> 2023 self.tk = _tkinter.create(screenName, baseName, className, 
> interactive, wantobjects, useTk, sync, use) 
> 2024 if useTk: 
> 2025 self._loadtk() 
> 
> TclError: couldn't connect to display ":0.0"

>>> import tkinter as Tk
>>> Tk

>>> from tkinter import *
>>> Tk

>>> tkinter
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'tkinter' is not defined
>>>

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


[issue44458] Duplicate symbol _BUFFER_BLOCK_SIZE when statically linking multiple modules

2021-06-19 Thread Ned Deily


Change by Ned Deily :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-06-19 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 09eb81711597725f853e4f3b659ce185488b0d8c by Sebastian Rittau in 
branch 'main':
bpo-38291: DeprecationWarning when importing typing.{io,re} (#26719)
https://github.com/python/cpython/commit/09eb81711597725f853e4f3b659ce185488b0d8c


--

___
Python tracker 

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



[issue44459] 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh

2021-06-19 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

A small patch to rinoh seems to work around the issue:

```
diff --git a/src/rinoh/resource.py b/src/rinoh/resource.py
index 57143f9d..586a4bb7 100644
--- a/src/rinoh/resource.py
+++ b/src/rinoh/resource.py
@@ -132,7 +132,9 @@ class DynamicEntryPoint(DynamicEntryPointBase):
 class DynamicRinohDistribution(ilm.Distribution):
 """Distribution for registering resource entry points to at runtime"""
 
-name = ''
+@property
+def name(self):
+return 'rinoh-dynamic-distro'
 
 def __init__(self):
 self._templates = {}

rinohtype master $ python3.10 -m pip-run --use-feature=in-tree-build -q . -- -m 
rinoh --help
usage: rinoh [-h] [-f FORMAT] [-o OPTION=VALUE] [-t NAME or FILENAME] [-s NAME 
or FILENAME] [-O FILENAME or DIRECTORY] [-p PAPER] [-i] [--list-templates]
 [--list-stylesheets] [--list-fonts [FILENAME]] [--list-formats] 
[--list-options FRONTEND] [--version] [--docs]
 [input]

Render a structured document to PDF.

positional arguments:
  input the document to render

options:
  -h, --helpshow this help message and exit
  -f FORMAT, --format FORMAT
the format of the input file (default: autodetect)
  -o OPTION=VALUE, --option OPTION=VALUE
options to be passed to the input file reader
  -t NAME or FILENAME, --template NAME or FILENAME
the document template or template configuration file to 
use (default: article)
  -s NAME or FILENAME, --stylesheet NAME or FILENAME
the style sheet used to style the document elements 
(default: the template's default)
  -O FILENAME or DIRECTORY, --output FILENAME or DIRECTORY
write the PDF output to FILENAME or to an existing 
DIRECTORY with a filename derived from the input filename (default: the current
working directory)
  -p PAPER, --paper PAPER
the paper size to render to (default: the template's 
default)
  -i, --install-resources
automatically install missing resources (fonts, 
templates, style sheets) from PyPI
  --list-templates  list the installed document templates and exit
  --list-stylesheetslist the installed style sheets and exit
  --list-fonts [FILENAME]
list the installed fonts or, if FILENAME is given, 
write a PDF file displaying all the fonts
  --list-formatslist the supported input formats and exit
  --list-options FRONTEND
list the options supported by the given frontend and 
exit
  --version show program's version number and exit
  --docsopen the online documentation in the default browser
```

Anthony, does that recommendation address the concern? Do you have any reason 
to think other users may be doing something similarly? Do you think it's worth 
adding a compatibility shim to support this improper usage?

--

___
Python tracker 

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



[issue44461] 'Pdb' object has no attribute 'botframe'

2021-06-19 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
keywords:  -3.10regression

___
Python tracker 

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



[issue44461] 'Pdb' object has no attribute 'botframe'

2021-06-19 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I was _unable_ to replicate the issue with a foo.py containing only `raise 
ValueError`, even with `python -m pdb -m foo`.

--

___
Python tracker 

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



[issue44461] 'Pdb' object has no attribute 'botframe'

2021-06-19 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I can replicate the issue with this command: `python -m pdb -m importlib` 
(since `importlib` isn't executable, it triggers an error in runpy).

--

___
Python tracker 

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



[issue44461] 'Pdb' object has no attribute 'botframe'

2021-06-19 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I encountered the same error on Python 3.9.

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



[issue24888] FileNotFoundException raised by subprocess.call

2021-06-19 Thread Irit Katriel


Irit Katriel  added the comment:

That said, the current wording does seem to imply that only CalledProcessErrors 
can be raised by this function so it might be worth clarifying that other 
exceptions can occur if the command could not run at all (without enumerating 
the precise exceptions).

--
keywords: +easy

___
Python tracker 

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



[issue44459] 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh

2021-06-19 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

It seems that even on Python 3.9 or 3.10b2, the 
[DynamicRinohDistribution](https://github.com/brechtm/rinohtype/blob/e7f1c2c6066303d86cff4105be0829f512059be2/src/rinoh/resource.py#L132)
 would return `None` for the `name` property (despite the [attempt to return 
the empty 
string](https://github.com/brechtm/rinohtype/blob/e7f1c2c6066303d86cff4105be0829f512059be2/src/rinoh/resource.py#L135)).
 The Python object model doesn't allow overriding descriptor (@property) in a 
superclass with a static class property in the subclass.

I'm struggling to understand how the DynamicRinohDistribution works at all. I 
think I see. `importlib.metadata.Distribution`, while it declares a couple of 
abstract methods, doesn't actually declare itself an abstract base class, so 
someone can subclass it and get the degenerate behavior for the abstract 
methods. That's why a DynamicRinohDistribution.metadata gets `None` for 
`self.read_text` and then `email.message_from_string(None)` returns an empty 
`Message` object.

My instinct here is that the `Distribution.name` was always expected to return 
a string and the fact that it's returning `None` is a symptom of the subclass 
not implementing the abstract methods. To be sure, type annotations might have 
helped here (if the `name` property declared that the return type is `str`, 
then `None` would be an invalid return value).

The importlib distribution discovery mechanism was designed for other package 
distribution providers to make their distributions visible. It was not designed 
with the Rinoh use-case in mind (where a distribution already installed using 
the standard finders would present other "dynamic" distributions).

Given that Rinoh is using the distribution discovery mechanism in a way that it 
was not designed to support and is unlikely to be a widespread (or even 
repeated) use-case, I'm leaning toward a recommendation that the issue be fixed 
in Rinoh by defining a name property that returns text (and preferably 
something other than the empty string).

--
priority: deferred blocker -> normal

___
Python tracker 

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



[issue44459] 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh

2021-06-19 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
priority: normal -> deferred blocker

___
Python tracker 

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



[issue16959] rlcompleter doesn't work if __main__ can't be imported

2021-06-19 Thread Irit Katriel

Irit Katriel  added the comment:

Since this is not currently a problem for you, and nobody else reported it 
since 2013, I’ll close the issue and if anyone runs into it again we can 
investigate on current python/app engine versions.

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



[issue44459] 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh

2021-06-19 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +3.10regression
priority: normal -> deferred blocker

___
Python tracker 

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



[issue44459] 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh

2021-06-19 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Running the debugger, I can confirm that Distribution.name is None in this case:

```
~ $ python3.10 -m pip-run -q rinohtype -- -m pdb -m rinoh --help
WARNING: You are using pip version 21.1.1; however, version 21.1.2 is available.
You should consider upgrading via the '/usr/local/bin/python3.10 -m pip install 
--upgrade pip' command.
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/re.py(187)sub()
-> return _compile(pattern, flags).sub(repl, string, count)
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", 
line 1709, in main
pdb._runmodule(mainpyfile)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", 
line 1541, in _runmodule
mod_name, mod_spec, code = runpy._get_module_details(module_name)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", 
line 146, in _get_module_details
return _get_module_details(pkg_main_name, error)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", 
line 110, in _get_module_details
__import__(pkg_name)
  File 
"/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rrgn/T/pip-run-w0xovt3h/rinoh/__init__.py",
 line 41, in 
from . import resource
  File 
"/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rrgn/T/pip-run-w0xovt3h/rinoh/resource.py",
 line 205, in 
from .template import DocumentTemplate
  File 
"/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rrgn/T/pip-run-w0xovt3h/rinoh/template.py",
 line 42, in 
from .stylesheets import sphinx
  File 
"/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rrgn/T/pip-run-w0xovt3h/rinoh/stylesheets/__init__.py",
 line 42, in 
.format(stylesheet.description, stylesheet))
  File 
"/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rrgn/T/pip-run-w0xovt3h/rinoh/style.py",
 line 670, in __str__
for name, entry_point in self.installed_resources:
  File 
"/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rrgn/T/pip-run-w0xovt3h/rinoh/resource.py",
 line 54, in installed_resources
for entry_point in ilm.entry_points()[cls.entry_point_group]:
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py",
 line 979, in entry_points
return SelectableGroups.load(eps).select(**params)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py",
 line 437, in load
ordered = sorted(eps, key=by_group)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py",
 line -1, in 
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/_itertools.py",
 line 16, in unique_everseen
k = key(element)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py",
 line 600, in _normalized_name
return Prepared.normalize(self.name)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py",
 line 841, in normalize
return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_')
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/re.py", line 
187, in sub
return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object

(Pdb) string is None
True
(Pdb) u
> /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py(841)normalize()
-> return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_')
(Pdb) u
> /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py(600)_normalized_name()
-> return Prepared.normalize(self.name)
(Pdb) self.name is None
True
```

--

___
Python tracker 

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



[issue44461] 'Pdb' object has no attribute 'botframe'

2021-06-19 Thread Jason R. Coombs


New submission from Jason R. Coombs :

While doing some debugging on issue44459 using Python 3.10b3, I was using Pdb 
and after troubleshooting an exception and hitting 'q' to quit, I saw the 
following:

```
(Pdb) q
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", 
line 1709, in main
pdb._runmodule(mainpyfile)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", 
line 1541, in _runmodule
mod_name, mod_spec, code = runpy._get_module_details(module_name)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", 
line 146, in _get_module_details
return _get_module_details(pkg_main_name, error)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", 
line 110, in _get_module_details
__import__(pkg_name)
  File 
"/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rrgn/T/pip-run-w0xovt3h/rinoh/__init__.py",
 line 41, in 
from . import resource
  File 
"/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rrgn/T/pip-run-w0xovt3h/rinoh/resource.py",
 line 205, in 
from .template import DocumentTemplate
  File 
"/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rrgn/T/pip-run-w0xovt3h/rinoh/template.py",
 line 42, in 
from .stylesheets import sphinx
  File 
"/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rrgn/T/pip-run-w0xovt3h/rinoh/stylesheets/__init__.py",
 line 42, in 
.format(stylesheet.description, stylesheet))
  File 
"/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rrgn/T/pip-run-w0xovt3h/rinoh/style.py",
 line 670, in __str__
for name, entry_point in self.installed_resources:
  File 
"/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rrgn/T/pip-run-w0xovt3h/rinoh/resource.py",
 line 54, in installed_resources
for entry_point in ilm.entry_points()[cls.entry_point_group]:
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py",
 line 979, in entry_points
return SelectableGroups.load(eps).select(**params)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py",
 line 437, in load
ordered = sorted(eps, key=by_group)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py",
 line -1, in 
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/_itertools.py",
 line 16, in unique_everseen
k = key(element)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py",
 line 600, in _normalized_name
return Prepared.normalize(self.name)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py",
 line 841, in normalize
return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_')
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/re.py", line 
187, in sub
return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", 
line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", 
line 86, in _run_code
exec(code, run_globals)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", 
line 1738, in 
pdb.main()
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", 
line 1730, in main
pdb.interaction(None, t)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", 
line 357, in interaction
self._cmdloop()
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", 
line 322, in _cmdloop
self.cmdloop()
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/cmd.py", 
line 138, in cmdloop
stop = self.onecmd(line)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", 
line 422, in onecmd
return cmd.Cmd.onecmd(self, line)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/cmd.py", 
line 217, in onecmd
return func(arg)
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", 
line 1118, in do_quit
self.set_quit()
  File 
"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/bdb.py", 
line 358, in set_quit
self.stopframe = self.botframe
AttributeError: 'Pdb' object has no attribute 'botframe'. Did you mean: 
'curframe'?
```

I'd not seen this error before, so I suspect there may be a regression in 3.10. 
I haven't investigated further, but I wanted to register this possible issue.

--
components: Library (Lib)
keywords: 3.10regression
messages: 396138

[issue44459] 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh

2021-06-19 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I suspect the performance enhancements to distribution deduplication are 
relevant here. Previously, distributions were deduplicated based on the 
canonical distribution name. Now they're deduplicated on the normalized name. 
And it seems that when attempting to calculate the normalized name in the 
indicated environment that the Distribution.name isn't a text string. That's a 
little surprising, but I'll investigate to see how that condition comes about.

--
assignee:  -> jaraco

___
Python tracker 

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



[issue44450] Generator expressions trace differently on Windows than on Mac

2021-06-19 Thread STINNER Victor

Change by STINNER Victor :


Removed file: https://bugs.python.org/file50119/ខ្មែរសប់លក់ទំនិញគ្រប់ប្រភេទ

___
Python tracker 

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



[issue22018] signal.set_wakeup_fd() should accept sockets on Windows

2021-06-19 Thread STINNER Victor

Change by STINNER Victor :


--
title: ខ្មែរសប់លក់ទំនិញ -> signal.set_wakeup_fd() should accept sockets on 
Windows

___
Python tracker 

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



[issue22018] ខ្មែរសប់លក់ទំនិញ

2021-06-19 Thread STINNER Victor

Change by STINNER Victor :


Removed file: https://bugs.python.org/file50120/ខ្មែរសប់លក់ទំនិញគ្រប់ប្រភេទ

___
Python tracker 

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



[issue6871] decimal.py: more format issues

2021-06-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks, Irit.

I'm closing this as "won't fix".

--
resolution: out of date -> wont fix
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



[issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration

2021-06-19 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset 533bff4e9fe221a7c9cf12795fd2d002e87bfa6a by Miss Islington (bot) 
in branch '3.9':
bpo-44426: Fix use of the C keyword 'default' as a variable name (GH-26798) 
(GH-26805)
https://github.com/python/cpython/commit/533bff4e9fe221a7c9cf12795fd2d002e87bfa6a


--

___
Python tracker 

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



[issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration

2021-06-19 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset 139c5778c26aaf25b51fcfabd88c99ba728beaea by Miss Islington (bot) 
in branch '3.10':
bpo-44426: Fix use of the C keyword 'default' as a variable name (GH-26798) 
(GH-26804)
https://github.com/python/cpython/commit/139c5778c26aaf25b51fcfabd88c99ba728beaea


--

___
Python tracker 

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



[issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration

2021-06-19 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration

2021-06-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25386
pull_request: https://github.com/python/cpython/pull/26805

___
Python tracker 

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



[issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration

2021-06-19 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset 291848195f85e23c01adb76d5a0ff9c6eb7f2614 by Mark Dickinson in 
branch 'main':
bpo-44426: Fix use of the C keyword 'default' as a variable name (GH-26798)
https://github.com/python/cpython/commit/291848195f85e23c01adb76d5a0ff9c6eb7f2614


--

___
Python tracker 

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



[issue44450] Generator expressions trace differently on Windows than on Mac

2021-06-19 Thread E. Paine

Change by E. Paine :


--
components:  -2to3 (2.x to 3.x conversion tool), Argument Clinic, Build, C API, 
Cross-Build, Demos and Tools, Distutils, Documentation, Extension Modules, 
FreeBSD, IDLE, IO, Installation, Library (Lib), Parser, Regular Expressions, 
SSL, Subinterpreters, Tests, Tkinter, Unicode, Windows, XML, asyncio, ctypes, 
email, macOS
nosy:  -Alex.Willmer, asvetlov, barry, dstufft, eric.araujo, ezio.melotti, 
habrecord22, koobs, larry, lys.nikolaou, mrabarnett, ned.deily, pablogsal, 
paul.moore, r.david.murray, ronaldoussoren, steve.dower, terry.reedy, 
tim.golden, vstinner, yselivanov, zach.ware
title: ខ្មែរសប់លក់ទំនិញ -> Generator expressions trace differently on Windows 
than on Mac
type: behavior -> 

___
Python tracker 

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



[issue22018] ខ្មែរសប់លក់ទំនិញ

2021-06-19 Thread HAK CG Gang

Change by HAK CG Gang :


--
assignee:  -> docs@python
components: +2to3 (2.x to 3.x conversion tool), Argument Clinic, Build, C API, 
Cross-Build, Demos and Tools, Distutils, Documentation, Extension Modules, 
FreeBSD, IDLE, IO, Installation, Interpreter Core, Library (Lib), Parser, 
Regular Expressions, SSL, Subinterpreters, Tests, Tkinter, Unicode, XML, 
ctypes, email, macOS
nosy: +Alex.Willmer, asvetlov, barry, cjw296, docs@python, dstufft, 
eric.araujo, ezio.melotti, koobs, larry, lys.nikolaou, mrabarnett, ned.deily, 
pablogsal, paul.moore, r.david.murray, ronaldoussoren, steve.dower, 
terry.reedy, tim.golden, zach.ware -gvanrossum, loewis, neologix, pitrou, 
python-dev
title: signal.set_wakeup_fd() should accept sockets on Windows -> 
ខ្មែរសប់លក់ទំនិញ
type:  -> security

___
Python tracker 

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



[issue22018] ខ្មែរសប់លក់ទំនិញ

2021-06-19 Thread HAK CG Gang

Change by HAK CG Gang :


Added file: https://bugs.python.org/file50120/ខ្មែរសប់លក់ទំនិញគ្រប់ប្រភេទ

___
Python tracker 

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



[issue6871] decimal.py: more format issues

2021-06-19 Thread Irit Katriel


Irit Katriel  added the comment:

No just trying to sort out the backlog.

--

___
Python tracker 

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



[issue43298] Windows build cannot detect missing Windows SDK

2021-06-19 Thread Steve Dower


Change by Steve Dower :


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



[issue43298] Windows build cannot detect missing Windows SDK

2021-06-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25384
pull_request: https://github.com/python/cpython/pull/26803

___
Python tracker 

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



[issue43298] Windows build cannot detect missing Windows SDK

2021-06-19 Thread Steve Dower


Steve Dower  added the comment:


New changeset 80190b3e533097b55077becddc75423318ab2371 by Steve Dower in branch 
'main':
bpo-43298: Improved error message when building without the Windows SDK 
installed (GH-26800)
https://github.com/python/cpython/commit/80190b3e533097b55077becddc75423318ab2371


--

___
Python tracker 

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



Re: Faker package [RESOLVED]

2021-06-19 Thread Rich Shepard

On Sat, 19 Jun 2021, MRAB wrote:


It looks like you're mixing some Python usage ("faker.names()") in with
command line usage.


MRAB,

You are correct. That was my problem.


Judging from the docs, I'd say you need something more like:
   $ faker -o temp.out name
for 1 fake name or:
   $ faker -r=10 -o temp.out name
for 10 fake names.


Thank you. I didn't pick that up when I read the document.

Much appreciated,

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


[issue43298] Windows build cannot detect missing Windows SDK

2021-06-19 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue6871] decimal.py: more format issues

2021-06-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

I tend to agree with Mark: any change would be disruptive, and it doesn't seem 
to be causing any real problem.

Irit: did you come across this because it's causing a problem somewhere?

--

___
Python tracker 

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



[issue22018] signal.set_wakeup_fd() should accept sockets on Windows

2021-06-19 Thread HAK CG Gang


Change by HAK CG Gang :


--
nosy: +habrecord22

___
Python tracker 

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



[issue44450] ខ្មែរសប់លក់ទំនិញ

2021-06-19 Thread HAK CG RAP

Change by HAK CG RAP :


--
components: +2to3 (2.x to 3.x conversion tool), Argument Clinic, Build, C API, 
Cross-Build, Demos and Tools, Distutils, Documentation, Extension Modules, 
FreeBSD, IDLE, IO, Installation, Library (Lib), Parser, Regular Expressions, 
SSL, Subinterpreters, Tests, Tkinter, Unicode, Windows, XML, asyncio, ctypes, 
email, macOS
nosy: +Alex.Willmer, asvetlov, barry, dstufft, eric.araujo, ezio.melotti, 
habrecord22, koobs, larry, lys.nikolaou, mrabarnett, ned.deily, pablogsal, 
paul.moore, r.david.murray, ronaldoussoren, steve.dower, terry.reedy, 
tim.golden, vstinner, yselivanov, zach.ware
title: Generator expressions trace differently on Windows than on Mac -> 
ខ្មែរសប់លក់ទំនិញ
type:  -> behavior
Added file: https://bugs.python.org/file50119/setext (1).tgz

___
Python tracker 

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



[issue44297] Frame with -1 line number

2021-06-19 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue44450] Generator expressions trace differently on Windows than on Mac

2021-06-19 Thread Ned Batchelder


Ned Batchelder  added the comment:

This happens with all the 3.10 betas, and does not happen in 3.9 and earlier:
https://github.com/nedbat/coveragepy/runs/2864611225
(Sorry, other failures with earlier 3.10 betas obscured the mac/win difference.)

--

___
Python tracker 

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



[issue44297] Frame with -1 line number

2021-06-19 Thread Mark Shannon


Mark Shannon  added the comment:

Thanks Anthony, that's a big help.

--

___
Python tracker 

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



[issue44460] python crashes when pandas reading parquet

2021-06-19 Thread Steve Dower


Steve Dower  added the comment:

Python 3.6 is no longer supported by us, so unless this occurs with a newer 
version (which apparently it does not), we're not going to be able to look into 
it.

If this is critical to you, you probably want to get in touch with Anaconda or 
ActiveState to see if they will provide you with support (or someone else, not 
sure who else is offering support like this right now... Quansight maybe?).

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



[issue44450] Generator expressions trace differently on Windows than on Mac

2021-06-19 Thread Mark Shannon


Mark Shannon  added the comment:

Ned, is this a regression (does 3.9 do the right thing on Windows) or an 
inconsistency between Mac and Windows?

I suspect this might have something to do with the PREDICT macros. If that the 
were the case 3.9 should show the same inconsistency between Windows and the 
Mac.

--
assignee:  -> Mark.Shannon

___
Python tracker 

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



[issue44460] python crashes when pandas reading parquet

2021-06-19 Thread Andrey Brykin


Andrey Brykin  added the comment:

pandas version is 1.1.5

--

___
Python tracker 

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



[issue44460] python crashes when pandas reading parquet

2021-06-19 Thread Andrey Brykin


New submission from Andrey Brykin :

Python crashes when running this code (I attached the error message screenshot):

import pandas as pd
d = {'col1': [[0.] * 25] * 2560}
df = pd.DataFrame(data=d)
df.to_parquet('data.parquet')
for j in range(15):
  table = pd.read_parquet('data.parquet')

There is no error when running from python 3.9.5 with the same pandas version. 
So it doesn't relate to pandas. 

The error happening with the exact list size of 2560 - no error with 2561 or 
2559. Another dimension is also important: there is no error if it is exceeding 
25.

I am running on Windows 10 2004.

--
components: IO, Windows
files: message.png
messages: 396124
nosy: brand17, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: python crashes when pandas reading parquet
type: crash
versions: Python 3.6
Added file: https://bugs.python.org/file50118/message.png

___
Python tracker 

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



[issue43298] Windows build cannot detect missing Windows SDK

2021-06-19 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue38820] Make Python compatible with OpenSSL 3.0.0

2021-06-19 Thread miss-islington


miss-islington  added the comment:


New changeset c6cd2ecdb64d16f640ff255e5a267b95974a8041 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-38820: Test with OpenSSL 3.0.0-beta1 (GH-26769) (GH-26799)
https://github.com/python/cpython/commit/c6cd2ecdb64d16f640ff255e5a267b95974a8041


--

___
Python tracker 

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



[issue29282] Fused multiply-add: proposal to add math.fma()

2021-06-19 Thread Mark Dickinson


Change by Mark Dickinson :


--
assignee: mark.dickinson -> 

___
Python tracker 

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



[issue6871] decimal.py: more format issues

2021-06-19 Thread Mark Dickinson


Mark Dickinson  added the comment:

Eric: any thoughts on this?

It's looking like a "won't fix" to me. Regardless of what we think the "right" 
thing to do is, making the float behaviour stricter would be a backwards 
compatibility break, and relaxing the Decimal behaviour involves either 
diverging from the upstream libmpdec (and then having to maintain that 
divergence if we update to newer versions of libmpdec) or pushing changes back 
upstream. Both of those options seem like more effort than it's worth for 
something that apparently hasn't actually bothered anyone for several years.

--

___
Python tracker 

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



[issue35714] Document that the null character '\0' terminates a struct format spec

2021-06-19 Thread Mark Dickinson


Mark Dickinson  added the comment:

Yes, this looks closeable. Thank you!

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



[issue38820] Make Python compatible with OpenSSL 3.0.0

2021-06-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25380
pull_request: https://github.com/python/cpython/pull/26799

___
Python tracker 

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



[issue38820] Make Python compatible with OpenSSL 3.0.0

2021-06-19 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 44fb55149934d8fb095edb6fc3f8167208035b96 by Christian Heimes in 
branch 'main':
bpo-38820: Test with OpenSSL 3.0.0-beta1 (GH-26769)
https://github.com/python/cpython/commit/44fb55149934d8fb095edb6fc3f8167208035b96


--

___
Python tracker 

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



[issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration

2021-06-19 Thread Mark Dickinson


Mark Dickinson  added the comment:

Fixed in GH-26798 (not yet merged). With that change, the documentation builds 
cleanly for me with Python 3.9.5 / Sphinx 4.0.2 / blurb 1.0.8 / 
python-docs-theme 2021.5, using the command

$ python -m sphinx -b html -W . build/html

--

___
Python tracker 

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



[issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration

2021-06-19 Thread Mark Dickinson


Change by Mark Dickinson :


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

___
Python tracker 

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



Re: Strange disassembly

2021-06-19 Thread Chris Angelico
On Sat, Jun 19, 2021 at 5:13 PM Rob Cliffe via Python-list
 wrote:
>
>
>
> On 19/06/2021 07:50, Chris Angelico wrote:
> > On Sat, Jun 19, 2021 at 4:16 PM Rob Cliffe via Python-list
> >  wrote:
> >>
> >>
> >> On 18/06/2021 11:04, Chris Angelico wrote:
> >> sys.version
> >>> '3.10.0b2+ (heads/3.10:33a7a24288, Jun  9 2021, 20:47:39) [GCC 8.3.0]'
> >> def chk(x):
> >>> ... if not(0 < x < 10): raise Exception
> >>> ...
> >> dis.dis(chk)
> >>> 2   0 LOAD_CONST   1 (0)
> >>> 2 LOAD_FAST0 (x)
> >>> 4 DUP_TOP
> >>> 6 ROT_THREE
> >>> 8 COMPARE_OP   0 (<)
> >>>10 POP_JUMP_IF_FALSE   11 (to 22)
> >>>12 LOAD_CONST   2 (10)
> >>>14 COMPARE_OP   0 (<)
> >>>16 POP_JUMP_IF_TRUE14 (to 28)
> >>>18 LOAD_GLOBAL  0 (Exception)
> >>>20 RAISE_VARARGS1
> >>>   >>   22 POP_TOP
> >>>24 LOAD_GLOBAL  0 (Exception)
> >>>26 RAISE_VARARGS1
> >>>   >>   28 LOAD_CONST   0 (None)
> >>>30 RETURN_VALUE
> >>> Why are there two separate bytecode blocks for the "raise Exception"?
> >>> I'd have thought that the double condition would still be evaluated as
> >>> one thing, or at least that the jump destinations for both the
> >>> early-abort and the main evaluation should be the same.
> >>>
> >>> ChrisA
> >> As an ornery human I could refactor this to avoid the code duplication as
> >>
> >> 2   0 LOAD_CONST   1 (0)
> >> 2 LOAD_FAST0 (x)
> >> 4 DUP_TOP
> >> 6 ROT_THREE
> >> 8 COMPARE_OP   0 (<)
> >>10 POP_JUMP_IF_TRUE10 (to 18)
> >>12 POP_TOP
> >>   >>   14 LOAD_GLOBAL  0 (Exception)
> >>16 RAISE_VARARGS1
> >>   >>   18 LOAD_CONST   2 (10)
> >>20 COMPARE_OP   0 (<)
> >>22 POP_JUMP_IF_FALSE   21 (to 14)
> >>24 LOAD_CONST   0 (None)
> >>26 RETURN_VALUE
> >>   >>>
> >>
> >> (there may be mistakes in this) but this is probably too much to expect
> >> of the compiler.
> > Hmm, I think that depends too much on knowing that the raise won't
> > return. That might be a neat optimization (effectively a form of dead
> > code removal), but otherwise, the best you could do would be to also
> > have it jump out after the raise.
> >
> > ChrisA
> Er, doesn't your original dis output make the same assumption?
> Otherwise, after this line
>
>20 RAISE_VARARGS1
>
> it would attempt to do an extra pop, then raise a second time.

In my original, I expected to see a single RAISE, with a jump over the
POP. The thing that surprised me was duplicating the RAISE to avoid
the jump. Either way, the behaviour would be the same, though.

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


Re: Strange disassembly

2021-06-19 Thread Rob Cliffe via Python-list




On 19/06/2021 07:50, Chris Angelico wrote:

On Sat, Jun 19, 2021 at 4:16 PM Rob Cliffe via Python-list
 wrote:



On 18/06/2021 11:04, Chris Angelico wrote:

sys.version

'3.10.0b2+ (heads/3.10:33a7a24288, Jun  9 2021, 20:47:39) [GCC 8.3.0]'

def chk(x):

... if not(0 < x < 10): raise Exception
...

dis.dis(chk)

2   0 LOAD_CONST   1 (0)
2 LOAD_FAST0 (x)
4 DUP_TOP
6 ROT_THREE
8 COMPARE_OP   0 (<)
   10 POP_JUMP_IF_FALSE   11 (to 22)
   12 LOAD_CONST   2 (10)
   14 COMPARE_OP   0 (<)
   16 POP_JUMP_IF_TRUE14 (to 28)
   18 LOAD_GLOBAL  0 (Exception)
   20 RAISE_VARARGS1
  >>   22 POP_TOP
   24 LOAD_GLOBAL  0 (Exception)
   26 RAISE_VARARGS1
  >>   28 LOAD_CONST   0 (None)
   30 RETURN_VALUE
Why are there two separate bytecode blocks for the "raise Exception"?
I'd have thought that the double condition would still be evaluated as
one thing, or at least that the jump destinations for both the
early-abort and the main evaluation should be the same.

ChrisA

As an ornery human I could refactor this to avoid the code duplication as

2   0 LOAD_CONST   1 (0)
2 LOAD_FAST0 (x)
4 DUP_TOP
6 ROT_THREE
8 COMPARE_OP   0 (<)
   10 POP_JUMP_IF_TRUE10 (to 18)
   12 POP_TOP
  >>   14 LOAD_GLOBAL  0 (Exception)
   16 RAISE_VARARGS1
  >>   18 LOAD_CONST   2 (10)
   20 COMPARE_OP   0 (<)
   22 POP_JUMP_IF_FALSE   21 (to 14)
   24 LOAD_CONST   0 (None)
   26 RETURN_VALUE
  >>>

(there may be mistakes in this) but this is probably too much to expect
of the compiler.

Hmm, I think that depends too much on knowing that the raise won't
return. That might be a neat optimization (effectively a form of dead
code removal), but otherwise, the best you could do would be to also
have it jump out after the raise.

ChrisA
Er, doesn't your original dis output make the same assumption? 
Otherwise, after this line


  20 RAISE_VARARGS1

it would attempt to do an extra pop, then raise a second time.
Rob Cliffe

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


Re: Strange disassembly

2021-06-19 Thread Chris Angelico
On Sat, Jun 19, 2021 at 4:16 PM Rob Cliffe via Python-list
 wrote:
>
>
>
> On 18/06/2021 11:04, Chris Angelico wrote:
>  sys.version
> > '3.10.0b2+ (heads/3.10:33a7a24288, Jun  9 2021, 20:47:39) [GCC 8.3.0]'
>  def chk(x):
> > ... if not(0 < x < 10): raise Exception
> > ...
>  dis.dis(chk)
> >2   0 LOAD_CONST   1 (0)
> >2 LOAD_FAST0 (x)
> >4 DUP_TOP
> >6 ROT_THREE
> >8 COMPARE_OP   0 (<)
> >   10 POP_JUMP_IF_FALSE   11 (to 22)
> >   12 LOAD_CONST   2 (10)
> >   14 COMPARE_OP   0 (<)
> >   16 POP_JUMP_IF_TRUE14 (to 28)
> >   18 LOAD_GLOBAL  0 (Exception)
> >   20 RAISE_VARARGS1
> >  >>   22 POP_TOP
> >   24 LOAD_GLOBAL  0 (Exception)
> >   26 RAISE_VARARGS1
> >  >>   28 LOAD_CONST   0 (None)
> >   30 RETURN_VALUE
> > Why are there two separate bytecode blocks for the "raise Exception"?
> > I'd have thought that the double condition would still be evaluated as
> > one thing, or at least that the jump destinations for both the
> > early-abort and the main evaluation should be the same.
> >
> > ChrisA
> As an ornery human I could refactor this to avoid the code duplication as
>
>2   0 LOAD_CONST   1 (0)
>2 LOAD_FAST0 (x)
>4 DUP_TOP
>6 ROT_THREE
>8 COMPARE_OP   0 (<)
>   10 POP_JUMP_IF_TRUE10 (to 18)
>   12 POP_TOP
>  >>   14 LOAD_GLOBAL  0 (Exception)
>   16 RAISE_VARARGS1
>  >>   18 LOAD_CONST   2 (10)
>   20 COMPARE_OP   0 (<)
>   22 POP_JUMP_IF_FALSE   21 (to 14)
>   24 LOAD_CONST   0 (None)
>   26 RETURN_VALUE
>  >>>
>
> (there may be mistakes in this) but this is probably too much to expect
> of the compiler.

Hmm, I think that depends too much on knowing that the raise won't
return. That might be a neat optimization (effectively a form of dead
code removal), but otherwise, the best you could do would be to also
have it jump out after the raise.

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


[issue44297] Frame with -1 line number

2021-06-19 Thread Anthony Sottile


Anthony Sottile  added the comment:

here is a minimal reproduction:

```python
def iterboom():
raise AssertionError
yield 1

next(1 for x in iterboom())
```

python 3.9:


```
$ python3.9 t.py
Traceback (most recent call last):
  File "/tmp/rinohtype/t.py", line 5, in 
next(1 for x in iterboom())
  File "/tmp/rinohtype/t.py", line 5, in 
next(1 for x in iterboom())
  File "/tmp/rinohtype/t.py", line 2, in iterboom
raise AssertionError
AssertionError
```

```
$ python3.10 t.py
Traceback (most recent call last):
  File "/tmp/rinohtype/t.py", line 5, in 
next(1 for x in iterboom())
  File "/tmp/rinohtype/t.py", line -1, in 
  File "/tmp/rinohtype/t.py", line 2, in iterboom
raise AssertionError
AssertionError
```

--

___
Python tracker 

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



[issue44459] 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh

2021-06-19 Thread Anthony Sottile


New submission from Anthony Sottile :

installed from git:

```
$ git remote -v
origin  https://github.com/brechtm/rinohtype.git (fetch)
origin  https://github.com/brechtm/rinohtype.git (push)
$ git rev-parse HEAD
4054539bae53eaddd10291c8429a1a32aeeb4786
```

working in 3.10 b2:

```console
$ ./venv310/bin/python --version --version
Python 3.10.0b2 (default, Jun  2 2021, 00:22:18) [GCC 9.3.0]
$ ./venv310/bin/python -m rinoh
usage: rinoh [-h] [-f FORMAT] [-o OPTION=VALUE] [-t NAME or FILENAME] [-s NAME 
or FILENAME]
 [-O FILENAME or DIRECTORY] [-p PAPER] [-i] [--list-templates] 
[--list-stylesheets]
 [--list-fonts [FILENAME]] [--list-formats] [--list-options 
FRONTEND] [--version] [--docs]
 [input]

Render a structured document to PDF.

positional arguments:
  input the document to render

options:
  -h, --helpshow this help message and exit
  -f FORMAT, --format FORMAT
the format of the input file (default: autodetect)
  -o OPTION=VALUE, --option OPTION=VALUE
options to be passed to the input file reader
  -t NAME or FILENAME, --template NAME or FILENAME
the document template or template configuration file to 
use (default: article)
  -s NAME or FILENAME, --stylesheet NAME or FILENAME
the style sheet used to style the document elements 
(default: the template's default)
  -O FILENAME or DIRECTORY, --output FILENAME or DIRECTORY
write the PDF output to FILENAME or to an existing 
DIRECTORY with a filename derived
from the input filename (default: the current working 
directory)
  -p PAPER, --paper PAPER
the paper size to render to (default: the template's 
default)
  -i, --install-resources
automatically install missing resources (fonts, 
templates, style sheets) from PyPI
  --list-templates  list the installed document templates and exit
  --list-stylesheetslist the installed style sheets and exit
  --list-fonts [FILENAME]
list the installed fonts or, if FILENAME is given, 
write a PDF file displaying all
the fonts
  --list-formatslist the supported input formats and exit
  --list-options FRONTEND
list the options supported by the given frontend and 
exit
  --version show program's version number and exit
  --docsopen the online documentation in the default browser
```

broken in 3.10 b3:

```console
$ ./venv/bin/python --version --version
Python 3.10.0b3+ (heads/3.10:1b4addf3cb, Jun 18 2021, 17:21:48) [GCC 9.3.0]
$ ./venv/bin/python -m rinoh
Traceback (most recent call last):
  File "/home/asottile/workspace/cpython/prefix/lib/python3.10/runpy.py", line 
187, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/home/asottile/workspace/cpython/prefix/lib/python3.10/runpy.py", line 
146, in _get_module_details
return _get_module_details(pkg_main_name, error)
  File "/home/asottile/workspace/cpython/prefix/lib/python3.10/runpy.py", line 
110, in _get_module_details
__import__(pkg_name)
  File "/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/__init__.py", 
line 41, in 
from . import resource
  File "/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/resource.py", 
line 205, in 
from .template import DocumentTemplate
  File "/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/template.py", 
line 42, in 
from .stylesheets import sphinx
  File 
"/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/stylesheets/__init__.py",
 line 42, in 
.format(stylesheet.description, stylesheet))
  File "/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/style.py", line 
670, in __str__
for name, entry_point in self.installed_resources:
  File "/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/resource.py", 
line 54, in installed_resources
for entry_point in ilm.entry_points()[cls.entry_point_group]:
  File 
"/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/__init__.py",
 line 979, in entry_points
return SelectableGroups.load(eps).select(**params)
  File 
"/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/__init__.py",
 line 437, in load
ordered = sorted(eps, key=by_group)
  File 
"/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/__init__.py",
 line -1, in 
  File 
"/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/_itertools.py",
 line 16, in unique_everseen
k = key(element)
  File 
"/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/__init__.py",
 line 600, in _normalized_name
return Prepared.normalize(self.name)
  File 
"/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/__init__.py",
 line 841, 

Re: Strange disassembly

2021-06-19 Thread Rob Cliffe via Python-list



On 18/06/2021 11:04, Chris Angelico wrote:

sys.version

'3.10.0b2+ (heads/3.10:33a7a24288, Jun  9 2021, 20:47:39) [GCC 8.3.0]'

def chk(x):

... if not(0 < x < 10): raise Exception
...

dis.dis(chk)

   2   0 LOAD_CONST   1 (0)
   2 LOAD_FAST0 (x)
   4 DUP_TOP
   6 ROT_THREE
   8 COMPARE_OP   0 (<)
  10 POP_JUMP_IF_FALSE   11 (to 22)
  12 LOAD_CONST   2 (10)
  14 COMPARE_OP   0 (<)
  16 POP_JUMP_IF_TRUE14 (to 28)
  18 LOAD_GLOBAL  0 (Exception)
  20 RAISE_VARARGS1
 >>   22 POP_TOP
  24 LOAD_GLOBAL  0 (Exception)
  26 RAISE_VARARGS1
 >>   28 LOAD_CONST   0 (None)
  30 RETURN_VALUE
Why are there two separate bytecode blocks for the "raise Exception"?
I'd have thought that the double condition would still be evaluated as
one thing, or at least that the jump destinations for both the
early-abort and the main evaluation should be the same.

ChrisA

As an ornery human I could refactor this to avoid the code duplication as

  2   0 LOAD_CONST   1 (0)
  2 LOAD_FAST    0 (x)
  4 DUP_TOP
  6 ROT_THREE
  8 COMPARE_OP   0 (<)
 10 POP_JUMP_IF_TRUE    10 (to 18)
 12 POP_TOP
    >>   14 LOAD_GLOBAL  0 (Exception)
 16 RAISE_VARARGS    1
    >>   18 LOAD_CONST   2 (10)
 20 COMPARE_OP   0 (<)
 22 POP_JUMP_IF_FALSE   21 (to 14)
 24 LOAD_CONST   0 (None)
 26 RETURN_VALUE
>>>

(there may be mistakes in this) but this is probably too much to expect 
of the compiler.

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