[issue42754] Unpacking of literals inside other literals should be optimised away by the compiler

2020-12-26 Thread Patrick Reader


Change by Patrick Reader :


--
type:  -> performance

___
Python tracker 

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



[issue42754] Unpacking of literals inside other literals should be optimised away by the compiler

2020-12-26 Thread Patrick Reader


New submission from Patrick Reader :

When unpacking a collection or string literal inside another literal, the 
compiler should optimise the unpacking away and store the resultant collection 
simply as another constant tuple, so that `[*'123', '4', '5']` is the exact 
same as `['1', '2', '3', '4', '5']`.

Compare:

```
>>> dis.dis("[*'123', '4', '5']")
  1   0 BUILD_LIST   0
  2 BUILD_LIST   0
  4 LOAD_CONST   0 ('123')
  6 LIST_EXTEND  1
  8 LIST_EXTEND  1
 10 LOAD_CONST   1 ('4')
 12 LIST_APPEND  1
 14 LOAD_CONST   2 ('5')
 16 LIST_APPEND  1
```

vs.

```
>>> dis.dis("['1', '2', '3', '4', '5']")
  1   0 BUILD_LIST   0
  2 LOAD_CONST   0 (('1', '2', '3', '4', '5'))
  4 LIST_EXTEND  1
```

and `timeit` shows the latter to be over 3 times as fast.

For example, when generating a list of characters, it is easier and more 
readable to do `alphabet = [*"abcde"]` instead of `alphabet = ["a", "b", "c", 
"d", "e"]`. The programmer can do what is most obvious without worrying about 
performance, because the compiler can do it itself.

--
components: Interpreter Core
messages: 383837
nosy: pxeger
priority: normal
severity: normal
status: open
title: Unpacking of literals inside other literals should be optimised away by 
the compiler

___
Python tracker 

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



[issue42753] "./configure" linux chrome beta

2020-12-26 Thread Gerrik Labra


New submission from Gerrik Labra :

Ok. So I tried to run the setup in README.txt for the latest linux beta 
emulator on the google pixel chromebook.

Here is what I got back, and the commands, "make, make test, sudo make test" 
didn't work.

ennuilysis@penguin:~/Python/Python-3.8.7$ ./configure
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for python3.8... no
checking for python3... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "linux"
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/ennuilysis/Python/Python-3.8.7':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

--
components: Installation
messages: 383836
nosy: gerriklabra
priority: normal
severity: normal
status: open
title: "./configure" linux chrome beta
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



[issue42417] Empty body {} in POST requests leads to 405 Method not allowed error

2020-12-26 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I've tried it with flask_client_long_headers.py , but I get the same output as 
I've gotten before with flask_client.py .

Can you try it on a few different systems?

--

___
Python tracker 

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



[issue40148] Add PurePath.with_stem()

2020-12-26 Thread Qi Yao


Qi Yao  added the comment:

In Pathlib, we have functions "with_name()""with_stem()""with_suffix()" to 
modify the file name in the path.

In issue21798:"Allow adding Path or str to Path", it actually also want to 
modify the file name, that is "appand string to file name".

if with_stem() more cumbersome as:
path.with_name(path.stem + '_v2' + path.suffix)

why not have a function with_() more cumbersome as:
path.with_name(path.name + "_name.dat")

--
nosy: +tinyaoqi

___
Python tracker 

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



[issue42751] Imaplib

2020-12-26 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Are you the owner of imaplib2?

If so, you need to ensure that there are no licencing or copyright issues 
preventing imaplib2 being transferred into the stdlib. That may (or may not) 
require you to get agreement from any contributors to the library. That will 
depend on the licencing agreement your contributors have with you.

If you are not the owner, then you need to get the owner's agreement first, 
before you do anything else. We're not going to just *take* the library, or 
fork it.

That means that the imaplib2 library will have to adhere to Python's release 
schedule, our code of conduct, our policies on backwards compatibility, etc.

If the owner(s) agree that they are interested, then you can propose the idea 
on the Python-Ideas mailing list for discussion:

https://mail.python.org/mailman3/lists/python-ideas.python.org/

If there is interest in your proposal, then you can ask for a core developer to 
sponsor a PEP. Once you have a sponsor, you can write a PEP, and the steering 
council will rule whether or not to accept it.

--
nosy: +steven.daprano
resolution:  -> postponed
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



[issue42687] tokenize module does not recognize Barry as FLUFL

2020-12-26 Thread Erik Soma


Change by Erik Soma :


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



[issue42752] multiprocessing Queue leaks a file descriptor associated with the pipe writer (#33081 still a problem)

2020-12-26 Thread Alex Orange


New submission from Alex Orange :

Didn't feel like necroing #33081, but this is basically that problem. The 
trouble is the cleanup that appeared to fix #33081 only kicks in once something 
has been put in the queue. So if for instance a Process function puts something 
in the queue and the parent gets it, then calls q.close() the writer on the 
parent side doesn't get culled until the object does. This is particularly a 
problem for PyPy and isn't exactly great for any weird corner cases if anyone 
holds onto Queue objects after they're closed for any reason (horders!).

Attached file test_queue.py is an example of how to trigger this problem. Run 
it without a command line argument "python test_queue.py" and it won't crash 
(though it will take a very long time to complete). Run with an argument 
"python test_queue.py fail" and it will fail once you run out of file 
descriptors (one leaked per queue).

My suggestion on how to handle this is to set self._close to something that 
will close self._writer. Then, when _start_thread is called, instead of 
directly passing the self._writer.close object, pass a small function that will 
switch out self._close to the Finalize method used later on and return 
self._writer. Finally, inside _feed, use this method to get the _writer object 
and wrap the outer while 1 with a contextlib.closer on this object.

This is a fair bit of stitching things together here and there so let me know 
if anyone has any suggestions on this before I get started.

--
components: Library (Lib)
files: test_queue.py
messages: 383832
nosy: Alex.Orange
priority: normal
severity: normal
status: open
title: multiprocessing Queue leaks a file descriptor associated with the pipe 
writer (#33081 still a problem)
type: resource usage
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49701/test_queue.py

___
Python tracker 

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



[issue40512] [subinterpreters] Meta issue: per-interpreter GIL

2020-12-26 Thread STINNER Victor


STINNER Victor  added the comment:

> * resolve_slotdups() uses a static variable

Attached resolve_slotdups.patch works around the issue by removing the cache.

--
keywords: +patch
Added file: https://bugs.python.org/file49700/resolve_slotdups.patch

___
Python tracker 

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



[issue40512] [subinterpreters] Meta issue: per-interpreter GIL

2020-12-26 Thread STINNER Victor


STINNER Victor  added the comment:

I played with ./configure --with-experimental-isolated-subinterpreters. I tried 
to run "pip list" in parallel in multiple interpreters.

I hit multiple issues:

* non-atomic reference count of Python objects shared by multiple interpreters, 
objects shared via static types for example.

* resolve_slotdups() uses a static variable

* pip requires _xxsubinterpreters.create(isolated=False): the vendored distro 
package runs the lsb_release command with subprocess.

* Race conditions in PyType_Ready() on static types:

  * Objects/typeobject.c:5494: PyType_Ready: Assertion "(type->tp_flags & (1UL 
<< 13)) == 0" failed
  * Race condition in add_subclass()

* parser_init() doesn't support subinterpreters

* unicode_dealloc() fails to delete an interned string in the Unicode interned 
dictionary => https://bugs.python.org/issue40521#msg383829


To run "pip list", I used:

CODE = """
import runpy
import sys
import traceback
sys.argv = ["pip", "list"]
try:
runpy.run_module("pip", run_name="__main__", alter_sys=True)
except SystemExit:
pass
except Exception as exc:
traceback.print_exc()
print("BUG", exc)
raise
"""

--

___
Python tracker 

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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2020-12-26 Thread STINNER Victor


STINNER Victor  added the comment:

> New changeset ea251806b8d11b30d2182af1e589caf88acf by Victor Stinner in 
> branch 'master':
> bpo-40521: Per-interpreter interned strings (GH-20085)

I reopen the issue. This change caused a regression in attached 
interned_bug.py. Output:
---
$ ./python interned_bug.py 
Exception ignored deletion of interned string failed:
KeyError: 'out of memory'
python: Objects/unicodeobject.c:1946: unicode_dealloc: Assertion 
`Py_REFCNT(unicode) == 1' failed.
Abandon (core dumped)
---

Running "import xml.parsers.expat" in a subinterpreter causes two issues when 
the subinterpreter completes:

* pyexpat.errors and pyexpat.model dictionaries are cleared: all values set to 
None
* unicode_dealloc() logs an error on an interned string in the subinterpreter, 
because the string doesn't exist in the subinterpreter interned dictionary.

The interned string is created in the main interpreter and so stored in the 
main interpreter interned dictionary.

The string is stored in 2 dictionaries of pyexpat.errors dictionaries:

>>> pyexpat.errors.messages[1]
'out of memory'
>>> pyexpat.errors.codes['out of memory']
1

When the subinterpreter clears pyexpat.errors and pyexpat.model dictionaries, 
the interned string is deleted: unicode_dealloc() is called. But 
unicode_dealloc() fails to delete the interned string in the subinterpreter 
interned dictionary.

pyexpat.errors and pyexpat.model modules are cleared because they are stored as 
different names in sys.modules by Lib/xml/parsers/expat.py:

sys.modules['xml.parsers.expat.model'] = model
sys.modules['xml.parsers.expat.errors'] = errors

--
resolution: fixed -> 
status: closed -> open
Added file: https://bugs.python.org/file49699/interned_bug.py

___
Python tracker 

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



[issue42751] Imaplib

2020-12-26 Thread Rodolfo García Peñas

New submission from Rodolfo García Peñas :

Hi,

Is it possible to move the imaplib2 implementation 
(https://github.com/imaplib2/imaplib2/) as imaplib stdlib?

What steps should I do?

Regards,
kix

--
components: Library (Lib)
messages: 383828
nosy: rodolfogarciap
priority: normal
severity: normal
status: open
title: Imaplib
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue41781] Typos in typing.py

2020-12-26 Thread Patrick Reader


Patrick Reader  added the comment:

Maybe I added myself by accident while reading the code. Anyway, thanks and 
you're welcome

--

___
Python tracker 

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



[issue41781] Typos in typing.py

2020-12-26 Thread Ross Rhodes


Ross Rhodes  added the comment:

Hello Patrick,

Thanks for opening this issue. I'm creating a PR to resolve the typo in 
"_allow_reckless_class_cheks", but I'm unable to find "instnance". Presumably 
the latter was resolved in an earlier PR.

--

___
Python tracker 

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



[issue41781] Typos in typing.py

2020-12-26 Thread Ross Rhodes


Change by Ross Rhodes :


--
keywords: +patch
nosy: +trrhodes
nosy_count: 1.0 -> 2.0
pull_requests: +22804
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23957

___
Python tracker 

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



[issue42750] tkinter.Variable equality consistency

2020-12-26 Thread Ivo Shipkaliev


Ivo Shipkaliev  added the comment:

2. (continued) .. This is including the case when both variables have the same 
internal name (the current implementation).

--

___
Python tracker 

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



[issue42750] tkinter.Variable equality consistency

2020-12-26 Thread RhinosF1


Change by RhinosF1 :


--
nosy: +RhinosF1

___
Python tracker 

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



[issue42750] tkinter.Variable equality consistency

2020-12-26 Thread Ivo Shipkaliev


Ivo Shipkaliev  added the comment:

There are 2 good reasons for making Tk variables comparable by value:

   1. We honor the equality operator! The equality operator (==) has to compare 
two objects by value. The current implementation does not fulfil this. Yes, if 
two Tk variables have the same names in the Tcl interpreter, they are 
guaranteed to have the same value.

>>> a = tk.IntVar(name='a')
>>> b = tk.IntVar(name='a')
>>> assert a == b  # this is not enough; equality means "by value"
   # what about when they don't have the same name?

>>> assert a is not b  # this again does not make sense, since
   # both Python "a" and "b" identifiers lead to
   # the same "self._tk.globalgetvar(self._name)"
   # Tcl registered variable: name="a"

>>> a.set(42); assert b.get() == a.get() == 42  # yes!
# equality in names guarantees equality in value

Yes ... BUT, the negation is not true: if two Tk variables have different 
names, that does NOT mean that they have different values. This is where we 
fail the equality operator:

>>> c = tk.IntVar(name='c', value=42)
>>> assert a._name != c._name and a.get() != c.get(), \
... "Difference in names does not guarantee difference in value"

   2. When we're interested in Tk variable comparison: .get() becomes 
redundant. Every time two Tk variables are of the same type AND they refer to 
the same value, we can safely compare them as equal, regardless of how they are 
named in the Tcl interpreter.

--

___
Python tracker 

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



[issue42745] [subinterpreters] Make the type attribute lookup cache per-interpreter

2020-12-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f4507231e3f0cf8827cec5592571ce371c6813e8 by Victor Stinner in 
branch 'master':
bpo-42745: finalize_interp_types() calls _PyType_Fini() (GH-23953)
https://github.com/python/cpython/commit/f4507231e3f0cf8827cec5592571ce371c6813e8


--

___
Python tracker 

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



[issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag?

2020-12-26 Thread STINNER Victor


STINNER Victor  added the comment:

Maybe we can keep the constants but define them as 0 and deprecate them.

The question is more if these constants solve a real ABI issue or not.

--

___
Python tracker 

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



[issue42745] [subinterpreters] Make the type attribute lookup cache per-interpreter

2020-12-26 Thread STINNER Victor


STINNER Victor  added the comment:

> I assume PR 23953 fixes those?

Yes, it fix the 7 tests which leak:

./python -m test -R 3:3 -j0 test__xxsubinterpreters test_ast test_atexit 
test_capi test_interpreters test_threading

--

___
Python tracker 

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



[issue42737] PEP 563: drop annotations for complex assign targets

2020-12-26 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

I think we should still evaluate the targets (even though the sole purpose of 
this is just having a hint, the yield example seems serious), will update my 
patch accordingly.

--

___
Python tracker 

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



[issue42750] tkinter.Variable equality consistency

2020-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

a = tk.IntVar(name='a')
b = tk.IntVar(name='a')
assert a == b  # they refers to the same variable
assert a is not b  # but they are different objects
a.set(42); assert b.get() == a.get() == 42  # yes, it is the same variable
c = tk.IntVar(name='c', value=42)
assert c != a  # they are different variables
assert c.get() == a.get() == 42  # although having equal values
a.set(43); assert c.get() != a.get() == 43  # and setting one does not affect 
other

I do not see good reasons for making Tk variables comparable by value instead 
of name.

--

___
Python tracker 

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



[issue42737] PEP 563: drop annotations for complex assign targets

2020-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

About the difference in behavior. Currently:

>>> (1/0).numerator: int
Traceback (most recent call last):
  File "", line 1, in 
ZeroDivisionError: division by zero
>>> x[0]: int
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'x' is not defined
>>> [][print('Hi!')]: int
Hi!

With PR 23952 it all will be no-op.

Also, there should be changes in the following weird example:

def f():
   (yield).x: int

--

___
Python tracker 

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



[issue42745] [subinterpreters] Make the type attribute lookup cache per-interpreter

2020-12-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

41010184880151d6ae02a226dbacc796e5c90d11 introduced some reference leaks:

https://buildbot.python.org/all/#/builders/384/builds/136

41010184880151d6ae02a226dbacc796e5c90d11 is the first bad commit
commit 41010184880151d6ae02a226dbacc796e5c90d11
Author: Victor Stinner 
Date:   Sat Dec 26 01:45:43 2020 +0100

bpo-42745: Make the type cache per-interpreter (GH-23947)

Make the type attribute lookup cache per-interpreter.

Add private _PyType_InitCache() function, called by 
PyInterpreterState_New().

Continue to share next_version_tag between interpreters, since static
types are still shared by interpreters.

Remove MCACHE macro: the cache is no longer disabled if the
EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro is defined.

 Include/internal/pycore_interp.h   |  22 +++
 Include/internal/pycore_object.h   |   3 +
 Include/internal/pycore_pylifecycle.h  |   2 +-
 .../2020-12-25-23-30-58.bpo-42745.XsFoHS.rst   |   1 +
 Objects/typeobject.c   | 178 -
 Python/pylifecycle.c   |   2 +-
 Python/pystate.c   |   2 +
 7 files changed, 128 insertions(+), 82 deletions(-)
 create mode 100644 Misc/NEWS.d/next/Core and 
Builtins/2020-12-25-23-30-58.bpo-42745.XsFoHS.rst
bisect run success

I assume PR 23953 fixes those? If that is so, could we land it before more 
buildbots start to fail?

--
nosy: +pablogsal

___
Python tracker 

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



[issue42750] tkinter.Variable equality consistency

2020-12-26 Thread Ivo Shipkaliev


Ivo Shipkaliev  added the comment:

If it's gonna break existing code -- fine. I just wanted to point out that if 
two variables are of the same type and refer to the same value, they should be 
considered equal, even if they are not the same variable.

In the current implementation, two StrVars can hold the same strings, but are 
compared unequal, which doesn't seem right.

Considering that we are going through the Tcl interpreter, equality should 
compare by value, not by identity (regardless of the variable names).

Look at this, please.

>>> int_0 = tk.IntVar()
>>> int_0.set(51)

>>> int_1 = tk.IntVar()
>>> int_1.set(51)


How can:

>>> int_0.get() == int_1.get()
True

and

>>> type(int_0) == type(int_1)
True

..but:

>>> int_0 == int_1
False

This means that the equality operator is only showing the difference in their 
names, and the statement above loses meaning, as it can never return True.

I think "int_0 is int_1" should be False as it is now. "is" should take into 
account their names as defined in the Tcl interpreter.

But "int_0 == int_1" should be True. Same as a couple of identical Python lists 
with different names.

Thank you!

--

___
Python tracker 

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



[issue42737] PEP 563: drop annotations for complex assign targets

2020-12-26 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> Do we still need to represent annotation as a subtree in AST? Or make it just 
> a string?

Possibly, we will just represent them as Constant()s. See issue 41967

--

___
Python tracker 

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



[issue42737] PEP 563: drop annotations for complex assign targets

2020-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Do we still need to represent annotation as a subtree in AST? Or make it just a 
string?

--

___
Python tracker 

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



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

2020-12-26 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

One thing to note here, currently Pablo and I are trying to bring annotation 
unparsing from the compiler to the parser in issue 41967. If we do so, the 
annotations won't cause any side effects on the symbol table generation.

--
nosy: +pablogsal

___
Python tracker 

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



[issue42737] PEP 563: drop annotations for complex assign targets

2020-12-26 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yeah, we're talking about a future here where `from __future__ import 
annotations` is always on. And that future is now. (3.10)

--

___
Python tracker 

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



[issue42750] tkinter.Variable equality consistency

2020-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It will break existing code which depends on the current behavior.

I don't see a problem with comparing variables by name.

--

___
Python tracker 

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



[issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag?

2020-12-26 Thread Dong-hee Na


Dong-hee Na  added the comment:

Let's emit the deprecated message if Py_TPFLAGS_HAVE_VERSION_TAG is set ;)
For example, PyType_Ready looks like a good place

--
nosy: +corona10

___
Python tracker 

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



[issue16396] Importing ctypes.wintypes on Linux gives a ValueError instead of an ImportError

2020-12-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22803
pull_request: https://github.com/python/cpython/pull/23956

___
Python tracker 

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



[issue16396] Importing ctypes.wintypes on Linux gives a ValueError instead of an ImportError

2020-12-26 Thread miss-islington


miss-islington  added the comment:


New changeset 7865f516f313bd31ca48ee1fdae2a80add2293b6 by Shantanu in branch 
'master':
bpo-16396: fix BPO number in changelog (GH-23951)
https://github.com/python/cpython/commit/7865f516f313bd31ca48ee1fdae2a80add2293b6


--

___
Python tracker 

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



[issue42750] tkinter.Variable equality consistency

2020-12-26 Thread Ivo Shipkaliev


New submission from Ivo Shipkaliev :

Greetings!

I just noticed:

>>> import tkinter as tk
>>> root = tk.Tk()

>>> str_0 = tk.StringVar()
>>> str_0.set("same value")

>>> str_1 = tk.StringVar()
>>> str_1.set("same value")

So:

>>> str_0.get() == str_1.get()
True

But:

>>> str_0 == str_1
False

So, maybe a Variable should be compared by value, and not by identity (._name) 
as currently? (please view attached) Does it make sense?

--
components: Tkinter
files: equality.diff
keywords: patch
messages: 383807
nosy: epaine, serhiy.storchaka, shippo_
priority: normal
severity: normal
status: open
title: tkinter.Variable equality consistency
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file49698/equality.diff

___
Python tracker 

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



[issue42042] sphinx3 renders diffrently docs.python.org for 3.10

2020-12-26 Thread Dong-hee Na


Dong-hee Na  added the comment:

@pablogsal @rhettinger @mdk @Mariatta

Cool!! everything looks okay!
Now I close this issue.

Thank you to everyone who works on this issue!!

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



[issue42735] "trace_at_recursion_limit.py" should be removed from "Python/Lib/test/crashers"

2020-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The initial issue6717 is still open. Are you sure that the bug was fixed rater 
than that the crasher is outdated?

--

___
Python tracker 

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



[issue42748] test_asdl_parser: load_module() method is deprecated

2020-12-26 Thread Dong-hee Na


Change by Dong-hee Na :


--
components: +Tests
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> enhancement
versions: +Python 3.10

___
Python tracker 

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



[issue42748] test_asdl_parser: load_module() method is deprecated

2020-12-26 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:


New changeset 0b281f94b9e5f117d774a1e4e834e797b2b21438 by Dong-hee Na in branch 
'master':
bpo-42748: test_asdl_parser now uses exec_module instead of load_module (#23954)
https://github.com/python/cpython/commit/0b281f94b9e5f117d774a1e4e834e797b2b21438


--

___
Python tracker 

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



[issue42749] test_tcl failed on 32-bit POWER6 AIX 3.9: big int issue with 9223372036854775808

2020-12-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue42749] test_tcl failed on 32-bit POWER6 AIX 3.9: big int issue with 9223372036854775808

2020-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Interesting that static version is 8.4, but pathlevel is 8.5.9. It means that 
Tkinter is built with older version of headers and does not support bignum 
type, but dynamically linked to newer library which can create bignum objects.

There is a problem with tests. They should be skipped if Tkinter is built with 
old Tcl headers (it is not easy to do reliable). But there is also a problem 
with configuration which founds too old headers.

--
nosy: +David.Edelsohn

___
Python tracker 

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



[issue42748] test_asdl_parser: load_module() method is deprecated

2020-12-26 Thread Dong-hee Na


Change by Dong-hee Na :


--
keywords: +patch
nosy: +corona10
nosy_count: 1.0 -> 2.0
pull_requests: +22801
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23954

___
Python tracker 

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



[issue42749] test_tcl failed on 32-bit POWER6 AIX 3.9: big int issue with 9223372036854775808

2020-12-26 Thread STINNER Victor


New submission from STINNER Victor :

POWER6 AIX 3.9:
https://buildbot.python.org/all/#/builders/330/builds/221

test.pythoninfo:

platform.architecture: 32bit
platform.platform: AIX-2-00F9C1964C00-powerpc-32bit
tkinter.TCL_VERSION: 8.4
tkinter.TK_VERSION: 8.4
tkinter.info_patchlevel: 8.5.9

==
FAIL: test_expr_bignum (test.test_tcl.TclTest)
--
Traceback (most recent call last):
  File 
"/home/aixtools/buildarea/3.9.aixtools-aix-power6/build/Lib/test/test_tcl.py", 
line 441, in test_expr_bignum
self.assertEqual(result, i)
AssertionError:  != 9223372036854775808

==
FAIL: test_getint (test.test_tcl.TclTest)
--
Traceback (most recent call last):
  File 
"/home/aixtools/buildarea/3.9.aixtools-aix-power6/build/Lib/test/test_tcl.py", 
line 148, in test_getint
self.assertEqual(tcl.getint(' %d ' % i), i)
AssertionError: -9223372036854775808 != 9223372036854775808

==
FAIL: test_passing_values (test.test_tcl.TclTest)
--
Traceback (most recent call last):
  File 
"/home/aixtools/buildarea/3.9.aixtools-aix-power6/build/Lib/test/test_tcl.py", 
line 475, in test_passing_values
self.assertEqual(passValue(i), i if self.wantobjects else str(i))
AssertionError: '9223372036854775808' != 9223372036854775808

--

--
components: Tests, Tkinter
messages: 383802
nosy: gpolo, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: test_tcl failed on 32-bit POWER6 AIX 3.9: big int issue with 
9223372036854775808
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



[issue42745] [subinterpreters] Make the type attribute lookup cache per-interpreter

2020-12-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22800
pull_request: https://github.com/python/cpython/pull/23953

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-12-26 Thread STINNER Victor


STINNER Victor  added the comment:

I checked for ^.*tp_new.*=.*NULL regex in "git log -p" command output. I 
checked all commits up to May 8 2016, the commit which added:

+((PyTypeObject *)v)->tp_new = NULL;

I met "FlagsType.tp_new = NULL;" multiple times since the code moved multiple 
times.

Apart of the issue in _curses_panel.panel, I didn't see any other removal by 
mistake. In this issue, the work started in 2019, so I consider that it's ok. 
No other tp_new=NULL was removed by mistake.

Again, if tp_new=NULL is used, I suggest to write a function test to ensure 
that it's not possible to instanciate the type.

--

___
Python tracker 

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



[issue42737] PEP 563: drop annotations for complex assign targets

2020-12-26 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> It will still perform run-time check which was an initial intention.

Well, at least from my personal perspective, I'd expect all annotations to 
behave like strings regardless of their targets.

--

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The pitfall of PyType_FromModuleAndSpec() is that it makes types instantiable 
by default if tp_new is not provided. Created objects can crash when you try to 
use them because they are not properly initialized.

When there was few uses of PyType_FromModuleAndSpec() I fixed them and added 
tests, but now there are much more types created with 
PyType_FromModuleAndSpec(). Please check all other uses of 
PyType_FromModuleAndSpec(), add workarounds and tests.

--

___
Python tracker 

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



[issue42736] Add support for making Linux prctl(...) calls to subprocess

2020-12-26 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


--
nosy: +izbyshev

___
Python tracker 

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



[issue38435] Start the deprecation cycle for subprocess preexec_fn

2020-12-26 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


--
nosy: +izbyshev

___
Python tracker 

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



[issue42737] PEP 563: drop annotations for complex assign targets

2020-12-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Alternatively it could be evaluated in global scope. All names are globals 
(non-global names do not work in MyPy in any case), yield and await are 
forbidden outside function. It will still perform run-time check which was an 
initial intention.

--

___
Python tracker 

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



[issue42738] subprocess: don't close all file descriptors by default (close_fds=False)

2020-12-26 Thread Alexey Izbyshev


Alexey Izbyshev  added the comment:

> Using close_fds=False, subprocess can use posix_spawn() which is safer and 
> faster than fork+exec. For example, on Linux, the glibc implements it as a 
> function using vfork which is faster than fork if the parent allocated a lot 
> of memory. On macOS, posix_spawn() is even a syscall.

On Linux, unless you care specifically about users with Python 3.10+ on older 
kernels, implementing support for closerange() syscall in subprocess would 
provide better net benefit. This is because (a) performance advantage of 
posix_spawn() is no longer relevant on Linux after bpo-35823 and (b) supporting 
closerange() would benefit even those users who still need close_fds=True.

--
nosy: +izbyshev

___
Python tracker 

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