[issue42755] sqlite3.Connection.backup default value is diffrent between implmentation and docs

2020-12-27 Thread Dong-hee Na


New submission from Dong-hee Na :

Docs says that pages default value is 0 but the implementation is -1

docs: https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.backup
impl: 
https://github.com/python/cpython/blob/f4507231e3f0cf8827cec5592571ce371c6813e8/Modules/_sqlite/connection.c#L1565

But the behavior will be the same and if the pages is set to zero, we update 
this value to -1.
https://github.com/python/cpython/blob/f4507231e3f0cf8827cec5592571ce371c6813e8/Modules/_sqlite/connection.c#L1625

So IMHO, I'd like to suggest updating the docs rather than updating the 
implementation.

--
components: Extension Modules
messages: 383838
nosy: berker.peksag, corona10, erlendaasland, serhiy.storchaka
priority: normal
severity: normal
status: open
title: sqlite3.Connection.backup default value is diffrent between 
implmentation and docs

___
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-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b02ad2458bc127a7afdeef414fa68c9a7f1f32af by Serhiy Storchaka in 
branch 'master':
bpo-42749: Fix testing bignum if Tkinter is compiled with Tk 8.4 and dynamic 
linked with Tk >= 8.5 (GH-23955)
https://github.com/python/cpython/commit/b02ad2458bc127a7afdeef414fa68c9a7f1f32af


--

___
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-27 Thread miss-islington


Change by miss-islington :


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

___
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-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22807
pull_request: https://github.com/python/cpython/pull/23962

___
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-27 Thread miss-islington


miss-islington  added the comment:


New changeset dda12ad63e927e93d71462ad77cc84da55bada9b by Miss Islington (bot) 
in branch '3.9':
bpo-42749: Fix testing bignum if Tkinter is compiled with Tk 8.4 and dynamic 
linked with Tk >= 8.5 (GH-23955)
https://github.com/python/cpython/commit/dda12ad63e927e93d71462ad77cc84da55bada9b


--

___
Python tracker 

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



[issue40956] Use Argument Clinic in sqlite3

2020-12-27 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 3ccef1ca474592e191a00e131dfbaf777db271e9 by Erlend Egeberg 
Aasland in branch 'master':
bpo-40956: Convert _sqlite3.Connection to Argument Clinic, part 2 (GH-23838)
https://github.com/python/cpython/commit/3ccef1ca474592e191a00e131dfbaf777db271e9


--

___
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-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 9d7c5ab6a4ae9d69b39bd16c3195bf6405ddc2d1 by Miss Islington (bot) 
in branch '3.8':
bpo-42749: Fix testing bignum if Tkinter is compiled with Tk 8.4 and dynamic 
linked with Tk >= 8.5 (GH-23955) (GH-23962)
https://github.com/python/cpython/commit/9d7c5ab6a4ae9d69b39bd16c3195bf6405ddc2d1


--

___
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-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The test should be fixed now, but there is a configuration issue.

--
nosy: +Michael.Felt
versions: +Python 3.10, Python 3.8

___
Python tracker 

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



[issue42740] typing.py get_args and get_origin should support PEP 604 and 612

2020-12-27 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +22808
pull_request: https://github.com/python/cpython/pull/23963

___
Python tracker 

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



[issue40956] Use Argument Clinic in sqlite3

2020-12-27 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
pull_requests: +22809
pull_request: https://github.com/python/cpython/pull/23964

___
Python tracker 

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



[issue42755] sqlite3.Connection.backup default value is diffrent between implmentation and docs

2020-12-27 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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

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

2020-12-27 Thread Ivo Shipkaliev


Change by Ivo Shipkaliev :


--
title: tkinter.Variable equality consistency -> tkinter.Variable equality 
inconsistency

___
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-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bf64d9064ab641b1ef9a0c4bda097ebf1204faf4 by Erlend Egeberg 
Aasland in branch 'master':
bpo-1635741: sqlite3 uses Py_NewRef/Py_XNewRef (GH-23170)
https://github.com/python/cpython/commit/bf64d9064ab641b1ef9a0c4bda097ebf1204faf4


--

___
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-27 Thread STINNER Victor


STINNER Victor  added the comment:

> New changeset dda12ad63e927e93d71462ad77cc84da55bada9b by Miss Islington 
> (bot) in branch '3.9':
> bpo-42749: Fix testing bignum if Tkinter is compiled with Tk 8.4 and dynamic 
> linked with Tk >= 8.5 (GH-23955)

test_tcl still fails on POWER6 AIX 3.9:
https://buildbot.python.org/all/#/builders/330/builds/226

==
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 451, in test_expr_bignum
self.assertRaises(TclError, tcl.call, 'expr', str(2**1000))
AssertionError: TclError not raised by call

--

___
Python tracker 

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



[issue42724] Change library name when building.

2020-12-27 Thread Eric V. Smith


Change by Eric V. Smith :


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



[issue42753] "./configure" linux chrome beta

2020-12-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

Do you have a C compiler installed? It's mentioned here 
https://devguide.python.org/setup/#unixhttps://devguide.python.org/setup/#unix

I found a number of guides for building Python on Chromebooks via searching. I 
don't have any experience, so I'm not going to recommend one, but some of them 
look very detailed.

--
nosy: +eric.smith

___
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-27 Thread Eric V. Smith


Change by Eric V. Smith :


--
components: +Build -Installation

___
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-27 Thread STINNER Victor


STINNER Victor  added the comment:

Progress: 77% (102/132) of extension modules use the new C API.

I used different grep commands to count *all* extension modules, not only the 
Modules/ directory:

$ grep -E '\' $(find -name "*.c"|grep -v Doc/|grep -v 
moduleobject.c)|wc -l
30
$ grep -E '\' $(find -name "*.c"|grep -v Doc/|grep -v 
moduleobject.c)|wc -l
102

--

Modules/ directory: 79% (94/119) of extension modules use the new API.

$ grep -E '\' $(find Modules -name "*.c")|wc -l
25
$ grep -E '\' $(find Modules -name "*.c")|wc -l
94

--

___
Python tracker 

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



[issue40077] Convert static types to heap types: use PyType_FromSpec()

2020-12-27 Thread STINNER Victor


STINNER Victor  added the comment:

Progress: 43% (89/206) of types are declared as heap types on a total of 206 
types.

$ grep -E 'static PyTypeObject .* =' $(find -name "*.c"|grep -v Doc/)|wc -l
117
$ grep -E 'PyType_Spec .* =' $(find -name "*.c")|wc -l
89

--

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

2020-12-27 Thread E. Paine


E. Paine  added the comment:

See also issue41851. I personally think that being able to compare whether two 
tkinter variables point to the same Tk variable is very useful so needs to stay 
in some form. However, I don't see any situation where comparing to see if two 
tkinter variables are the same Python object would be helpful.

Comparing to a list (for example), `assert a is b` would mean altering one 
would affect the other (while this is true of tkinter variables, to cover all 
cases you would instead check whether they are 'equal'). Therefore, while 
writing `a.get() == b.get()` isn't too bad, the point of this change would be 
consistency more than anything else (as-per the title).

--

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2020-12-27 Thread Wüstengecko

New submission from Wüstengecko :

Since Python 3.9, calling `smtplib.LMTP.connect()` without explicitly 
specifying any `timeout=` raises a `TypeError`. Specifying `None` or any 
integer value works correctly.

```
>>> import smtplib
>>> smtplib.LMTP("/tmp/lmtp.sock")
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.9/smtplib.py", line 1071, in __init__
super().__init__(host, port, local_hostname=local_hostname,
  File "/usr/lib/python3.9/smtplib.py", line 253, in __init__
(code, msg) = self.connect(host, port)
  File "/usr/lib/python3.9/smtplib.py", line 1085, in connect
self.sock.settimeout(self.timeout)
TypeError: an integer is required (got type object)
>>> l = smtplib.LMTP()
>>> l.connect("/tmp/lmtp.sock")
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.9/smtplib.py", line 1085, in connect
self.sock.settimeout(self.timeout)
TypeError: an integer is required (got type object)
```

Upon investigation with `pdb`, the default object for the `timeout` parameter 
(`socket._GLOBAL_DEFAULT_TIMEOUT`) is passed through to the 
`self.sock.settimeout` call, instead of being handled as "no timeout 
specified". The relevant changes were introduced as fix for bpo-39329.

--
components: Library (Lib)
messages: 383850
nosy: wuestengecko
priority: normal
severity: normal
status: open
title: smtplib.LMTP.connect() raises TypeError if `timeout` is not specified
type: crash
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



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

2020-12-27 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +22811
pull_request: https://github.com/python/cpython/pull/23966

___
Python tracker 

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



[issue42513] Socket.recv hangs

2020-12-27 Thread Barney Stratford


Barney Stratford  added the comment:

Still waiting for the instrumented code to hang. It sometimes runs for a month 
or two before freezing.

--

___
Python tracker 

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



[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2020-12-27 Thread Yurii Karabas


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


--
keywords: +patch
nosy: +uriyyo
nosy_count: 8.0 -> 9.0
pull_requests: +22812
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/23967

___
Python tracker 

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



[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2020-12-27 Thread Yurii Karabas


Yurii Karabas <1998uri...@gmail.com> added the comment:

I have implemented this feature using an idea provided by Xiang Zhang.
Basically, property has new optional attribute `name` which will be added to 
msg of `AttributeError` in a case when `name` is set.

--

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

2020-12-27 Thread Ivo Shipkaliev


Ivo Shipkaliev  added the comment:

"I personally think that being able to compare whether two tkinter variables 
point to the same Tk variable is very useful so needs to stay in some form." -- 
I concur.

"However, I don't see any situation where comparing to see if two tkinter 
variables are the same Python object would be helpful." -- agreed.

"Therefore, while writing 'a.get() == b.get()' isn't too bad, .." -- it isn't. 
But "a == b" -> False IS, provided that "a.get() == b.get()" is True.

Serhiy, how about:

> class Variable:
> ...
> def is_(self, other):  # or maybe "same_as"
> return self.__class__.__name__ == other.__class__.__name__ \
> and self._name == other._name
>
> def __eq__(self, other):
> return self.__class__.__name__ == other.__class__.__name__ \
> and self.get() == other.get()

Regards

--

___
Python tracker 

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



[issue28964] AST literal_eval exceptions provide no information about line number

2020-12-27 Thread Steve Merritt


Steve Merritt  added the comment:

Thank you!

On Fri, Dec 25, 2020 at 11:05 AM Batuhan Taskaya 
wrote:

>
> Change by Batuhan Taskaya :
>
>
> --
> resolution:  -> fixed
> stage: patch review -> 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



[issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag?

2020-12-27 Thread hai shi


hai shi  added the comment:

>I don't see the purpose of the Py_TPFLAGS_HAVE_VERSION_TAG flag.

IMO, There have no more exact description of `Py_TPFLAGS_HAVE_VERSION_TAG`in 
docs, so I perfer to remove it.

> By the way, is it worth it to remove Py_TPFLAGS_HAVE_FINALIZE? Or is it going 
> to break too many extension modules?

I am not found who use Py_TPFLAGS_HAVE_AM_SEND or Py_TPFLAGS_HAVE_FINALIZE in 
github.I perfer to keep it as soon as posssible if there have users using them.
MAYBE we should do some surveys firstly?

--
nosy: +shihai1991

___
Python tracker 

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



[issue42757] Class has two prototypes

2020-12-27 Thread Johann Bernhardt


New submission from Johann Bernhardt :

Greetings,

tl;dr Depending on how a class is imported it will have a differenct class name 
and therefore prototype. I ran into this issue when i used a class variable to 
implement an event bus.

To reproduce you need a module and a submodule. The example creates two child 
classes that and collects their references for further use in a class/static 
variable in the parent. Depending on the import description this might be 
broken. Here, the code:

module
  |--main.py
  |--child.py
  |--submodule
   |-parent.py
   |-__init.py__

parent.py:
class Parent:

listeners = []

def __init__(self):
Parent.listeners.append(self)
print("Parent: " + str(len(Parent.listeners)))

child.py
from submodule.parent import Parent

class Child(Parent):

def __init__(self):
super(Child, self).__init__()
print("Child: " + str(Parent.listeners))

main.py
from module.child import Child
from module.submodule.parent import Parent

class ChildLocal(Parent):

def __init__(self):
super(ChildLocal, self).__init__()
print("ChildLocal: " + str(Parent.listeners))


if __name__ == '__main__':
child= Child()
local = ChildLocal()

Result:
Parent: 1
Child: []
Parent: 1
ChildLocal: [<__main__.ChildLocal object at 0x020F51EE2E48>]
Here, the parent object is imported in two different ways and two separate 
parental classes are created. Hence, each parent class collects only one child

If Parent is importet in child.py as 'from module.submodule.parent import 
Parent" (difference is the module.) the result looks as follows:
Parent: 1
Child: []
Parent: 2
ChildLocal: [, 
<__main__.ChildLocal object at 0x0182B0982E48>]
Here, both children are registered in the same parent class as intenden

In conclusion, there is a nasty (to debug) difference between a relative import 
path and a project root path. I am quite certain this behaviour is as intenden, 
but on the little chance it isn't i wanted to bring this to attentions, since 
it is a nightmare to find. Is it intended?

Cheers,
Sin

--
messages: 383856
nosy: SinTh0r4s
priority: normal
severity: normal
status: open
title: Class has two prototypes
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue42758] pathlib.Path to support the "in" operator (x in y)

2020-12-27 Thread Anton Hvornum


New submission from Anton Hvornum :

I would like to propose that the `pathlib.Path()` gets a `in` operator, much 
like that ipaddress has IP in Subnet, it would be nice if we could be able to 
do:

```
import pathlib
pathlib.Path('/home/Torxed/machine.qcow2')
pathlib.Path('/home/Torxed/machine.qcow2') in pathlib.Path('/home/Torxed')
```

Currently that would generate:
```
Traceback (most recent call last):
  File "", line 1, in 
TypeError: argument of type 'PosixPath' is not iterable
```

This would avoid "complicated" implementations such as:
 * 
https://stackoverflow.com/questions/21411904/python-how-to-check-if-path-is-a-subpath
 * 
https://stackoverflow.com/questions/3812849/how-to-check-whether-a-directory-is-a-sub-directory-of-another-directory

Which tend to be half-complete truths and would result in potential security 
issues. pathlib.Path() could help prevent some of those.

--
components: Library (Lib)
messages: 383857
nosy: Torxed
priority: normal
severity: normal
status: open
title: pathlib.Path to support the "in" operator (x in y)
type: enhancement
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue41450] OSError is not documented in ssl library, but still can be thrown

2020-12-27 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

This is resolved by Issue 31122 and code now raises SSLEOFError instead of 
OSError.

The reason for OSError in the first place was PySSL_SetError function had the 
following call s->errorhandler();

https://github.com/python/cpython/blob/3.7/Modules/_ssl.c#L782

Where the errorhandler of socketmodule.c was called, and error message that 
raised was OSError 
(https://github.com/python/cpython/blob/master/Modules/socketmodule.c#L607)

---

In issue31122, Dima.Tisnek contributed a patch to remove the s-errorhandler() 
and replace it with  SSLEOFError 
https://github.com/python/cpython/commit/495bd035662fda29639f9d52bb6baebea31d72fa
 

Since the patch was ported to 3.8 and 3.9, OSError is no longer raised by the 
ssl module for the do_handshake call or wherever PySSL_SetError is utilized.

Closing this bug report as resolved.

--
assignee: docs@python -> orsenthil
nosy: +Dima.Tisnek, orsenthil
resolution:  -> fixed
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



[issue42093] Add opcode cache for LOAD_ATTR

2020-12-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

Wow, this is amazing. I just found that this is now faster than slots. Should 
we mention that in What's New?

(Of course there's an optimization possible for slots as well, but it would 
require complicating the cache struct. Maybe in 3.11. :-)

--
nosy: +Guido.van.Rossum

___
Python tracker 

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



[issue41450] OSError is not documented in ssl library, but still can be thrown

2020-12-27 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
components: +Library (Lib) -Documentation
versions: +Python 3.10, Python 3.9

___
Python tracker 

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



[issue42759] Take into acount a Tcl interpreter when compare variables and fonts

2020-12-27 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Currently instances of tkinter.Variable and tkinter.font.Font are considered 
equal when they have the same name even if they belong to different Tcl 
interpreters. But Tcl interpreters are isolated, and variables and fonts in 
different interpreters refer to different things.

There is note in the docstring of tkinter.Variable.__eq__ about taking into 
account master. The following PR fixes this omission.

--
components: Library (Lib), Tkinter
messages: 383860
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Take into acount a Tcl interpreter when compare variables and fonts
type: behavior
versions: Python 3.10, 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



[issue42759] Take into acount a Tcl interpreter when compare variables and fonts

2020-12-27 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
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-27 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Note that vfork() support has been merged for 3.10 via bpo-35823, so 
posix_spawn() is less of a performance carrot than it used to be on Linux.  
vfork() exists macOS, that code could likely be enabled there after some 
investigation+testing.

Regardless, changing this default sounds difficult due to the variety of things 
depending on the existing behavior - potentially for security issues as you've 
noted - when running in a process with other file descriptors potentially not 
managed by Python (ie: extension modules) that don't explicitly use CLOEXEC.

The subprocess APIs are effectively evolving to become lower level over time as 
we continually find warts in them that need addressing but find defaults that 
cannot change due to existing uses.  A higher level "best practices for 
launching child processes module" with APIs reflecting explicit intents 
(performance vs security vs simplicity) rather than requiring users to 
understand subprocess platform specific details may be a good idea at this 
point (on PyPI I assume).

We changed posix close_fds default to True in 3.2 when Jeffrey and I wrote 
_posixsubprocess to better match the behavior most users actually want - 
undoing that doesn't feel right.

--
type:  -> performance

___
Python tracker 

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



[issue42760] inspect.iscoroutine returns False for asynchronous generator functions

2020-12-27 Thread Paolo Lammens


New submission from Paolo Lammens :

The `inspect.iscoroutinefunction` and `inspect.iscoroutine` functions return 
`False` for the `asend`, `athrow` and `aclose` methods of asynchronous 
generators (PEP 525). These are coroutine functions (i.e. one does e.g. `await 
gen.asend(value)`) so I would have expected these to return `True`.

Example:

```python
async def generator():
return
yield
```

```python
>>> import inspect
>>> g = generator()
>>> inspect.iscoroutinefunction(g.asend)
False

>>> inspect.iscoroutine(g.asend(None))
False
```

--
components: Library (Lib), asyncio
messages: 383862
nosy: asvetlov, plammens, yselivanov
priority: normal
severity: normal
status: open
title: inspect.iscoroutine returns False for asynchronous generator functions
type: behavior

___
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-27 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

> "using Python is more portable than relying on a shell."

Not in environments I use. :)  There isn't an installed python interpreter that 
can be executed when deploying Python as an embedded interpreter such as anyone 
using pyoxidizer or similar.  Plus "using python" means adding a Python startup 
time delay to anything that triggered such an action.  That added latency isn't 
acceptable in some situations.

When I suggest a workaround for something as involving an intermediate shell 
script, read that to mean "the user needs an intermediate program to do this 
complicated work for them - how is up to them - we aren't going to provide it 
from the stdlib".  A shell script is merely one easy pretty-fast solution - in 
environments where that is possible.

TL;DR - there's no one size fits all solution here.  But third party libraries 
could indeed implement any/all of these options including abstracting how and 
what gets used when if someone wanted to do that.

--

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

2020-12-27 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

You confuse variable and its value. tkinter.Variable is not a data container 
like list. It is a reference to external resource, Tcl variable, which contains 
value. If different Variable instances refer to different Tcl variables, they 
are different, even if values of these variables at some moment were equal. If 
they refer to the same Tcl variable, they can be considered equal. Details are 
different for different Tkinter classes: Font instances with the same name are 
equal, Variable instances with the same name are equal only if they have the 
same class (so that StringVar and IntVar are always different), Image and 
Widget instances with the same name are different. But in any case references 
to different resources are different.

Use analogy of Path instead of list. The Path object refers to external 
resource (file). Path objects with the same path are equal. Path objects with 
different paths are different, even if files have the same content.

I didn't close the шіігу right away because I was trying to explain his mistake 
to Ivo. There is no inconsistency, there is just a misunderstanding. Anyway, 
I'm closing it now.

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



[issue42753] "./configure" linux chrome beta

2020-12-27 Thread Gerrik Labra


Gerrik Labra  added the comment:

I do not have a C compiler. I do know from the chromebook support that my 
version of Linux is Debian. So I have that to work with.

--

___
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-27 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Thanks for the golang SysProcAttr reference.  The internals of _posixsubprocess 
have already becoming unwieldy with the abundance of args.  Such a 
struct/object would also fit in well there and avoid excessive C stack use.  
(as izbyshev noted during the vfork work)

Most prctl uses I noticed were PDEATHSIG but I'd need to explicitly audit 
those.  Users don't seem to care about it's documented main thread caveat 
(which matches what I've seen; most programs don't use non-daemon threads and 
exit the main thread).

I want what we do for this to be futureproof for the syscall so that we don't 
wind up merely picking one feature such as PDEATHSIG to pass a flags through to 
and needing to add logic to support others later on, delaying the ability to 
use new system features.

--

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2020-12-27 Thread Ross Rhodes


Change by Ross Rhodes :


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

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2020-12-27 Thread Ross Rhodes

Ross Rhodes  added the comment:

Hello Wüstengecko,

Thanks for raising this issue. I've opened a PR which I believe will resolve 
the problem, but it's difficult to verify this against the mock socket setup. 
Feel free to leave feedback.

--

___
Python tracker 

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



[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2020-12-27 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Yurii, this looks nice.  I question whether *name* should be a part of the 
constructor because it immediately gets overridden by __set_name__ method.

>>> class A:
...def x(self):
...return 44
...x = property(x, name='y')
...
>>> vars(A)['x'].name
'x'

--
assignee:  -> rhettinger
nosy: +rhettinger

___
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-27 Thread STINNER Victor


STINNER Victor  added the comment:

I agree that it would be nice to pack these parameters, similar to the Windows 
STARTUPINFO. The subprocess.Popen constructor has more and more parameter for 
functions executed between fork and exec:

def __init__(self, args, bufsize=-1, executable=None,
 stdin=None, stdout=None, stderr=None,
 preexec_fn=None, close_fds=True,
 shell=False, cwd=None, env=None, universal_newlines=None,
 startupinfo=None, creationflags=0,
 restore_signals=True, start_new_session=False,
 pass_fds=(), *, user=None, group=None, extra_groups=None,
 encoding=None, errors=None, text=None, umask=-1, pipesize=-1):

Parameters:

* close_fds: close()
* pass_fds: _Py_set_inheritable_async_safe()
* restore_signals: _Py_RestoreSignals()
* start_new_session: setsid()
* user: setreuid()
* group: setregid()
* extra_groups: setgroups()
* cwd: chdir()
* umask: umask()
* XXX special case: preexec_fn.

Idea of API:
-
preexec = subprocess.Preexec()
preexec.setsid()
preexec.chdir(path)

popen = subprocess.Popen(cmd, preexec=preexec)
popen.wait()
-

It would make error reporting more helpful. For example, if the path type is 
not bytes or str, preexec.chdir(path) call would raise an error, rather than 
getting an error in the complex Popen constructor.

--
nosy: +vstinner

___
Python tracker 

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



[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2020-12-27 Thread Yurii Karabas


Yurii Karabas <1998uri...@gmail.com> added the comment:

Raymond, it's a good question.

I have added `name` to `property` constructor to support cases when a property 
is added to a class after it was declared.

For instance:

```
class Foo:
pass


Foo.foo = property(name='foo')

f = Foo()
f.foo = 10
```

So, in my opinion, it's expected behavior that `name` is overwritten by 
`__set_name__` method.

What do you think about that? Should we change this behevior?

--

___
Python tracker 

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



[issue42755] sqlite3.Connection.backup default value is diffrent between implmentation and docs

2020-12-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset abba83b4b91f78dc556dc0b7700ecb46cba22c01 by Erlend Egeberg 
Aasland in branch 'master':
bpo-42755: Fix sqlite3.Connection.backup docs (GH-23965)
https://github.com/python/cpython/commit/abba83b4b91f78dc556dc0b7700ecb46cba22c01


--
nosy: +pablogsal

___
Python tracker 

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



[issue42755] sqlite3.Connection.backup default value is diffrent between implmentation and docs

2020-12-27 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue42755] sqlite3.Connection.backup default value is diffrent between implmentation and docs

2020-12-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22816
pull_request: https://github.com/python/cpython/pull/23971

___
Python tracker 

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



[issue42755] sqlite3.Connection.backup default value is diffrent between implmentation and docs

2020-12-27 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



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

2020-12-27 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

On Sun, Dec 27, 2020, at 14:53, Gregory P. Smith wrote:
> Most prctl uses I noticed were PDEATHSIG but I'd need to explicitly 
> audit those.  Users don't seem to care about it's documented main 
> thread caveat (which matches what I've seen; most programs don't use 
> non-daemon threads and exit the main thread).

It works great until someone refactors their process-launching code to be 
asynchronous. Anyway, I don't mean to bog this discussion down in the 
advisability and utility of PDEATHSIG. Clearly, it needs to be supported to 
remove even less advisable functionality.

> 
> I want what we do for this to be futureproof for the syscall so that we 
> don't wind up merely picking one feature such as PDEATHSIG to pass a 
> flags through to and needing to add logic to support others later on, 
> delaying the ability to use new system features.

The proposal right now feels like overgeneralization leading to an icky 
interface. It seems in spirit no different form providing a similar interface 
to syscall(3). At some point the interface will become so general it defeats 
the initial purpose of introduction, to disallow arbitrary code execution 
before execve. There will always be new syscalls, multiplexed into prctl/ioctl 
or not, that people want to make before execution. The universal workaround of 
a wrapper program can satisfy those on the vanguard.

--

___
Python tracker 

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



[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2020-12-27 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> In my opinion, it's expected behavior that `name` is 
> overwritten by `__set_name__` method.

It is almost certain that there will be others won't share that expectation.  
The StackOverflow questions and bug reports are inevitable.

Most examples of __set_name__() use a private attribute.  I recommend that you 
go that route and stick to the spirit of the original bug report.  The OP asked 
for better error messages when possible.  They didn't ask for an API expansion.

> I have added `name` to `property` constructor to support cases
> when a property is added to a class after it was declared.

That rarely occurs in practice.  I wouldn't worry about it.  Also AFAICT the 
only time the new error message matters is in the context of a setattr() where 
the attribute isn't already shown in the traceback.  So the case in question is 
really a rarity inside another rarity.  Let's declare YAGNI unless an actual 
end-user problem arises in real-world code.

--

___
Python tracker 

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



[issue42755] sqlite3.Connection.backup default value is diffrent between implmentation and docs

2020-12-27 Thread miss-islington


miss-islington  added the comment:


New changeset 9f6a37cc072dab9f9a13d491d3592d23d9809d2b by Miss Islington (bot) 
in branch '3.9':
bpo-42755: Fix sqlite3.Connection.backup docs (GH-23965)
https://github.com/python/cpython/commit/9f6a37cc072dab9f9a13d491d3592d23d9809d2b


--
nosy: +miss-islington

___
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-27 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
pull_requests: +22817
pull_request: https://github.com/python/cpython/pull/23972

___
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-27 Thread STINNER Victor


STINNER Victor  added the comment:

FYI I wrote an article about this issue: "Isolate Python Subinterpreters"
https://vstinner.github.io/isolate-subinterpreters.html

--

___
Python tracker 

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



[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2020-12-27 Thread Yurii Karabas


Yurii Karabas <1998uri...@gmail.com> added the comment:

You a totally right, looks like I tried to add a feature that no one asked for:)

I have updated PR and removed `name` parameter from `property` constuctor. 
Thanks for your advice.

--

___
Python tracker 

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



[issue42761] Why does python's Popen fail to pass environment variables on Mac OS X?

2020-12-27 Thread AustEcon


New submission from AustEcon :

I have described the issue in a stackoverflow question here:

https://stackoverflow.com/questions/65466303/why-does-pythons-popen-fail-to-pass-environment-variables-on-mac-os-x


In summary, I want to pass environment variables to a child process on Mac OS 
(Big Sur) with Popen but it is not working (works on Win32 and linux platforms).

Any assistance much appreciated,
AustEcon

--
components: Library (Lib)
messages: 383877
nosy: AustEcon
priority: normal
severity: normal
status: open
title: Why does python's Popen fail to pass environment variables on Mac OS X?
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



[issue42761] Why does python's Popen fail to pass environment variables on Mac OS X?

2020-12-27 Thread Benjamin Peterson


Change by Benjamin Peterson :


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



[issue40288] [subinterpreters] atexit module should not be loaded more than once per interpreter

2020-12-27 Thread STINNER Victor


STINNER Victor  added the comment:

Fixed by bpo-42639.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Make atexit state per interpreter

___
Python tracker 

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



[issue42513] Socket.recv hangs

2020-12-27 Thread Jakub Stasiak


Change by Jakub Stasiak :


--
nosy: +jstasiak

___
Python tracker 

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



[issue42758] pathlib.Path to support the "in" operator (x in y)

2020-12-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

Can you describe what this would do? How is it different from 
path.is_relative_to(other_path)?

>>> import pathlib
>>> pathlib.Path('/home/Torxed/machine.qcow2').is_relative_to(pathlib.Path('/home/Torxed'))
True

--
nosy: +eric.smith

___
Python tracker 

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



[issue42758] pathlib.Path to support the "in" operator (x in y)

2020-12-27 Thread Eric V. Smith


Change by Eric V. Smith :


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



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

2020-12-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 897387d2c8a956e74770c6bdd0447dfec61e8e27 by Erlend Egeberg 
Aasland in branch 'master':
bpo-1635741: sqlite3: Fix ref leak introduced by commit bf64d90 (GH-23972)
https://github.com/python/cpython/commit/897387d2c8a956e74770c6bdd0447dfec61e8e27


--

___
Python tracker 

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



[issue23328] urllib.request fails for proxy credentials that contain a '/' character

2020-12-27 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
keywords: +patch
pull_requests: +22818
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/23973

___
Python tracker 

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



[issue23328] urllib.request fails for proxy credentials that contain a '/' character

2020-12-27 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

https://github.com/python/cpython/pull/23973 will resolve this issue.  The 
issue was localized to _parse_proxy method in urllib2.

--

___
Python tracker 

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



[issue42762] infinite loop resulted by "yield"

2020-12-27 Thread Xinmeng Xia


New submission from Xinmeng Xia :

Let's see the following program:


def foo():
try:
yield
except:
yield from foo()

for m in foo():
print(i)
===

Expected output:
On line"print(i)",  NameError: name 'i' is not defined


However, the program will fall into infinite loops when running it on Python 
3.7-3.10 with the error messages like the following.(no infinite loop on Python 
3.5 and Python 3.6)
--
Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/report/test1.py", line 160, in 
print(i)
RuntimeError: generator ignored GeneratorExit
Exception ignored in: 
Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/report/test1.py", line 160, in 
print(i)
RuntimeError: generator ignored GeneratorExit
Exception ignored in: 
Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/report/test1.py", line 160, in 
print(i)
RuntimeError: generator ignored GeneratorExit
Exception ignored in: 
Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/report/test1.py", line 160, in 
print(i)
..
--

--
components: Interpreter Core
messages: 383882
nosy: xxm
priority: normal
severity: normal
status: open
title: infinite loop resulted by "yield"
type: crash
versions: Python 3.10, 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



[issue42763] Exposing a race in the "_warnings" resulting Python parser crash

2020-12-27 Thread Xinmeng Xia


New submission from Xinmeng Xia :

This program is initially from 
"cpython/Lib/test/crashers/warnings_del_crasher.py" in Python 2.7. The original 
case is fixed for all version of Python and removed from "crashers" directory. 
However, if we replace the statement  "for i in range(10):" of original program 
 with the statement "for do_work in range(10):" . The race will happen again, 
and it will crash Python 3.7 - 3.10.
==
import threading
import warnings

class WarnOnDel(object):
def __del__(self):
warnings.warn("oh no something went wrong", UserWarning)

def do_work():
while True:
w = WarnOnDel()

-for i in range(10):
+for do_work in range(10):
t = threading.Thread(target=do_work)
t.setDaemon(1)
t.start()
=


Error messages on Python 3.7-3.10:
---
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/python310/lib/python3.10/threading.py", line 960, in 
_bootstrap_inner
Exception in thread Thread-3:
Traceback (most recent call last):
Exception in thread Thread-4:
  File "/usr/local/python310/lib/python3.10/threading.py", line 960, in 
_bootstrap_inner
Exception in thread Thread-5:
Traceback (most recent call last):
self.run()
Traceback (most recent call last):
self.run()
Exception in thread Thread-6:
Exception in thread Thread-8:
Exception in thread Thread-9:
Exception in thread Thread-10:
Fatal Python error: _enter_buffered_busy: could not acquire lock for 
<_io.BufferedWriter name=''> at interpreter shutdown, possibly due to 
daemon threads
Python runtime state: finalizing (tstate=0x2679180)

Current thread 0x7f3481d3a700 (most recent call first):

Aborted (core dumped)

--
components: Interpreter Core
messages: 383883
nosy: xxm
priority: normal
severity: normal
status: open
title: Exposing a race in the "_warnings" resulting Python parser crash
type: crash
versions: Python 3.10, 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



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

2020-12-27 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Felt and understood.

The plethora of things to do between (v)fork+exec really makes me wish for a 
"little" eBPF interpreter rather than needing so much specific plumbing.  But 
that'd have the same problem as preexec_fn: in absence of something that 
declares an operation safe or not, it'd open the door to unsafe and leave us in 
no better state than preexec_fn.

--

___
Python tracker 

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



[issue41354] filecmp.cmp documentation does not match actual code

2020-12-27 Thread Christof Hanke


Christof Hanke  added the comment:

I understand that you are reluctant to change existing code.
But for me as a sysadmin, the current behavior doesn't make sense for two 
reasons:

* st.st_size is part of _sig.  why would you do a deep compare if  the two 
files have a different length ?

* comparing thousands of files, a proper shallow-only compare is required, 
since it takes a long time to compare large files (especially when they are 
migrated to a tape-backend), so a silent-fallback to a deep-compare is not good.

--

___
Python tracker 

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