[issue45296] IDLE: Better document close and exit.

2021-09-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Unfortunately, I have discovered, the new wording is better but only correct 
for IDLE when Shell is the only window.

On the file menu, I want to:
A. Change 'Close' to 'Close Window', so it is clear that 'Close'/Alt-F4 only 
close the window and not IDLE.
B. Also change 'Exit' to 'Exit IDLE' or maybe 'Quit IDLE', so it is clearer 
that this and Ctrl-Q close all windows and exit IDLE.  Ctrl-Q is the default 
binding for 'close-all-windows', which users can configure.

Also, add a little in the doc entry for these choices.  Or maybe open a 
separate issue to add the option name for all menu entry hotkeys that can be 
rebound.  I don't know how many that is.

For a single window app, like the REPL, when not running in Command Prompt or 
the equivalent, closing the window and exiting the application are the same 
thing.  The same is true when Shell is the only IDLE window.  Closing Shell 
exits IDLE.  After submitting the PR, I discovered that exit() and quit() only 
close Shell but do not exit IDLE if there are other windows.  So the message 
should really be something like the following:

To close Shell, enter 'exit()', 'quit()', or 'Alt-F4'.
To exit IDLE, hit 'Ctrl-Q', hotkey for 'File >= Exit IDLE'.

This requires replacing the __repr__ method.  Someone who rebinds either hotkey 
option, which I expect is rare, will have to remember that they did so if that 
happen to enter either 'exit' or 'quit' without parens.
--

The question of IDLE on Windows and <^Z Return> was discussed some years ago on 
an issue a vaguely remember but could not find.  It was decided to either not 
add it or maybe to remove it, and key cross-platform ^D for closing Shell (and 
only Shell as it does nothing in Editor).  I don't want to change that decision.

--
nosy:  -miss-islington
resolution: fixed -> 
stage: resolved -> 
status: closed -> open
title: IDLE: Change Ctrl-Z note in exit/quit repr on Windows -> IDLE: Better 
document close and exit.

___
Python tracker 

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



[issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process

2021-09-28 Thread eleven xiang


Change by eleven xiang :


--
resolution: not a bug -> 

___
Python tracker 

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



[issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process

2021-09-28 Thread eleven xiang


eleven xiang  added the comment:

Below is the log:

// parent process call and increase it from 10 to 11.
process 71481, this = 0x7f4f271b5054, m_val = 10, A constructor called!!!
process 71481, this = 0x7f4f271b5054, m_val = 11, INC called!!!

// child process inherit with 11, and then also increase from 11 to 12
process 71482, this = 0x7f4f271b5054, m_val = 12, INC called!!!

// child process free it.
process 71482, this = 0x7f4f271b5054, m_val = 12, A destructor called!!!
// parent process free it.
process 71481, this = 0x7f4f271b5054, m_val = 11, A destructor called!!!

--

___
Python tracker 

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



[issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process

2021-09-28 Thread eleven xiang


eleven xiang  added the comment:

I still have some questions about is, so re-open it.

You mean it is the fork principle, but if change the script to use os.fork(), 
the child process will inherit from parent, and also free it.

You could refer below change:


from ctypes import cdll
import multiprocessing as mp
import os

def foo():
handle = cdll.LoadLibrary("./test.so")
handle.IncA()

if __name__ == '__main__':
foo()
#p = mp.Process(target = foo, args = ())
#p.start()
#print(p.pid)
#p.join()

pid = os.fork()
if pid == 0:
foo()
else:
os.waitpid(pid, 0)

--
status: closed -> open

___
Python tracker 

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



[issue40321] urllib.request does not support HTTP response status code 308

2021-09-28 Thread Roland Crosby


Roland Crosby  added the comment:

Hi, wanted to ping those watching this issue - there is a complete PR on 
GitHub, and all contributors have signed the CLA, but the bot hasn't updated 
the CLA status on the PR so it's still shown as blocking. Would appreciate if 
someone could manually fix the status and help get this merged.

--
nosy: +rolandcrosby

___
Python tracker 

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



[issue45313] Counter.elements() wrong error message

2021-09-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The elements() method is working correctly:

>>> from collections import Counter
>>> aCounter = Counter('abracadabra')
>>> list(aCounter.elements())
['a', 'a', 'a', 'a', 'a', 'b', 'b', 'r', 'r', 'c', 'd']

No arguments should be passed into elements, so this code is incorrect:

aCounter.elements(1)

You may have expected that the error message would say:

TypeError: Counter.elements() takes 0 positional argument but 1 was given

Instead, you observed the counts were one higher than you expected.

This is due to how Python implements object oriented programming.

The call:

aCounter.elements(1)

is effectively translated to:

Counter.elements(aCounter, 1)

which does in fact have two arguments.

No one really likes the error message, but it has been deemed hard to fix and 
we just live with it.

Note, this isn't specific to Counter.  All pure python classes work this way:

>>> class A:
def m(self, x):
pass

>>> a = A()
>>> a.m(10, 20)
Traceback (most recent call last):
  File "", line 1, in 
a.m(10, 20)
TypeError: m() takes 2 positional arguments but 3 were given

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-09-28 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

Shouldn't we just close the issue and the unused PR? Otherwise we'll just have 
yet another vague bpo issue that doesn't have anything particularly actionable 
-- "there's some code that could be refactored" is not enough of a reason to 
have a bpo issue open, unless it's either a recurring maintenance chore 
(doesn't seem to be the case here) or something that a beginner could easily 
scoop up (definitely not the case here, there are subtleties lurking around 
every corner).

--

___
Python tracker 

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



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-28 Thread Eric Snow


Eric Snow  added the comment:

I have what I need for now (stdlib dir).  There may be more info to preserve, 
but I'll leave it others to pursue that.

--
assignee: eric.snow -> 

___
Python tracker 

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



[issue22239] asyncio: nested event loop

2021-09-28 Thread Rob Moore


Change by Rob Moore :


--
nosy: +rob.moore

___
Python tracker 

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



[issue45269] c_make_encoder() has uncovered error: "argument 1 must be dict or None"

2021-09-28 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks, Nikita! ✨  ✨

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



[issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary

2021-09-28 Thread Steve Dower


Steve Dower  added the comment:

Looks like you should take the discussion to issue35665, and this one can stay 
closed.

--

___
Python tracker 

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



[issue45269] c_make_encoder() has uncovered error: "argument 1 must be dict or None"

2021-09-28 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 1cb17be3e6a4d94629606a613acd07f78d50348b by Miss Islington (bot) 
in branch '3.10':
bpo-45269: test wrong `markers` type to `c_make_encoder` (GH-28540) (GH-28609)
https://github.com/python/cpython/commit/1cb17be3e6a4d94629606a613acd07f78d50348b


--

___
Python tracker 

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



[issue45269] c_make_encoder() has uncovered error: "argument 1 must be dict or None"

2021-09-28 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset c6b5ceae3475d7782ed88f4e54bdb2232a8eb088 by Miss Islington (bot) 
in branch '3.9':
bpo-45269: test wrong `markers` type to `c_make_encoder` (GH-28540) (GH-28610)
https://github.com/python/cpython/commit/c6b5ceae3475d7782ed88f4e54bdb2232a8eb088


--

___
Python tracker 

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



[issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute

2021-09-28 Thread pukkandan


pukkandan  added the comment:

> A workaround for Python would require a major rewrite of the Windows CA store 
> integration. We don't have any capacity to work on that area

In theory, the issue can be worked around by simply loading each certificate 
separately. See 
https://github.com/yt-dlp/yt-dlp/pull/1118/commits/599ca418ac75ab1c0baf97f184f32ac48aa759ed

--
nosy: +pukkandan

___
Python tracker 

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



[issue45269] c_make_encoder() has uncovered error: "argument 1 must be dict or None"

2021-09-28 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset e046aabbe386fdf32bae6ffb7fae5ce479fd10c6 by Nikita Sobolev in 
branch 'main':
bpo-45269: test wrong `markers` type to `c_make_encoder` (GH-28540)
https://github.com/python/cpython/commit/e046aabbe386fdf32bae6ffb7fae5ce479fd10c6


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45269] c_make_encoder() has uncovered error: "argument 1 must be dict or None"

2021-09-28 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +26980
pull_request: https://github.com/python/cpython/pull/28609

___
Python tracker 

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



[issue45269] c_make_encoder() has uncovered error: "argument 1 must be dict or None"

2021-09-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26981
pull_request: https://github.com/python/cpython/pull/28610

___
Python tracker 

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



[issue45307] Removal of _PyImport_FindExtensionObject() in 3.10 limits custom extension module loaders

2021-09-28 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset ec4e2ec241acb3bf4e04a351c06c0b05a1e4b7d2 by Serhiy Storchaka in 
branch '3.10':
[3.10] bpo-45307: Restore private C API function 
_PyImport_FindExtensionObject() (GH-28594)
https://github.com/python/cpython/commit/ec4e2ec241acb3bf4e04a351c06c0b05a1e4b7d2


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue15870] PyType_FromSpec should take metaclass as an argument

2021-09-28 Thread Sebastian Berg


Sebastian Berg  added the comment:

> But if tp_name is created dynamically, it could lead to a dangling pointer.

I will guess this is probably just an oversight/bug since the main aim was to 
move towards heap-types, and opened an issue: https://bugs.python.org/issue45315

--

___
Python tracker 

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



[issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute

2021-09-28 Thread Christian Heimes


Christian Heimes  added the comment:

Could you please open an OpenSSL bug on the projects bug tracker 
https://github.com/openssl/openssl/ and explain the issue there? They might be 
able to implement a workaround for the broken certificates or advise you how to 
handle the invalid certificates.

A workaround for Python would require a major rewrite of the Windows CA store 
integration. We don't have any capacity to work on that area. Even if we had 
capacity, a workaround would land in Python 3.11 earliest (October 2022).

--

___
Python tracker 

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



[issue45315] `PyType_FromSpec` does not copy the name

2021-09-28 Thread Sebastian Berg


New submission from Sebastian Berg :

As noted in the issue: https://bugs.python.org/issue15870#msg402800 
`PyType_FromSpec` assumes that the `name` passed is persistent for the program 
lifetime.  This seems wrong/unnecessary: We are creating a heap-type, a 
heap-type's name is stored as a unicode object anyway!

So, there is no reason to require the string be persistent, and a program that 
decides to build a custom name dynamically (for whatever reasons) would run 
into a crash when the name is accessed.

The code:

https://github.com/python/cpython/blob/0c50b8c0b8274d54d6b71ed7bd21057d3642f138/Objects/typeobject.c#L3427

Should be modified to point to to the `ht_name` (utf8) data instead.  My guess 
is, the simplest solution is calling `type_set_name`, even if that runs some 
unnecessary checks.

I understand that the FromSpec API is mostly designed to replace the static 
type definition rather than extend it, but it seems an unintentional/strange 
requirement.

--
components: Interpreter Core
messages: 402804
nosy: seberg
priority: normal
severity: normal
status: open
title: `PyType_FromSpec` does not copy the name
type: crash
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



[issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary

2021-09-28 Thread Christian Heimes


Change by Christian Heimes :


--
assignee: christian.heimes -> 
nosy:  -christian.heimes

___
Python tracker 

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



[issue35606] Add prod() function to the math module

2021-09-28 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset cd00fee8dd63bc3a1360280f55640409cb579a05 by Miss Islington (bot) 
in branch '3.9':
bpo-35606: Fix math.prod tests using 'start' as keyword parameter (GH-28595) 
(GH-28604)
https://github.com/python/cpython/commit/cd00fee8dd63bc3a1360280f55640409cb579a05


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue41223] `object`-backed `memoryview`'s `tolist` errors

2021-09-28 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Can you describe your use-case more? In particular, why use 
memoryview(a).tolist() instead of a.tolist()? Or some other numpy operations 
like a.flat or a.view()? Or even numpy.array(memoryview(a)) to recover a numpy 
array from a memoryview?

If this were implemented and stdlib memoryview objects supported some kind of 
object 'O' format, would list(memoryview(b"\0\0\0\0\0\0\0\0").cast('O')) 
dereference a null pointer and segfault?

--
components: +Interpreter Core
nosy: +Dennis Sweeney
type:  -> enhancement
versions:  -Python 3.10, Python 3.6, 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



[issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary

2021-09-28 Thread Pedjas


Pedjas  added the comment:

This hurts number of Python applications, even those published by large 
players. Basically, any attempt to read any certificate (for example to load 
any https url) fails due to this issue.

For example:

- QGIS fails to load map tiles on https links. Python issue with certificates.

- AutoDesk Fusion 360 cannot be installed. On install, it requires online 
activation. Activation is done using https link. That does not work as Python 
fails on certificates.

And that is a bug of Python. If you check code that causes this issue you will 
notice problem in code.

1.  When some certificate is needed Python loops and tries to load each and 
every certificate installed instead of loading only certificate that is 
actually needed and skip others.

2. No exception handling. When trying to load "bad" certificate, Python just 
crashes instead of graciously handle (skip) issue.

This problem occurs only with Python. No other application has such issue when 
handling certificates. MUPCA certificate works fine with every other 
application.

This issue can be easily solved with one simple if and one simple exception 
handler: loop through certificate. Only if certificate is the one needed try to 
load it. Enclose loading code within exception, if it fails, report descriptive 
error, and skip further. Do not allow Python to crash.

--
nosy: +Pedjas

___
Python tracker 

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



[issue15870] PyType_FromSpec should take metaclass as an argument

2021-09-28 Thread Josh Haberman


Josh Haberman  added the comment:

> Everything is copied by `_FromSpec` after all.

One thing I noticed isn't copied is the string pointed to by tp_name: 
https://github.com/python/cpython/blob/0c50b8c0b8274d54d6b71ed7bd21057d3642f138/Objects/typeobject.c#L3427

This isn't an issue if tp_name is initialized from a string literal.  But if 
tp_name is created dynamically, it could lead to a dangling pointer.  If the 
general message is that "everything is copied by _FromSpec", it might make 
sense to copy the tp_name string too.

> However, I suppose that would replace a safe-by-design API with a "best 
> practice" to never define the spec/slots statically (a best practice that is 
> probably not generally followed or even advertised currently, I guess).

Yes that seems reasonable.  I generally prefer static declarations, since they 
will end up in .data instead of .text and will avoid a copy to the stack at 
runtime.  But these are very minor differences, especially for code that only 
runs once at startup, and a safe-by-default recommendation of always 
initializing PyType_* on the stack makes sense.

--

___
Python tracker 

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



[issue45314] Using target python while cross-building

2021-09-28 Thread Frans


New submission from Frans :

While trying to cross-compile Python-3.9.7, I came across the next error report:

i586-cross-linux-gcc -Xlinker -export-dynamic -o python Programs/python.o 
-L. -lpython3.9 -lcrypt -ldl  -lpthread -lm   -lm  
_PYTHON_PROJECT_BASE=/mnt/lfs/sources-base/Python-3.9.7 
_PYTHON_HOST_PLATFORM=linux-i586 PYTHONPATH=./Lib 
_PYTHON_SYSCONFIGDATA_NAME=_sys
configdata__linux_i386-linux-gnu python -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
   echo "generate-posix-vars failed" ; \
   rm -f ./pybuilddir.txt ; \
   exit 1 ; \
fi
/bin/sh: line 1: python: command not found
generate-posix-vars failed
make: *** [Makefile:619: pybuilddir.txt] Error 1
---
Strange, because Python configure/Makefile known that we are cross-compiling, 
but still try to execute a program with the target architecture, which is not 
the same as the architecture of the build machine. Of course it fails.

--
components: Cross-Build
messages: 402799
nosy: Alex.Willmer, fransdb
priority: normal
severity: normal
status: open
title: Using target python while cross-building
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



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-28 Thread Eric Snow


Eric Snow  added the comment:


New changeset 0c50b8c0b8274d54d6b71ed7bd21057d3642f138 by Eric Snow in branch 
'main':
bpo-45211: Remember the stdlib dir during startup. (gh-28586)
https://github.com/python/cpython/commit/0c50b8c0b8274d54d6b71ed7bd21057d3642f138


--

___
Python tracker 

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



[issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1

2021-09-28 Thread sping


sping  added the comment:

For the AIX link error that Pablo brought up, there is merged pull request 
https://github.com/libexpat/libexpat/pull/510 upstream.

--

___
Python tracker 

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



[issue45313] Counter.elements() wrong error message

2021-09-28 Thread Eric V. Smith


Eric V. Smith  added the comment:

When reporting a bug, please give a full example that we can run. I assume 
aCounter is of type collections.Counter?

Assuming so, the "1 positional argument" is "self". The second argument is the 
number 1, which is an error. So the error is correct.

--
nosy: +eric.smith

___
Python tracker 

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



[issue45313] Counter.elements() wrong error message

2021-09-28 Thread bytebites


New submission from bytebites :

aCounter.elements(1) gives wrong error message:
TypeError: Counter.elements() takes 1 positional argument but 2 were given

--
messages: 402795
nosy: bytebites
priority: normal
severity: normal
status: open
title: Counter.elements() wrong error message
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



[issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute

2021-09-28 Thread Dimitrije Milović

Dimitrije Milović  added the comment:

Maybe better to continue in my newly opened tread 
https://bugs.python.org/issue45312 since I suppose I wasn't correctly specific 
(read I am a noob!), and pukkandan was more so.

And my government fixing their certificates?! No chance i hell, they are like 
this for more of a decade! :smirk:

--

___
Python tracker 

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



[issue15870] PyType_FromSpec should take metaclass as an argument

2021-09-28 Thread Sebastian Berg

Sebastian Berg  added the comment:

Just to note, that there are two – somewhat distinct – issues here in my 
opinion:

1. `FromSpec` does not scan `bases` for the correct metaclass, which it could; 
this could even be considered a bug?
2. You cannot pass in a desired metaclass, which may require a new API function.

My patch tries to address the first (the class creator has to take care that 
this is reasonable for the metaclass).  I had hoped the `slot` mechanism can 
avoid the API discussion for the second one, but I guess not.


On the discussion on `tp_type/meta` being incorrect usage:
I am slightly surprised we actually care about static C-definitions?

There is no reason that a `spec` should be declared static (aside that you have 
to move it into the function otherwise)?  Everything is copied by `_FromSpec` 
after all.
However, I suppose that would replace a safe-by-design API with a "best 
practice" to never define the spec/slots statically (a best practice that is 
probably not generally followed or even advertised currently, I guess).

--

___
Python tracker 

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



[issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute

2021-09-28 Thread Christian Heimes


Christian Heimes  added the comment:

We cannot fix the issue in Python. Please report the problem to OpenSSL and to 
your government. Either OpenSSL needs to relax its cert parser again or your 
government has to replace the broken certificates with correct certificates.

--
assignee: christian.heimes -> 
resolution:  -> third party

___
Python tracker 

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



[issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary

2021-09-28 Thread Christian Heimes


Change by Christian Heimes :


--
dependencies: +Function ssl.create_default_context raises exception on Windows 
10  when called with  ssl.Purpose.SERVER_AUTH) attribute
superseder:  -> Function ssl.create_default_context raises exception on Windows 
10  when called with  ssl.Purpose.SERVER_AUTH) attribute

___
Python tracker 

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



[issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary

2021-09-28 Thread pukkandan


pukkandan  added the comment:

Also, the pictures uploaded by the OP are misleading since they are from a 
version of the code that was specifically intended for debugging the issue. the 
problem can be better seen in this comment 
https://github.com/yt-dlp/yt-dlp/issues/1060#issuecomment-925843378

```py
C:\Windows\system32>py
Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> len(ssl.enum_certificates('ROOT'))
68
>>> len(ssl.enum_certificates('CA'))
39
>>> ssl.create_default_context()
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Program Files\Python39\lib\ssl.py", line 750, in 
create_default_context
context.load_default_certs(purpose)
  File "C:\Program Files\Python39\lib\ssl.py", line 574, in load_default_certs
self._load_windows_store_certs(storename, purpose)
  File "C:\Program Files\Python39\lib\ssl.py", line 566, in 
_load_windows_store_certs
self.load_verify_locations(cadata=certs)
ssl.SSLError: not enough data: cadata does not contain a certificate 
(_ssl.c:4159)
>>> exit()
```

--

___
Python tracker 

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



[issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary

2021-09-28 Thread Steve Dower


Steve Dower  added the comment:

Adding Christian, as he's our expert in this area, and was also driving the 
other bug.

--
assignee:  -> christian.heimes
components: +SSL
nosy: +christian.heimes

___
Python tracker 

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



[issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary

2021-09-28 Thread pukkandan


pukkandan  added the comment:

Hi,

I am the maintainer of the above mentioned project. I was planning to implement 
a patch for this. But I asked OP to report the issue here anyway since I do not 
believe this is the intended behavior. 

For context, the issue is occurring when using the `ssl.create_default_context` 
function and not by manually adding the verify flag. For this, the default (in 
my opinion) should be to ignore any invalid certificates. Even the comment in 
the relevent code 
(https://github.com/python/cpython/blob/84975146a7ce64f1d50dcec8311b7f7188a5c962/Lib/ssl.py#L772-L774)
 seem to agree with my sentiment. 

I ask that you please reconsider your stance on this issue. Thanks

--
nosy: +pukkandan

___
Python tracker 

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



[issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary

2021-09-28 Thread Steve Dower


Steve Dower  added the comment:

Python doesn't include any trusted certificates - it reads them from the 
operating system. So you'll need to get the operating system vendors to include 
it if you want it to be trusted by default.

Additionally, some libraries include a copy of Mozilla's bundle (usually via 
the certifi package) and override the operating system. You'd need them to also 
include it.

--
resolution: remind -> third party

___
Python tracker 

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



[issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary

2021-09-28 Thread Dimitrije Milović

Dimitrije Milović  added the comment:

OK, will let the yt-dlp author pukkandan on GitHub know.
Thanks for the quick answer.

The only downside in this will be that this will have to be donne for many 
programs and scripts in the future; and for more and more persons (using our ID 
certificate will be only more preponderant as time passes).
So is it impossible to just somehow circumvent or add as exclusions those 
certificates? I could send them all to you..?

--
resolution: third party -> remind

___
Python tracker 

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



[issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary

2021-09-28 Thread Steve Dower


Steve Dower  added the comment:

This needs to be a feature request against the script that you're running. They 
have the option of not verifying TLS certificates if they choose not to, but 
they are explicitly enabling the checks right now.

We can't add a command line option to disable it for them. You'll need to find 
the place where they work and request it there.

--
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue45256] Remove the usage of the C stack in Python to Python calls

2021-09-28 Thread Steve Dower


Steve Dower  added the comment:

The goal is reduced stack depth, not reframing the entire call model around not 
having a C stack.

We can't even reasonably rewrite getattr() without supporting callbacks from C 
into Python, so further generalisation is very unlikely.

But if you inspect the native stack of most Python programs, you'll see that 
it's mostly taken up with calls within Python code. Compressing all of those is 
a significant advantage, akin to inlining the Python code at compile time, even 
if it doesn't see "through" native calls.

--

___
Python tracker 

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



[issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary

2021-09-28 Thread Dimitrije Milović

Change by Dimitrije Milović :


Added file: 
https://bugs.python.org/file50314/135087546-e6fd1b05-6858-4e0f-ad3f-857c614bb15b.png

___
Python tracker 

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



[issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary

2021-09-28 Thread Dimitrije Milović

Change by Dimitrije Milović :


Added file: 
https://bugs.python.org/file50313/135081521-83d466d9-c71d-465c-96a2-652c2549c461.png

___
Python tracker 

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



[issue45312] "MUPCA Root" Certificates - treated as invalid and cause error, but are walid and necessary

2021-09-28 Thread Dimitrije Milović

New submission from Dimitrije Milović :

I just commented to the issue here 
https://bugs.python.org/issue35665?@ok_message=issue%2035665%20files%20edited%20ok&@template=item,
 but noticed "closed" so better start a new one issue, and to further update 
the importance of those certificates...

I came to this issue (still persistent with all python versions since 3.6) 
while using yt-dlp: https://github.com/yt-dlp/yt-dlp/issues/1060

I obviously have the SAME problem than the guys in your link since I am from 
Serbia too, and those certificates "MUPCA Root" are (unfortunately-badly 
executed) crucial (issued by the ministry of interior - police ) ones to be 
able too read ID cards and use personal signing certificates, and they're are 
all valid...
So the option to remove the faulty certificates, is a no go to me (or anyone in 
Serbia using their ID card - individuals, companies and entrepreneurs like 
me)...

Please help!

--
components: Windows
files: Untitled.png
messages: 402784
nosy: MDM-1, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: "MUPCA Root" Certificates - treated as invalid and cause error, but are 
walid and necessary
type: crash
versions: Python 3.9
Added file: https://bugs.python.org/file50312/Untitled.png

___
Python tracker 

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



[issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1

2021-09-28 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

The backport to 3.8 broke 3.8.12 in AIX:


0/Modules/_decimal/libmpdec/sixstep.o 
build/temp.aix-7.1-3.8/tmp/python3.8-3.8.12-0/Modules/_decimal/libmpdec/transpose.o
 -L. -L/opt/bb/lib -L/opt/bb/lib64 -R/opt/bb/lib64 -lm -o 
build/lib.aix-7.1-3.8/_decimal.cpython-38.so

*** WARNING: renaming "pyexpat" since importing it failed: rtld: 0712-001 
Symbol _isnanf was referenced
from module build/lib.aix-7.1-3.8/pyexpat.cpython-38.so(), but a runtime 
definition of the symbol was not found.

--

___
Python tracker 

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



[issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute

2021-09-28 Thread Dimitrije Milović

Change by Dimitrije Milović :


Removed file: https://bugs.python.org/file50310/Untitled.png

___
Python tracker 

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



[issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute

2021-09-28 Thread Dimitrije Milović

Change by Dimitrije Milović :


Added file: https://bugs.python.org/file50311/Untitled.png

___
Python tracker 

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



[issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute

2021-09-28 Thread Dimitrije Milović

Dimitrije Milović  added the comment:

Just to ad to the issue, and to further update the importance of those 
certificates...

I came to this issue (still persistent with all python versions since 3.6) 
while using yt-dlp: https://github.com/yt-dlp/yt-dlp/issues/1060

I obviously have the SAME problem than the guy in your link since I am from 
Serbia too, and those certificates "MUPCA Root" are (unfortunately-badly 
executed) crucial (issued by the ministry of interior - police ) ones to be 
able too read ID cards and use personal signing certificates, and they're are 
all valid...
So the option to remove the faulty certificates, is a no go to me (or anyone in 
Serbia using their ID card - individuals, companies and entrepreneurs like 
me)...

Please help!

--
nosy: +MDM-1
versions: +Python 3.9 -Python 3.7

___
Python tracker 

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



[issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute

2021-09-28 Thread Dimitrije Milović

Change by Dimitrije Milović :


Added file: https://bugs.python.org/file50310/Untitled.png

___
Python tracker 

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



[issue44919] TypedDict subtypes ignore any other metaclasses in 3.9+

2021-09-28 Thread Łukasz Langa

Łukasz Langa  added the comment:

The change to disallow this in Python 3.9 was deliberate, see BPO-40187 and its 
description.

Your attempt to make `isinstance()` work with TypedDict subclasses goes 
directly against this design. In fact, PEP 589 explicitly says that:

- Methods are not allowed, since the runtime type of a TypedDict object will 
always be just dict (it is never a subclass of dict).
- Specifying a metaclass is not allowed.

I'm -1 to allow this but I'll also wait for Serhiy to voice his opinion.

--
nosy: +lukasz.langa, serhiy.storchaka

___
Python tracker 

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



[issue45256] Remove the usage of the C stack in Python to Python calls

2021-09-28 Thread Christian Tismer


Christian Tismer  added the comment:

Very much appreciated approach. 
Too bad that things stop when people are writing extensions as usual. Or do you 
think we can teach them how to avoid the C stack? Anyway, good luck!

--

___
Python tracker 

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



[issue28206] signal.Signals not documented

2021-09-28 Thread Hinrich Mahler


Change by Hinrich Mahler :


--
nosy: +Bibo-Joshi

___
Python tracker 

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



[issue45311] Threading Semaphore and BoundedSemaphore release method implementation improvement

2021-09-28 Thread Besart Dollma


New submission from Besart Dollma :

Hi, 
I was looking at the implementation of Semaphore and BoundedSemaphore in 
threading.py and I saw that `notify` is called on a loop n times while it 
supports an n parameter. 

https://github.com/python/cpython/blob/84975146a7ce64f1d50dcec8311b7f7188a5c962/Lib/threading.py#L479

Unless I am missing something, removing the loop and replacing it with 
self._cond.notify(n) will slightly improve performance by avoiding the function 
call overhead.

I can prepare a Pool Request if the change is acceptable.
Thanks,

--
components: Library (Lib)
messages: 402779
nosy: besi7dollma
priority: normal
severity: normal
status: open
title: Threading Semaphore and BoundedSemaphore release method implementation 
improvement
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue35606] Add prod() function to the math module

2021-09-28 Thread miss-islington


miss-islington  added the comment:


New changeset fd52afd1928643a715202147b1ce5b0d130ec252 by Miss Islington (bot) 
in branch '3.10':
bpo-35606: Fix math.prod tests using 'start' as keyword parameter (GH-28595)
https://github.com/python/cpython/commit/fd52afd1928643a715202147b1ce5b0d130ec252


--

___
Python tracker 

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



[issue45307] Removal of _PyImport_FindExtensionObject() in 3.10 limits custom extension module loaders

2021-09-28 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> I don't understand which long term solution do you propose.


A kind reminder that for 3.10 we cannot add new APIs so this proposal still 
*makes sense* for the short term (3.10).

--

___
Python tracker 

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



[issue45307] Removal of _PyImport_FindExtensionObject() in 3.10 limits custom extension module loaders

2021-09-28 Thread STINNER Victor


STINNER Victor  added the comment:

> Until 3.10 makes equivalent functionality available or another workaround is 
> supported,

I don't understand which long term solution do you propose.

> a properly designed public API is probably a better solution

Can you propose a public API?

--

___
Python tracker 

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



[issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows

2021-09-28 Thread Łukasz Langa

Łukasz Langa  added the comment:

The wording chosen by Terry, i.e. "Ctrl-D (end-of-file)", is pretty clear. 
Merged and fixed. Thanks!

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



[issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows

2021-09-28 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset acd46feff3c06d3f1d00ab850e530c519445a737 by Miss Islington (bot) 
in branch '3.10':
bpo-45296: Fix exit/quit message on Windows (GH-28577) (GH-28600)
https://github.com/python/cpython/commit/acd46feff3c06d3f1d00ab850e530c519445a737


--

___
Python tracker 

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



[issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows

2021-09-28 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 813fbba4cab4556e55d6044c05725a26ec20b648 by Miss Islington (bot) 
in branch '3.9':
bpo-45296: Fix exit/quit message on Windows (GH-28577) (GH-28601)
https://github.com/python/cpython/commit/813fbba4cab4556e55d6044c05725a26ec20b648


--

___
Python tracker 

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



[issue35606] Add prod() function to the math module

2021-09-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26979
pull_request: https://github.com/python/cpython/pull/28604

___
Python tracker 

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



[issue35606] Add prod() function to the math module

2021-09-28 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 84975146a7ce64f1d50dcec8311b7f7188a5c962 by Pablo Galindo Salgado 
in branch 'main':
bpo-35606: Fix math.prod tests using 'start' as keyword parameter (GH-28595)
https://github.com/python/cpython/commit/84975146a7ce64f1d50dcec8311b7f7188a5c962


--

___
Python tracker 

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



[issue35606] Add prod() function to the math module

2021-09-28 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 11.0 -> 12.0
pull_requests: +26978
pull_request: https://github.com/python/cpython/pull/28603

___
Python tracker 

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



[issue45254] HAS_SHMEM detection logic is duplicated in implementation and tests

2021-09-28 Thread Łukasz Langa

Łukasz Langa  added the comment:

The logic is currently duplicated because trying to import `shared_memory` is 
how support discovery is supposed to work in user code.

`multiprocessing.managers` doesn't export HAS_SHMEM (it's not in `__all__` and 
it's not documented). Making tests rely on it feels wrong to me. It might 
change in the future.

--
nosy: +lukasz.langa
resolution:  -> rejected
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



[issue45310] test_multiprocessing_forkserver: test_shared_memory_basics() failed with FileExistsError: [Errno 17] File exists: '/test01_tsmb'

2021-09-28 Thread STINNER Victor


New submission from STINNER Victor :

AMD64 Fedora Stable LTO + PGO 3.10 (build 357):
https://buildbot.python.org/all/#/builders/651/builds/357

First test_multiprocessing_forkserver failed, then test_multiprocessing_spawn, 
then test_multiprocessing_fork.

I confirm that these tests fail if the /test01_tsmb shared memory exists.

The test is supposed to unlink the shared memory once the test completes:

def test_shared_memory_basics(self):
sms = shared_memory.SharedMemory('test01_tsmb', create=True, size=512)
self.addCleanup(sms.unlink)

Maybe the whole process was killed while the test was running.

I removed it manually:

sudo ./python -c "import _posixshmem; 
_posixshmem.shm_unlink('/test01_tsmb')"

Logs:

Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64.lto-pgo/build/Lib/multiprocessing/resource_tracker.py",
 line 209, in main
cache[rtype].remove(name)
KeyError: '/psm_49a93592'
(...)
==
ERROR: test_shared_memory_basics 
(test.test_multiprocessing_forkserver.WithProcessesTestSharedMemory)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64.lto-pgo/build/Lib/test/_test_multiprocessing.py",
 line 3777, in test_shared_memory_basics
sms = shared_memory.SharedMemory('test01_tsmb', create=True, size=512)
  File 
"/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64.lto-pgo/build/Lib/multiprocessing/shared_memory.py",
 line 103, in __init__
self._fd = _posixshmem.shm_open(
FileExistsError: [Errno 17] File exists: '/test01_tsmb'

--
components: Tests
messages: 402770
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_multiprocessing_forkserver: test_shared_memory_basics() failed with 
FileExistsError: [Errno 17] File exists: '/test01_tsmb'
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



[issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process

2021-09-28 Thread STINNER Victor


STINNER Victor  added the comment:

That's the principle of fork. You should use a different spawn method if you 
don't want to inherit resources inherited from the parent process, like spawn 
or forkserver:
https://docs.python.org/dev/library/multiprocessing.html#contexts-and-start-methods

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



[issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows

2021-09-28 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset e649e0658ff2af87b07d994c05ae048e16e31aae by Terry Jan Reedy in 
branch 'main':
bpo-45296: Fix exit/quit message on Windows (GH-28577)
https://github.com/python/cpython/commit/e649e0658ff2af87b07d994c05ae048e16e31aae


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows

2021-09-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26977
pull_request: https://github.com/python/cpython/pull/28601

___
Python tracker 

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



[issue45296] IDLE: Change Ctrl-Z note in exit/quit repr on Windows

2021-09-28 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45256] Remove the usage of the C stack in Python to Python calls

2021-09-28 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

We are starting to optimize first the easy cases of CALL_FUNCTION and move 
slowly to add more and more calls into it. This approach has the advantage that 
allow us to take it in small increments.

--

___
Python tracker 

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



[issue45256] Remove the usage of the C stack in Python to Python calls

2021-09-28 Thread Christian Tismer


Christian Tismer  added the comment:

FWIW, getting all function to avoid the C stack will most probably take a long 
time, if it happens at all. Especially functions which might call into Python 
multiple times must be re-designed heavily, turned into multiple pieces to be 
in tail position. Been there, long ago... :)

--

___
Python tracker 

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



[issue35606] Add prod() function to the math module

2021-09-28 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +26975
pull_request: https://github.com/python/cpython/pull/28595

___
Python tracker 

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



[issue44841] ZipInfo crashes on filemode

2021-09-28 Thread Gabor Rakosy


Gabor Rakosy  added the comment:

Like Ronald Oussoren wrote "ZipInfo does not have a filemode attribute, that's 
why it is not in ZipInfo.__slots__."


import zipfile

file_zip = zipfile.ZipFile("test-one-dir.zip", mode='r')
for info in file_zip.infolist():
print(info)
---

In the print, it shows the option 'filemode'. And that option is not 
accessible. That's the reason why i made this issue.

--
Added file: https://bugs.python.org/file50309/test-zip.zip

___
Python tracker 

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



[issue45309] asyncio task can not be used to open_connection and read data.

2021-09-28 Thread 穆兰

穆兰  added the comment:

Hope some one could fix it.

--

___
Python tracker 

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



[issue45256] Remove the usage of the C stack in Python to Python calls

2021-09-28 Thread Mark Shannon


Mark Shannon  added the comment:

PR 28488 has no NEWS entry, or What's New entry.

However, adding multiple entries will be confusing, so that's best left until 
all calls to Python functions and method don't use the C stack.

--

___
Python tracker 

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



[issue45309] asyncio task can not be used to open_connection and read data.

2021-09-28 Thread 穆兰

New submission from 穆兰 :

The server code:

import asyncio
import struct
counter = 0
async def on_connection(r: asyncio.StreamReader, w: asyncio.StreamWriter):
msg = struct.pack("HB", 3, 0)
w.write(msg)
await w.drain()
global counter
counter += 1
print(counter, "client")
async def main():
server = await asyncio.start_server(on_connection, '0.0.0.0', 12345)
await server.serve_forever()
if __name__ == "__main__":
asyncio.run(main())

The client code:

import asyncio
loop = asyncio.get_event_loop()
counter = 0
c_counter = 0
async def connection_to():
r, w = await asyncio.open_connection('192.168.3.2', 12345)
global c_counter
c_counter += 1
print(c_counter, "connected")
await r.readexactly(3)
global counter
counter += 1
print(counter, "get_msg")
async def main():
for i in range(7000):
t = loop.create_task(connection_to())
try:
loop.run_until_complete(main())
loop.run_forever()
except Exception as e:
print(e.with_traceback(None))


I open the server on wsl debian and run the client on host windows.
Try start more client at once, Then you will find that counter is not equal to 
c_counter.
It nearly always happend.
Now I can not trust create_task any more.

--
components: asyncio
messages: 402762
nosy: asvetlov, whitestockingirl, yselivanov
priority: normal
severity: normal
status: open
title: asyncio task can not be used to open_connection and read data.
type: crash
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



[issue45307] Removal of _PyImport_FindExtensionObject() in 3.10 limits custom extension module loaders

2021-09-28 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +pablogsal
priority: normal -> release blocker

___
Python tracker 

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



[issue45307] Removal of _PyImport_FindExtensionObject() in 3.10 limits custom extension module loaders

2021-09-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Gregory, could you please build Python 3.10 with PR 28594 applied and test 
whether py2exe and PyOxidizer work well with it? The restored function no 
longer used in the CPython code, so it is not tested now.

--

___
Python tracker 

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



[issue45307] Removal of _PyImport_FindExtensionObject() in 3.10 limits custom extension module loaders

2021-09-28 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process

2021-09-28 Thread eleven xiang


eleven xiang  added the comment:

update test platform

Ubuntu 16.04

--

___
Python tracker 

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



[issue36819] Crash during encoding using UTF-16/32 and custom error handler

2021-09-28 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +26973
pull_request: https://github.com/python/cpython/pull/28593

___
Python tracker 

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



[issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process

2021-09-28 Thread eleven xiang


eleven xiang  added the comment:

you could use below command to build test.so from test1.cpp

g++ test1.cpp -shared -fPIC --std=c++11 -o test.so

--

___
Python tracker 

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



[issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process

2021-09-28 Thread eleven xiang


Change by eleven xiang :


Added file: https://bugs.python.org/file50308/test1.cpp

___
Python tracker 

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



[issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process

2021-09-28 Thread eleven xiang


New submission from eleven xiang :

Hi, 

Here I did an experiment, and detail as below
1. There is library, which has global object and has its class method
2. Use multiprocessing module to fork the child process, parent process call 
the global object's method first, and then child process called the global 
object method again to modify it
3. After that when script exit, parent will free the object, but child process 
will not free it.
4. if we change the start method to 'spawn', the child process will free it

--
components: Library (Lib)
files: test.py
messages: 402758
nosy: eleven.xiang
priority: normal
severity: normal
status: open
title: multiprocessing default fork child process will not free object, which 
is inherited from parent process
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file50307/test.py

___
Python tracker 

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



[issue45301] pycore_condvar.h: remove Windows conditonal variable emulation, use Windows native conditional variable

2021-09-28 Thread Eryk Sun


Eryk Sun  added the comment:

FYI, waiting for a condition variable can cause a thread to enter a wait state 
that's interruptible, in theory, but the mechanism is different since condition 
variables and SRW locks are pointer-sized values in user space, instead of NT 
objects in kernel space. The current implementation is based on the system call 
NtWaitForAlertByThreadId(address, timeout), which enters the 
"WrAlertByThreadId" wait state. The address parameter is that of the SRW lock. 
The kernel sets this as the 'object' for the wait, but the wait is actually 
satisfied by alerting the thread directly via NtAlertThreadByThreadId(tid). 
ISTM, they could have added a function that calls the latter to cancel a wait 
on a given thread. That would have been useful for Ctrl+C since the handler 
executes on a new thread.

--

___
Python tracker 

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