[issue44098] Remove ParamSpec from __parameters__ of most typing generics

2021-07-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am writing a patch which generalizes and significantly simplifies the code 
for type variables and parameter specifications substitution, and opens a way 
for more runtime validation. But it is incompatible with these changes.

--

___
Python tracker 

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



[issue44600] match/case statements trace incorrectly in 3.10.0b4

2021-07-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25937
pull_request: https://github.com/python/cpython/pull/27404

___
Python tracker 

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



[issue44756] In ./Doc, "make html" and "make build" should depend on "make venv"

2021-07-27 Thread Jack DeVries


Change by Jack DeVries :


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

___
Python tracker 

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



[issue42167] Documentation for SETUP_WITH opcode is wrong

2021-07-27 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

GH-24334 already applied the necessary change for 3.10.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue44756] In ./Doc, "make html" and "make build" should depend on "make venv"

2021-07-27 Thread Jack DeVries

New submission from Jack DeVries :

In Doc/Makefile, all of the build rules should be dependent on the existence of 
a virtual environment. I could see this being controversial, because folks who 
have these tools installed elsewhere might prefer not to have a venv made for 
them, but my personal workflow is to strive to keep my system site-packages 
folder as empty as possible and to use virtual environments frequently. In any 
case, I'm interested to hear what we think.

Momentarily, I will attach a PR where I went ahead and made these changes. Here 
is a summary of the changes:

- venv rule is now conditional, and only does anything if $VENVDIR does 
  not exist
- add rule "clean-venv". This can be removed – what do you all think?
- build rule is dependent on venv
- as a result, rules dependent on build are dependent on venv
  - html
  - latex
  - etc.
- update Doc/README.rst appropriately. Now users only need to type 
  ``make html`` – nice!

Let me know what you think. I may have a blind spot to others' workflows! Also, 
I'm not a Windows user, so I have no insight as to whether ``make.bat`` needs 
to be updated as well.

--
assignee: docs@python
components: Demos and Tools, Documentation
messages: 398344
nosy: docs@python, jack__d
priority: normal
severity: normal
status: open
title: In ./Doc, "make html" and "make build" should depend on "make venv"
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



[issue42167] Documentation for SETUP_WITH opcode is wrong

2021-07-27 Thread Dennis Sweeney


Change by Dennis Sweeney :


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

___
Python tracker 

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



[issue44752] Tab completion executes @property getter function

2021-07-27 Thread Ryan Pecor


Ryan Pecor  added the comment:

Wow, that was quick and the code looks clean too! Thanks for fixing that up!

--

___
Python tracker 

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



[issue42167] Documentation for SETUP_WITH opcode is wrong

2021-07-27 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Opcodes change from one version to another. You linked the Python 3.9 
documentation. Python 3.9 opcodes are listed here: 
https://github.com/python/cpython/blob/3.9/Lib/opcode.py (and you can browse 
the branches and commit history for that file).

3.9 has SETUP_WITH, but not WITH_CLEANUP_START, so that particular doc entry is 
all that needs to change (assuming I'm not missing anything), since it wasn't 
updated during GH-6641.

I'll open a PR against the 3.9 docs.

--
nosy: +Dennis Sweeney

___
Python tracker 

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



Re: Generate a Google Translate API token through the Socks5 proxy using gtoken.py

2021-07-27 Thread hongy...@gmail.com
On Wednesday, July 28, 2021 at 7:25:27 AM UTC+8, cameron...@gmail.com wrote:
> Just to follow on a bit to Dennis: 

But I can't any reply from Dennis in this issue.
 
> C:\Users\Wulfraed\Documents\_Hg-Repositories\Python Progs>python 
> googletrans_test.py 
> Traceback (most recent call last): 
> File "googletrans_test.py", line 4, in  
> tk = acquirer.do(text) 
> File "C:\Python38\lib\site-packages\googletrans\gtoken.py", line 194, in do 
> self._update() 
> File "C:\Python38\lib\site-packages\googletrans\gtoken.py", line 62, in 
> _update
> code = self.RE_TKK.search(r.text).group(1).replace('var ', '')
> AttributeError: 'NoneType' object has no attribute 'group'
> The implication here is that: 
> 
> self.RE_TKK.search(r.text).group(1) 
> 
> generates the error because: 
> 
> self.RE_TKK.search(r.text) 
> 
> returned None instead of a regular expression match object. That means 
> that "r.text" way not what was expected. 
> 
> Like Dennis, i note the remark "for internal use only", suggesting this 
> was some internal Google code for doing something fiddly. It may not be 
> the best thing for what you're trying to do. 
> 
> WRT to a socks proxy, Dennis showed that the issue occurs even without a 
> proxy. I would advocate doing all your debugging without trying to use 
> socks, then get to going through a socks proxy _after_ the main stuff is 
> working. 
> 
> Cheers, 
> Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue44752] Tab completion executes @property getter function

2021-07-27 Thread Jack DeVries


Jack DeVries  added the comment:

> Now that I see hasattr() uses getattr(), it looks like the tab completion 
> issue might not stem from line 155, but from line 180 
> (https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/rlcompleter.py#L180)
>  where it calls getattr().

That is correct! I was able to fix the undesirable behavior by adding an early 
exit condition if we appear to have a property object. I checked for the 
existence of a property object like this:

class Foo:

@property
def bar(self):
return 'baz'

def is_property(object, attr):
return isinstance(getattr(type(object), attr, None), property)

assert is_property(Foo(), 'bar')

The code that follows line 180 in the loop just checks if ``object.attribute`` 
is callable, and whether the callable takes arguments in order to determine 
whether to add parenthesis to the completion. In my opinion, we never really 
want to add parenthesis when providing completion for a property attribute 
anyway, so there's no reason to go through that code block if we are dealing 
with a property.

I opened a GitHub PR. Let me know what you think!

--

___
Python tracker 

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



[issue44752] Tab completion executes @property getter function

2021-07-27 Thread Jack DeVries


Change by Jack DeVries :


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

___
Python tracker 

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



[issue37715] 2to3 set default encoding

2021-07-27 Thread Benjamin Peterson


Change by Benjamin Peterson :


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



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

2021-07-27 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +25933
pull_request: https://github.com/python/cpython/pull/27400

___
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-07-27 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +25932
pull_request: https://github.com/python/cpython/pull/27399

___
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-07-27 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset ee03bad25e83b00ba5fc2a0265b48c6286e6b3f7 by Jason R. Coombs in 
branch 'main':
bpo-44461: Check early that a pdb target is valid for execution. (#27227)
https://github.com/python/cpython/commit/ee03bad25e83b00ba5fc2a0265b48c6286e6b3f7


--

___
Python tracker 

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



[issue44755] cpython Lib bisect.py overflow (lo + hi) // 2 a problem?

2021-07-27 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Thanks for the concern, but I'll close this as "not a bug". Feel free to 
re-open if you can give an example where the current code fails.

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



[issue44755] cpython Lib bisect.py overflow (lo + hi) // 2 a problem?

2021-07-27 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

This is a good idea for languages where integers are bounded, but in Python, 
integers can be as large as you want, so there's no reason to worry about 
overflow:

>>> lo = 1 * 10**100
>>> hi = 2 * 10**100
>>> (lo + hi) // 2
15000

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue44754] Documentation for pop in Built-in Types

2021-07-27 Thread Dennis Sweeney


Change by Dennis Sweeney :


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

___
Python tracker 

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



[issue44755] cpython Lib bisect.py overflow (lo + hi) // 2 a problem?

2021-07-27 Thread David Duffy


New submission from David Duffy :

https://ai.googleblog.com/2006/06/extra-extra-read-all-about-it-nearly.html

led me to change to lo+(lo+hi)/2 - would this affect bisect.py???

--
components: Library (Lib)
messages: 398337
nosy: David.Duffy
priority: normal
severity: normal
status: open
title: cpython Lib bisect.py overflow  (lo + hi) // 2 a problem?
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue44754] Documentation for pop in Built-in Types

2021-07-27 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

The [square brackets] are used to denote *optional* arguments throughout the 
documentation. A tutorial page 
(https://docs.python.org/3/tutorial/controlflow.html#id1) has this to say:

list.pop([i])

Remove the item at the given position in the list, and return it. If no 
index is specified, a.pop() removes and returns the last item in the list. (The 
square brackets around the i in the method signature denote that the parameter 
is optional, not that you should type square brackets at that position. You 
will see this notation frequently in the Python Library Reference.)

I can open a PR to try to make the "Built-in Types" page you looked at a little 
clearer.

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue44600] match/case statements trace incorrectly in 3.10.0b4

2021-07-27 Thread Brandt Bucher


Brandt Bucher  added the comment:


New changeset 38ddc8beb38d9a685de296a58b0741850e4853e5 by Brandt Bucher in 
branch 'main':
bpo-44600: Refactor new tracing tests (GH-27396)
https://github.com/python/cpython/commit/38ddc8beb38d9a685de296a58b0741850e4853e5


--

___
Python tracker 

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



[issue44600] match/case statements trace incorrectly in 3.10.0b4

2021-07-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25930
pull_request: https://github.com/python/cpython/pull/27397

___
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-07-27 Thread Steve Dower


Steve Dower  added the comment:

> do you know what the correct usage of importlib.util.spec_from_file_location 
> is to match importlib.import_module ?

Maybe I'm misreading your example, but isn't the correct usage here to pass an 
absolute location= argument? Or are you suggesting that spec_from_file_location 
should also make it absolute (in 3.10 and later, since this change has already 
been reverted in 3.8-9).

--

___
Python tracker 

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



[issue44479] Windows build doesn't regenerate some files

2021-07-27 Thread Steve Dower


Steve Dower  added the comment:

> Would it be OK to run python in externals folder instead ?

No, because it needs to freeze with the current build. However, we should 
definitely not regenerate anything when "$(Configuration) == 'PGUpdate'". 
Checking that in regen.targets should prevent the issue.

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



[issue44681] time.sleep(0.001) not working properly

2021-07-27 Thread Steve Dower


Steve Dower  added the comment:

> Maybe it would be useful to implement something like this in time.sleep() 
> itself, but I don't know whether the need in a few cases warrants the 
> increased complexity and cost in general.

It certainly wouldn't be worth the power and CPU usage impact that people would 
inevitable get tricked into causing ("why is Python always using 100% of my 
CPU!?").

So as long as I'm around, feel free to consider that idea rejected ;) We'll 
improve the resolution of sleep when the operating system does.

--

___
Python tracker 

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



[issue44600] match/case statements trace incorrectly in 3.10.0b4

2021-07-27 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +25929
pull_request: https://github.com/python/cpython/pull/27396

___
Python tracker 

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



[issue44752] Tab completion executes @property getter function

2021-07-27 Thread Ryan Pecor


Ryan Pecor  added the comment:

Actually, hasattr() specifically states that it uses getattr() so that behavior 
is expected from getattr() so I will not be creating a separate issue for that.

Now that I see hasattr() uses getattr(), it looks like the tab completion issue 
might not stem from line 155, but from line 180 
(https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/rlcompleter.py#L180)
 where it calls getattr().

A possible fix to the tab completion issue might be to add to/expand the 
warning about evaluating arbitrary C code 
(https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/rlcompleter.py#L145)
 when using tab to autocomplete.

--

___
Python tracker 

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



[issue44752] Tab completion executes @property getter function

2021-07-27 Thread Ryan Pecor


Ryan Pecor  added the comment:

It looks to me like the issue is caused by the eval() in line 155 of the 
rlcompleter.py file 
(https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/rlcompleter.py#L155)
 which runs the function in order to see if it runs or raises an exception.

I thought maybe replacing it with hasattr() might work, but it looks like the 
issue is repeated there as well!

>>> hasattr(bar, "print_value")
Foo has a value of 4
True

This goes over to the C side of things now 
(https://github.com/python/cpython/blob/196998e220d6ca030e5a1c8ad63fcaed8e049a98/Python/bltinmodule.c#L1162)
 and I'll put in another issue regarding that!

--

___
Python tracker 

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



Re: Generate a Google Translate API token through the Socks5 proxy using gtoken.py

2021-07-27 Thread Cameron Simpson
Just to follow on a bit to Dennis:

C:\Users\Wulfraed\Documents\_Hg-Repositories\Python Progs>python
googletrans_test.py
Traceback (most recent call last):
  File "googletrans_test.py", line 4, in 
tk = acquirer.do(text)
  File "C:\Python38\lib\site-packages\googletrans\gtoken.py", line 194, in 
do
self._update()
  File "C:\Python38\lib\site-packages\googletrans\gtoken.py", line 62, in 
_update
code = self.RE_TKK.search(r.text).group(1).replace('var ', '')
AttributeError: 'NoneType' object has no attribute 'group'

The implication here is that:

self.RE_TKK.search(r.text).group(1)

generates the error because:

self.RE_TKK.search(r.text)

returned None instead of a regular expression match object. That means 
that "r.text" way not what was expected.

Like Dennis, i note the remark "for internal use only", suggesting this 
was some internal Google code for doing something fiddly. It may not be 
the best thing for what you're trying to do.

WRT to a socks proxy, Dennis showed that the issue occurs even without a 
proxy. I would advocate doing all your debugging without trying to use 
socks, then get to going through a socks proxy _after_ the main stuff is 
working.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue44754] Documentation for pop in Built-in Types

2021-07-27 Thread Mark Gluzman


New submission from Mark Gluzman :

Python documentation: v.3.9.6 
The Python Standard Library >> Built-in Types >> Mutable Sequence Types

The table says that 'pop' operation should be written as 
s.pop([i]) 

The right way to do it is 
s.pop(i)

--
assignee: docs@python
components: Documentation
messages: 398329
nosy: docs@python, mark-gluzman
priority: normal
severity: normal
status: open
title: Documentation for pop in Built-in Types
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



[issue44751] crypt.h should be in _cryptmodule.c, not in public header

2021-07-27 Thread miss-islington


miss-islington  added the comment:


New changeset 196998e220d6ca030e5a1c8ad63fcaed8e049a98 by Geoffrey Thomas in 
branch 'main':
closes bpo-44751: Move crypt.h include from public header to _cryptmodule 
(GH-27394)
https://github.com/python/cpython/commit/196998e220d6ca030e5a1c8ad63fcaed8e049a98


--
nosy: +miss-islington
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



[issue44752] Tab completion executes @property getter function

2021-07-27 Thread Jack DeVries


Jack DeVries  added the comment:

Woah, til the python shell has tab completion! This does seem like undesirable 
behavior. I'd like to work on a fix for this if that's all right, assuming that 
this behavior should not occur.

I haven't exactly found where the tab autocomplete is implemented, but I'm 
assuming I'll find in one of the functions I see in the backtrace when I pause 
python at the interpreter prompt; maybe one of these? (my best quick guesses by 
function name).

- _PyRun_InteractiveLoopObject
- PyRun_InteractiveOneObjectEx
- interactive_rule
- statement_newline_rule

If anyone can point me in the right direction, that'd be great, and I think I 
can work on this one tomorrow if that's all right!

--
nosy: +jack__d

___
Python tracker 

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



[issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified

2021-07-27 Thread Alexander Smirnov


New submission from Alexander Smirnov :

after adding namer callable (like it is described in 
https://bugs.python.org/issue43344) to log handler configuration, it stopped 
removing old files

log_filename = os.path.join(log_dir, "application.log")
log_handler = logging.handlers.TimedRotatingFileHandler(log_filename, 
when='MIDNIGHT', interval=1, backupCount=7)

// after adding this line, old files are not deleted
log_handler.namer = lambda name: name.replace(".log", "") + ".log"

--
components: Library (Lib)
messages: 398326
nosy: alexander.smirnoff
priority: normal
severity: normal
status: open
title: backupCount is not respected in TimedRotatingFileHandler when namer is 
specified
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



[issue43344] RotatingFileHandler breaks file type associations

2021-07-27 Thread Alexander Smirnov


Alexander Smirnov  added the comment:

the problem with namer solution is that it will stop respecting backupCount 
parameter

--
nosy: +alexander.smirnoff

___
Python tracker 

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



[issue44752] Tab completion executes @property getter function

2021-07-27 Thread Ryan Pecor


Ryan Pecor  added the comment:

I forgot to mention that I also added "~~~" to either side of the printed 
string every time it printed to help differentiate the printed string from 
commands that I typed into the interpreter.

--

___
Python tracker 

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



[issue44688] [sqlite3] Remove ASCII limitation from sqlite3.Connection.create_collation()

2021-07-27 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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

___
Python tracker 

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



[issue44752] Tab completion executes @property getter function

2021-07-27 Thread Ryan Pecor


New submission from Ryan Pecor :

After making a class using the @property decorator to implement a getter, using 
tab completion that matches the getter function name executes the function. 

See below for example (line numbers added,  indicates when the user 
presses the tab key):

1  >>> class Foo(object):
2  ... def __init__(self,value):
3  ... self.value = value
4  ... @property
5  ... def print_value(self):
6  ... print("Foo has a value of {}".format(self.value))
7  ... 
8  >>> bar = Foo(4)
9  >>> bar.~~~Foo has a value of 4~~~
10 ~~~Foo has a value of 4~~~
11 
12 bar.print_value  bar.value
13 >>> bar.p~~~Foo has a value of 4~~~
14 rint_value~~~Foo has a value of 4~~~
15 ~~~Foo has a value of 4~~~
16 
17 bar.print_value
18 >>> bar.value

I pressed tab after typing "bar." in line 9. It then printed the remainder of 
line 9 and moved the cursor to line 10. Pressing tab again prints line 10 and 
11 before finally showing the expected output on line 12. lines 13-17 follow 
the same steps, but after typing "bar.p" to show that it happens whenever you 
tab and it matches the getter. Line 18 shows a correct tab completion resulting 
from hitting tab after typing "bar.v" which does not match the getter function.

--
components: Interpreter Core
messages: 398323
nosy: RPecor
priority: normal
severity: normal
status: open
title: Tab completion executes @property getter function
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue32635] test_crypt segfaults when using libxcrypt instead of libcrypt

2021-07-27 Thread Geoffrey Thomas


Geoffrey Thomas  added the comment:

Opened #44751 and https://github.com/python/cpython/pull/27394 .

--

___
Python tracker 

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



[issue44751] crypt.h should be in _cryptmodule.c, not in public header

2021-07-27 Thread Geoffrey Thomas


Change by Geoffrey Thomas :


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

___
Python tracker 

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



[issue44751] crypt.h should be in _cryptmodule.c, not in public header

2021-07-27 Thread Geoffrey Thomas


New submission from Geoffrey Thomas :

In #32635, it was discovered that _cryptmodule.c was missing a dependency on 
crypt.h, which caused it to segfault when it was missing the proper prototype 
for crypt. This was fixed by adding an #include  to Python.h.

This include doesn't need to be in the public header; it only needs to be in 
_cryptmodule.c. Removing it from the public header is helpful for packagers, 
because it means that the libpython-dev (or whatever) package doesn't need a 
dependency on libcrypt-dev, only on the libcrypt runtime library.

--
components: C API
messages: 398321
nosy: geofft
priority: normal
severity: normal
status: open
title: crypt.h should be in _cryptmodule.c, not in public header
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue43377] _PyErr_Display should be available in the CPython-specific API

2021-07-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

PyErr_Display is not exposed partially because is full of small details of the 
interpreter and we change it constantly without regard for backwards 
compatibility on purpose. Exposing it will restrict us a lot on how we display 
error messages or the arguments it may take, so I woulf prefer to not expose it.

--
nosy: +pablogsal

___
Python tracker 

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



[issue34013] Inconsistent SyntaxError for print

2021-07-27 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue44750] .popitem() is inconsistent in collections and collections.abc

2021-07-27 Thread Alex Waygood


Alex Waygood  added the comment:

Thanks, Raymond -- that makes sense, and seems very fair. I still think a note 
somewhere in the documentation stating this might be helpful -- as a user, it 
wasn't what I was expecting. I would argue this is especially true for 
UserDict, a class which the name implies will be extremely `dict`-like in 
behaviour. Just my two cents, though.

--

___
Python tracker 

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



[issue34013] Inconsistent SyntaxError for print

2021-07-27 Thread miss-islington


miss-islington  added the comment:


New changeset 68e3dca0687c4c8e61ed98aed82f81049880c0ce by Miss Islington (bot) 
in branch '3.10':
bpo-34013: Move the Python 2 hints from the exception constructor to the parser 
(GH-27392)
https://github.com/python/cpython/commit/68e3dca0687c4c8e61ed98aed82f81049880c0ce


--

___
Python tracker 

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



[issue44750] .popitem() is inconsistent in collections and collections.abc

2021-07-27 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Alex, thank for noticing this, but it is not a bug.

MutableMapping is meant to describe all mapping classes including those that 
don't remember insertion order.

The builtin dict() type implements MutableMapping but also adds ordering 
guarantees.  It is common and normal for concrete classes to implement 
additional behaviors and guarantees beyond those specified in the abstract base 
class.

--
assignee:  -> rhettinger
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



[issue34013] Inconsistent SyntaxError for print

2021-07-27 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 15.0 -> 16.0
pull_requests: +25926
pull_request: https://github.com/python/cpython/pull/27393

___
Python tracker 

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



[issue34013] Inconsistent SyntaxError for print

2021-07-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset ecc3c8e4216958d85385bf2467441c975128f26c by Pablo Galindo Salgado 
in branch 'main':
bpo-34013: Move the Python 2 hints from the exception constructor to the parser 
(GH-27392)
https://github.com/python/cpython/commit/ecc3c8e4216958d85385bf2467441c975128f26c


--

___
Python tracker 

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



Wing Python IDE version 8 has been released

2021-07-27 Thread Wingware
Wing 8 is a major new release that introduces support for development on 
Docker and LXC/LXD containers and Docker Compose clusters, a Python 
package management tool, improved project creation, improved static 
analysis and code warnings, support for Python 3.10, a native Apple 
Silicon (M1) build, a new Nord style theme, reduced application startup 
time, and much more.


Details:  https://wingware.com/news/2021-07-26
Downloads:   https://wingware.com/downloads

== About Wing ==

Wing is a light-weight but full-featured Python IDE designed 
specifically for Python, with powerful editing, code inspection, 
testing, and debugging capabilities. Wing's deep code analysis provides 
auto-completion, auto-editing, and refactoring that speed up 
development. Its top notch debugger works with any Python code, locally 
or on a remote host, container, or cluster. Wing also supports 
test-driven development, version control, UI color and layout 
customization, and includes extensive documentation and support.


Wing is available in three product levels:  Wing Pro is the 
full-featured Python IDE for professional developers, Wing Personal is a 
free Python IDE for students and hobbyists (omits some features), and 
Wing 101 is a very simplified free Python IDE for beginners (omits many 
features).


Learn more at https://wingware.com/


___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[issue42167] Documentation for SETUP_WITH opcode is wrong

2021-07-27 Thread Patrick Reader


Patrick Reader  added the comment:

It was, at least partially, replaced by BEGIN_WITH for bpo-40222: 
https://github.com/python/cpython/commit/adcd2205565f91c6719f4141ab4e1da6d7086126#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653bL741

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



[issue42167] Documentation for SETUP_WITH opcode is wrong

2021-07-27 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Note that SETUP_WITH doc was completely removed. Not sure if that was 
intentional (since the opcode itself still exists).

--
nosy: +andrei.avk

___
Python tracker 

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



ANN: Wing Python IDE version 8 has been released

2021-07-27 Thread Wingware
Wing 8 is a major new release that introduces support for development on 
Docker and LXC/LXD containers and Docker Compose clusters, a Python 
package management tool, improved project creation, improved static 
analysis and code warnings, support for Python 3.10, a native Apple 
Silicon (M1) build, a new Nord style theme, reduced application startup 
time, and much more.


Details:  https://wingware.com/news/2021-07-26
Downloads:   https://wingware.com/downloads

== About Wing ==

Wing is a light-weight but full-featured Python IDE designed 
specifically for Python, with powerful editing, code inspection, 
testing, and debugging capabilities. Wing's deep code analysis provides 
auto-completion, auto-editing, and refactoring that speed up 
development. Its top notch debugger works with any Python code, locally 
or on a remote host, container, or cluster. Wing also supports 
test-driven development, version control, UI color and layout 
customization, and includes extensive documentation and support.


Wing is available in three product levels:  Wing Pro is the 
full-featured Python IDE for professional developers, Wing Personal is a 
free Python IDE for students and hobbyists (omits some features), and 
Wing 101 is a very simplified free Python IDE for beginners (omits many 
features).


Learn more at https://wingware.com/


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


[issue37715] 2to3 set default encoding

2021-07-27 Thread Thomas Grainger


Thomas Grainger  added the comment:

lib2to3 is deprecated and is pending removal, so I think this can be closed

--
nosy: +graingert

___
Python tracker 

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



[issue44750] .popitem() is inconsistent in collections and collections.abc

2021-07-27 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +rhettinger, stutzbach

___
Python tracker 

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



[issue34013] Inconsistent SyntaxError for print

2021-07-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset b977f8510e2ff4f11e3bda920722098a242fc8cc by Pablo Galindo Salgado 
in branch '3.10':
[3.10] bpo-34013: Generalize the invalid legacy statement error message 
(GH-27389). (GH-27391)
https://github.com/python/cpython/commit/b977f8510e2ff4f11e3bda920722098a242fc8cc


--

___
Python tracker 

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



[issue42035] [C API] PyType_GetSlot cannot get tp_name

2021-07-27 Thread hai shi


hai shi  added the comment:

> - there is still no way to get t.tp_name
  Can we create PyType_GetDataSlot function to return the data pointer?

> If we go this way, why not add PyType_GetQualName as well?
  +1. I will create another PR after PR-23903 merged.

--

___
Python tracker 

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



[issue44750] .popitem() is inconsistent in collections and collections.abc

2021-07-27 Thread Alex Waygood


New submission from Alex Waygood :

In a Python dictionary, `.popitem()` returns (key, value) pairs from the 
dictionary in a LIFO order. `collections.OrderedDict` and `collections.Counter` 
both do the same. However, a class inheriting from 
`collections.abc.MutableMapping` (which includes, in the standard library, 
`collections.UserDict`), will inherit a `.popitem()` method that returns (key, 
value) pairs in a FIFO order.

In my opinion, this seems like unexpected behaviour, given that these classes 
are designed to emulate the API of a standard Python dict.

The documentation for ordinary dictionaries states that `.popitem()` uses LIFO 
(https://docs.python.org/3/library/stdtypes.html#typesmapping), as does 
`collections.OrderedDict` 
(https://docs.python.org/3/library/collections.html#collections.OrderedDict). 
However, I can't find anything in the documentation for the collections.abc 
module (https://docs.python.org/3/library/collections.abc.html) or the 
docstring for `collections.abc.MutableMapping.popitem()` 
(https://github.com/python/cpython/blob/ae0a2b756255629140efcbe57fc2e714f0267aa3/Lib/_collections_abc.py#L964)
 that states that collections.abc.MutableMapping will use FIFO. Ditto for the 
collections.UserDict documentation/docstring: 
https://docs.python.org/3/library/collections.html#collections.UserDict, 
https://github.com/python/cpython/blob/6948964ecf94e858448dd28eea634317226d2913/Lib/collections/__init__.py#L1084.

Is this expected/intended behaviour? I found it highly confusing when 
attempting to implement a custom data structure just now. I think a note in the 
docstring/documentation, noting that this is the behaviour, would certainly be 
useful.

I have attached a minimal demonstration of this behaviour. Tests only done on 
Python 3.9.

--
components: Library (Lib)
files: collections popitem weirdness.py
messages: 398310
nosy: AlexWaygood
priority: normal
severity: normal
status: open
title: .popitem() is inconsistent in collections and collections.abc
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file50187/collections popitem weirdness.py

___
Python tracker 

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



[issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence

2021-07-27 Thread Pierre Quentel


Pierre Quentel  added the comment:

Oh, I did not invent this class, it is in the test script for pattern matching 
: 
https://github.com/python/cpython/blob/6948964ecf94e858448dd28eea634317226d2913/Lib/test/test_patma.py#L1932

With this class, [x, *_, y] matches, but not [x, *w, y] : this is what made me 
create this issue. Maybe it would be a good idea to change this class in 
test_patma.py ?

OTOH, if the current implementation remains the same, why does the PEP insist 
on subjects having a len() ? Could sequence patterns match a wider range of 
subjects that can be unpacked ?

--

___
Python tracker 

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



[issue34013] Inconsistent SyntaxError for print

2021-07-27 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +25925
pull_request: https://github.com/python/cpython/pull/27392

___
Python tracker 

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



[issue33896] Document what components make up the filecmp.cmp os.stat signature.

2021-07-27 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Can be closed as a dupe of https://bugs.python.org/issue42958, which has a PR 
ready for review.

--
nosy: +andrei.avk

___
Python tracker 

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



[issue44746] Improper behaviour of 'finally' keyword

2021-07-27 Thread Priyanshu

Priyanshu  added the comment:

Really? Why is it not working for me then? I am using the latest version of
VS code application. I have attached a screenshot,have a look at this.

On Tue, Jul 27, 2021 at 6:22 PM Paul Moore  wrote:

>
> Paul Moore  added the comment:
>
> It works as expected (the print statement in the "finally" clause is
> executed) for me.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--
Added file: https://bugs.python.org/file50186/error.py - Visual Studio Code 
27_07_2021 6_50_36 PM.png

___
Python tracker 

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



[issue34013] Inconsistent SyntaxError for print

2021-07-27 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +25924
pull_request: https://github.com/python/cpython/pull/27391

___
Python tracker 

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



[issue34013] Inconsistent SyntaxError for print

2021-07-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 6948964ecf94e858448dd28eea634317226d2913 by Pablo Galindo Salgado 
in branch 'main':
bpo-34013: Generalize the invalid legacy statement error message (GH-27389)
https://github.com/python/cpython/commit/6948964ecf94e858448dd28eea634317226d2913


--

___
Python tracker 

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



[issue34013] Inconsistent SyntaxError for print

2021-07-27 Thread Ammar Askar


Change by Ammar Askar :


--
pull_requests: +25923
pull_request: https://github.com/python/cpython/pull/27390

___
Python tracker 

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



[issue44746] Improper behaviour of 'finally' keyword

2021-07-27 Thread Priyanshu


Priyanshu  added the comment:

Ok, I'll check it out.
Thank you for the response.

On Tue, 27 Jul, 2021, 20:36 Steven D'Aprano,  wrote:

>
> Steven D'Aprano  added the comment:
>
> Confirmed that it is working in Linux. I assume Paul has tested it under
> Windows, and it sounds like Ronald has tested it in VS Code as well.
>
> I'm closing this as Not A Bug.
>
> Priyanshu, if you disagree and can replicate the error, this time checking
> the output buffer, please reply with a new example.
>
> --
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue29298] argparse fails with required subparsers, un-named dest, and empty argv

2021-07-27 Thread Petr Viktorin


Change by Petr Viktorin :


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



[issue43235] Tools/scripts/stable_abi.py should also check PC/python3dll.c (Windows stable ABI)

2021-07-27 Thread Petr Viktorin


Petr Viktorin  added the comment:

Since PEP 652, PC/python3dll.c is generated from the stable ABI definition.
Checking (i.e. running the tool without --generate) ensures it is up-to-date.

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



Re: Track 3.9 instead of 3.10?

2021-07-27 Thread Chris Angelico
On Wed, Jul 28, 2021 at 1:05 AM Skip Montanaro  wrote:
>
> I have a development branch in my fork of python/cpython, the
> register2 branch of https://github.com/smontanaro/cpython. As I am
> dealing with virtual machine internals I've found the changes to the
> virtual machine between 3.9 and 3.10 too disruptive. I'd like to track
> 3.9 instead. How would I go about making the switch while minimizing
> the number of (inevitable) conflicts? I was thinking of diffing my
> current state against 3.10, then creating a new branch off 3.9 and
> applying the diff to that. That makes most of the effort outside of
> the view of git though, and won't necessarily minimize conflicts. Is
> there some way to do this totally within the git infrastructure?
>

If your changes (on top of 3.10) aren't too invasive, you could rebase
those changes on top of 3.9, or cherry-pick them one by one. That
would be a more granular way to "diff [your] current state against
3.10" (assuming you've been making those changes as individual
commits).

Check out the "rebase --onto" operation:

https://git-scm.com/docs/git-rebase

The first example of --onto (regarding master/next/topic branches) is
what I think you're trying to do.

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


[issue43377] _PyErr_Display should be available in the CPython-specific API

2021-07-27 Thread Petr Viktorin


Petr Viktorin  added the comment:

If it should be exposed, it should be renamed to a public (non-underscored) 
name, like PyErr_DisplayToFile. It should also ideally get documentation and 
tests (along with PyErr_Display, which is sadly missing those as well).


(Also, note that there are no no API/ABI compatibility guarantees if you use 
private API or define Py_BUILD_CORE. Functions like _PyErr_Display could 
change/disappear in a patch version of CPython.)

--
nosy: +petr.viktorin

___
Python tracker 

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



[issue44559] Enum: revert to 3.9

2021-07-27 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 2f54fbafa6481fb10528cb1d3d6b517ca2a4647f by Steffen Zeile in 
branch 'main':
bpo-44559: [Enum] correct `versionadded` to 3.11 for new features (GH-27388)
https://github.com/python/cpython/commit/2f54fbafa6481fb10528cb1d3d6b517ca2a4647f


--

___
Python tracker 

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



[issue44559] Enum: revert to 3.9

2021-07-27 Thread Roundup Robot


Change by Roundup Robot :


--
nosy: +python-dev
nosy_count: 6.0 -> 7.0
pull_requests: +25922
pull_request: https://github.com/python/cpython/pull/27388

___
Python tracker 

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



[issue44746] Improper behaviour of 'finally' keyword

2021-07-27 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Confirmed that it is working in Linux. I assume Paul has tested it under 
Windows, and it sounds like Ronald has tested it in VS Code as well.

I'm closing this as Not A Bug.

Priyanshu, if you disagree and can replicate the error, this time checking the 
output buffer, please reply with a new example.

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



Track 3.9 instead of 3.10?

2021-07-27 Thread Skip Montanaro
I have a development branch in my fork of python/cpython, the
register2 branch of https://github.com/smontanaro/cpython. As I am
dealing with virtual machine internals I've found the changes to the
virtual machine between 3.9 and 3.10 too disruptive. I'd like to track
3.9 instead. How would I go about making the switch while minimizing
the number of (inevitable) conflicts? I was thinking of diffing my
current state against 3.10, then creating a new branch off 3.9 and
applying the diff to that. That makes most of the effort outside of
the view of git though, and won't necessarily minimize conflicts. Is
there some way to do this totally within the git infrastructure?

Thx,

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


[issue44021] enum docs in 3.10: missing "New in version 3.10"

2021-07-27 Thread Akuli


Change by Akuli :


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



[issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence

2021-07-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

Given that the class used to demonstrate this behavior has a bug (__len__ is 
inconsistent with __getitem__), I don't think it matters much -- if doing it 
your way is (as I suspect) slower than the current implementation for other 
(well-behaved) sequences, we should not change the implementation.

--

___
Python tracker 

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



[issue44098] Remove ParamSpec from __parameters__ of most typing generics

2021-07-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yeah, but we shouldn't go out of our way to reject it. Especially since in 3.11 
we'll likely have something equivalent to PEP 563 or PEP 649 (the SC is 
thinking deep about this right now) and either of those means that usually it 
won't be evaluated at all anyway (you'd have to call get_type_hints() with PEP 
563, or use __annotations__ with the other).

--

___
Python tracker 

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



[issue44749] LOAD_NAME not using PyObject_GetItem when globals() is a dict subclass

2021-07-27 Thread Douglas Raillard


New submission from Douglas Raillard :

Re-raising the bug reported by Kevin Shweh:
thread: https://bugs.python.org/issue14385
message: https://bugs.python.org/msg337245

Here is a copy for easier reference:

The patch for this issue changed LOAD_GLOBAL to use PyObject_GetItem when 
globals() is a dict subclass, but LOAD_NAME, STORE_GLOBAL, and DELETE_GLOBAL 
weren't changed. (LOAD_NAME uses PyObject_GetItem for builtins now, but not for 
globals.)

This means that global lookup doesn't respect overridden __getitem__ inside a 
class statement (unless you explicitly declare the name global with a global 
statement, in which case LOAD_GLOBAL gets used instead of LOAD_NAME).

I don't have a strong opinion on whether STORE_GLOBAL or DELETE_GLOBAL should 
respect overridden __setitem__ or __delitem__, but the inconsistency between 
LOAD_GLOBAL and LOAD_NAME seems like a bug that should be fixed.

For reference, in the following code, the first 3 exec calls successfully print 
5, and the last exec call fails, due to the LOAD_GLOBAL/LOAD_NAME inconsistency:

class Foo(dict):
def __getitem__(self, index):
return 5 if index == 'y' else super().__getitem__(index)
 
exec('print(y)', Foo())
exec('global y; print(y)', Foo())
exec('''
class UsesLOAD_NAME:
global y
print(y)''', Foo())
exec('''
class UsesLOAD_NAME:
print(y)''', Foo())


I encountered the same issue when trying to create a way to "instantiate" 
modules with some globals replaced by user-defined values to make a 
dependency-injection system. I therefore want to lookup some names in a 
separate dict rather than getting the value normally bound in that module 
(typically by an import statement).

--
components: Interpreter Core
messages: 398299
nosy: douglas-raillard-arm
priority: normal
severity: normal
status: open
title: LOAD_NAME not using PyObject_GetItem when globals() is a dict subclass
versions: Python 3.10

___
Python tracker 

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



[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2021-07-27 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset 890e22957d427ee994b85d62dfe4d5a7cbd34ec5 by Erlend Egeberg 
Aasland in branch 'main':
bpo-42064: Migrate to `sqlite3_create_collation_v2` (GH-27156)
https://github.com/python/cpython/commit/890e22957d427ee994b85d62dfe4d5a7cbd34ec5


--

___
Python tracker 

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



[issue44746] Improper behaviour of 'finally' keyword

2021-07-27 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The output from the print statement in the finally block is before the 
traceback, you need to scroll back in the output buffer in VS Code.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue44744] [security] Open redirect attack due to insufficient validation in Urlparse

2021-07-27 Thread Logan Jones


Logan Jones  added the comment:

If I've understood what you've written correctly, what you want is to change 
urlparse to use the WHATWG URL Standard (https://url.spec.whatwg.org/).

I'm not a committer or anything, but that seems like a large API change and is 
not likely to happen quickly if at all. I'm not sure what the path forward here 
is. There are many options, creating a new function/module, slowly deprecating 
the current urlparse function, or just say it's not our problem. Hopefully 
someone else can weigh in.

In the meantime, a project like https://pypi.org/project/whatwg-url/ claims to 
implement the WHATWG URL standard.

--

___
Python tracker 

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



[issue44746] Improper behaviour of 'finally' keyword

2021-07-27 Thread Paul Moore


Paul Moore  added the comment:

It works as expected (the print statement in the "finally" clause is executed) 
for me.

--

___
Python tracker 

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



[issue44746] Improper behaviour of 'finally' keyword

2021-07-27 Thread Priyanshu


Priyanshu  added the comment:

I have attached a file as an example. The finally clause is not getting 
executed if we make use of raise keyword in except clause. It should have been 
executed in this case case, right?

--
Added file: https://bugs.python.org/file50185/error.py

___
Python tracker 

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



Re: a simple question

2021-07-27 Thread Terry Reedy

On 7/26/2021 6:19 PM, Glenn Wilson via Python-list wrote:

I recently downloaded the latest version of python, 3.9.6. Everything works 
except, the turtle module. I get an error message every time , I use basic 
commands like forward, backward, right and left. My syntax is correct: 
pat.forward(100) is an example. Can you tell me what is wrong.


On Windows, normal install,
C:\Users\Terry>py -3.9 -m turtle
C:\Users\Terry>py -3.9 -m turtledemo
both work.


--
Terry Jan Reedy

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


Generate a Google Translate API token through the Socks5 proxy using gtoken.py

2021-07-27 Thread hongy...@gmail.com
I want to use 
[gtoken.py](https://github.com/ssut/py-googletrans/blob/master/googletrans/gtoken.py)
 through a socks5 proxy. Based on the comment 
[here](https://github.com/encode/httpx/issues/203#issuecomment-611914974) and 
the example usage in 
[gtoken.py](https://github.com/ssut/py-googletrans/blob/d15c94f176463b2ce6199a42a1c517690366977f/googletrans/gtoken.py#L29),
 I tried with the following method, but failed:
```python
(datasci) werner@X10DAi:~$ ipython
Python 3.9.1 (default, Feb 10 2021, 15:30:33) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.23.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import socks

In [2]: import socket

In [3]: socks.set_default_proxy(socks.SOCKS5, "127.0.0.1", 18889)
   ...: socket.socket = socks.socksocket

In [4]: from googletrans.gtoken import TokenAcquirer

In [5]: acquirer=TokenAcquirer()

In [6]: text = 'test'

In [7]: tk= acquirer.do(text)
---
AttributeErrorTraceback (most recent call last)
 in 
> 1 tk= acquirer.do(text)

~/.pyenv/versions/3.9.1/envs/datasci/lib/python3.9/site-packages/googletrans/gtoken.py
 in do(self, text)
192 
193 def do(self, text):
--> 194 self._update()
195 tk = self.acquire(text)
196 return tk

~/.pyenv/versions/3.9.1/envs/datasci/lib/python3.9/site-packages/googletrans/gtoken.py
 in _update(self)
 60 
 61 # this will be the same as python code after stripping out a 
reserved word 'var'
---> 62 code = self.RE_TKK.search(r.text).group(1).replace('var ', '')
 63 # unescape special ascii characters such like a \x3d(=)
 64 code = code.encode().decode('unicode-escape')

AttributeError: 'NoneType' object has no attribute 'group'
```
Any hints for this problem will be highly appreciated.

Regards,
HY
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue42035] [C API] PyType_GetSlot cannot get tp_name

2021-07-27 Thread Petr Viktorin


Petr Viktorin  added the comment:

Sorry for the delay; getting 652 into Python 3.10 took up most of my time.


So, in the current proposal:
- `PyType_GetName(t)` is equivalent to `PyObject_GetAttrString(t, "__name__")`
- for the qualified name you can use `PyObject_GetAttrString(t, "__qualname__")`
- there is still no way to get t.tp_name

The advantage of PyType_GetName over a regular getattr is that it's fast for 
heap types (there's no dict lookup, and the string object is cached as 
ht_name). For static types, it's a bit slower (a string object needs to be 
built, but still there's no dict lookup).

If we go this way, why not add PyType_GetQualName as well?

(Is the speed, compared to getattr, worth adding two new functions? I guess it 
is, barely.)



The OP specifically requested a way to get tp_name, which the current PR does 
not do. I don't think it should, either:
- there's no way to assure that `char* tp_name` is not deallocated before the 
caller is done with it (especially considering that other Python 
implementations should be able to implement the stable ABI, and those shouldn't 
need store tp_name as char*).
- there is already __name__ and __qualname__ (and __module__); tp_name is a 
weird mix that I, personally, won't miss if it goes away. I think it's OK to 
only use it for creation (as PyType_Spec.name), and then expose the 
__name__/__module__ derived from it. It's not how CPython works, but that's OK 
for the limited API.

--

___
Python tracker 

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



[issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking

2021-07-27 Thread Thomas Grainger


Thomas Grainger  added the comment:

> using a per-descriptor `WeakKeyDictionary` to map the instance to locks 
> (which would of course not work - is there any way to map unhashable 
> instances weakly?)

there's an issue for that too: https://bugs.python.org/issue44140

--

___
Python tracker 

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



[issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking

2021-07-27 Thread Thomas Grainger


Thomas Grainger  added the comment:

how about deprecating the functools.cached_property?

--
nosy: +graingert

___
Python tracker 

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



[issue44021] enum docs in 3.10: missing "New in version 3.10"

2021-07-27 Thread Ken Jin


Ken Jin  added the comment:

I think we can close this. The current docs show the version added for the 
items in OP's list https://docs.python.org/3.11/library/enum.html.

Their versionadded should be 3.11 now, but that's a separate issue with a PR at 
GH-27388.

--
nosy: +kj

___
Python tracker 

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



[issue34013] Inconsistent SyntaxError for print

2021-07-27 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue44748] argparse: a bool indicating if arg was encountered

2021-07-27 Thread Thermi


New submission from Thermi :

It'd be great if as part of the namespace returned by 
argparse.ArgumentParser.parse_args(), there was a bool indicating if a specific 
argument was encountered.

That could then be used to implement the following behaviour:
With a config file loaded as part of the program, overwrite the values loaded 
from the config file if the argument was encountered in the argument vector.

That's necessary to implement overwriting of settings that were previously set 
by a different mechanism, e.g. read from a config file.

After all the following order of significance should be used:
program defaults < config file < argument vector

--
components: Library (Lib)
messages: 398288
nosy: Thermi
priority: normal
severity: normal
status: open
title: argparse: a bool indicating if arg was encountered
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



[issue44740] Lowercase "Internet" and "web" in docs

2021-07-27 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset be2415487ab80e4bd5ace2954651e78b107b17e4 by Miss Islington (bot) 
in branch '3.10':
bpo-44740: Make minor edits to lowercasing "internet" and "web". (GH-27385) 
(#27386)
https://github.com/python/cpython/commit/be2415487ab80e4bd5ace2954651e78b107b17e4


--

___
Python tracker 

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



[issue44747] Reduce usage of sys._getframe at typing module

2021-07-27 Thread Yurii Karabas


Change by Yurii Karabas <1998uri...@gmail.com>:


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

___
Python tracker 

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



[issue44747] Reduce usage of sys._getframe at typing module

2021-07-27 Thread Yurii Karabas


New submission from Yurii Karabas <1998uri...@gmail.com>:

While I was working with `typing` I have notice that there are duplication of 
`_getframe` usage. While In scope of issue 44353 I introduced `typing._callee` 
function which allow to return module name of a caller function.

In scope of this issue we will reduce the usage of `_getframe` usage. It will 
be used only in one place, at `_callee` function.

--
components: Library (Lib)
messages: 398286
nosy: uriyyo
priority: normal
severity: normal
status: open
title: Reduce usage of sys._getframe at typing 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



[issue44740] Lowercase "Internet" and "web" in docs

2021-07-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25919
pull_request: https://github.com/python/cpython/pull/27386

___
Python tracker 

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



[issue44740] Lowercase "Internet" and "web" in docs

2021-07-27 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 2e41df4d60d71a2551b9605d07321f75cfb52adf by Mariusz Felisiak in 
branch 'main':
bpo-44740: Make minor edits to lowercasing "internet" and "web". (GH-27385)
https://github.com/python/cpython/commit/2e41df4d60d71a2551b9605d07321f75cfb52adf


--

___
Python tracker 

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



[issue33125] Windows 10 ARM64 platform support

2021-07-27 Thread Niyas Sait


Niyas Sait  added the comment:

I know this issue is closed but just wanted to have a discussion around adding 
CI support for cpython on windows on arm targets.

We at linaro are working on adding windows/arm support for popular packages 
such as numpy, cffi etc. Hopefully, very soon we will have many of the popular 
packages working out of the box on windows on arm targets.

Testing windows/arm has been an open question. I heard about the potential 
availablity of windows/arm machines in azure cloud sometimes in the future but 
not sure about the timescale.

In Linaro, we have a WoA farm which has couple of surface pro which we are 
happy to use for CI and for release builds etc. It could be an interim testing 
system until we have support in azure. This would enable us to start official 
support for cpython for windows/arm sooner.

I would like to hear your thoughts on the proposal

--
nosy: +nsait-linaro

___
Python tracker 

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



[issue39820] Bracketed paste mode for REPL: don't execute pasted command before ENTER is pressed explicitly

2021-07-27 Thread Michael Hofmann


Change by Michael Hofmann :


--
nosy: +mhofmann

___
Python tracker 

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



[issue44098] Remove ParamSpec from __parameters__ of most typing generics

2021-07-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think that List[P] should be illegal at first place.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue44746] Improper behaviour of 'finally' keyword

2021-07-27 Thread Steven D'Aprano


Change by Steven D'Aprano :


--
nosy: +steven.daprano

___
Python tracker 

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



[issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL

2021-07-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It would be nice to add a multi-thread supporting version of tee() or add 
multi-thread support in tee(), but this is different issue.

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



[issue44739] Tkinter text horizontal scrollbar is not stationary

2021-07-27 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> third party

___
Python tracker 

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



  1   2   >