[issue40275] test.support has way too many imports

2020-08-03 Thread hai shi


Change by hai shi :


--
pull_requests: +20870
pull_request: https://github.com/python/cpython/pull/21727

___
Python tracker 

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



[issue32623] Resize dict on del/pop

2020-08-03 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +rhettinger, tim.peters

___
Python tracker 

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



[issue41335] free(): invalid pointer in list_ass_item() in Python 3.7.3

2020-08-03 Thread Ned Deily


Change by Ned Deily :


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



[issue41440] os.cpu_count doesn't work on VxWorks RTOS

2020-08-03 Thread pmp-p


Change by pmp-p :


--
nosy: +pmpp

___
Python tracker 

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



[issue29269] test_socket failing in solaris

2020-08-03 Thread Brian Vandenberg


Brian Vandenberg  added the comment:

I accidentally hit submit too early.

I tried changing the code in posixmodule.c to use lseek(), something like the 
following:

offset = lseek( in, 0, SEEK_CUR );

do {
  ret = sendfile(...);
} while( ... );
lseek( in, offset, SEEK_SET );

... however, in addition to readfile not advancing the file pointer it also 
doesn't seem to cause an EOF condition.  In my first attempt at the above I was 
doing this after the loop:

lseek( in, offset, SEEK_CUR );

... and it just kept advancing the file pointer well beyond the end of the file 
and sendfile() had absolutely no qualms about reading beyond the end of the 
file.

I even tried adding a read() after the 2nd lseek to see if I could force an EOF 
condition but that didn't do it.

--

___
Python tracker 

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



[issue41440] os.cpu_count doesn't work on VxWorks RTOS

2020-08-03 Thread Peixing Xin


Peixing Xin  added the comment:

I don't know who have VxWorks experience in core devs. VxWorks has not been 
officially supported so not listed there. I am from Wind River and  Wind River 
can provide buildbot for VxWorks once it is supported and I also could take the 
maintainer role.

--

___
Python tracker 

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



[issue41460] Translation Error in in Functional Programming HOWTO page

2020-08-03 Thread Ned Deily


Change by Ned Deily :


--
assignee:  -> docs@python
components: +Documentation
nosy: +cocoatomo, docs@python, mdk

___
Python tracker 

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



[issue41469] Problem with serial communication

2020-08-03 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This tracker is for issues related to CPython. Please report issues at the 
relevant repo https://github.com/pyserial/pyserial. Closing it as third party.

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



[issue36982] Add support for extended color functions in ncurses 6.1

2020-08-03 Thread Ned Deily


Ned Deily  added the comment:


New changeset da4e09fff6b483fe858997da5599c25397107ca1 by Hans Petter Jansson 
in branch 'master':
bpo-36982: Add support for extended color functions in ncurses 6.1 (GH-17536)
https://github.com/python/cpython/commit/da4e09fff6b483fe858997da5599c25397107ca1


--

___
Python tracker 

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



[issue32623] Resize dict on del/pop

2020-08-03 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue29269] test_socket failing in solaris

2020-08-03 Thread Brian Vandenberg


Brian Vandenberg  added the comment:

Christian, you did exactly what I needed.  Thank you.

I don't have the means to do a git bisect to find where it broke.  It wasn't a 
problem around 3.3 timeframe and I'm not sure when this sendfile stuff was 
implemented.

The man page for sendfile says "The sendfile() function does not modify the 
current file pointer of in_fd, (...)".  In other words the read pointer for the 
input descriptor won't be advanced.  They expect you to use it like this:

offset = 0;
do {
  ret = sendfile(in, out, , len);
} while( ret < 0 && (errno == EAGAIN || errno == EINTR) );

... though making that change in posixmodule.c would break this test severely 
since the send & receive code is running on the same thread.

In posixmodule.c I don't see anything that attempts to return the number of 
bytes successfully sent.  Since the input file descriptor won't have its read 
pointer advanced, the variable "offset" must be set to the correct offset 
value, otherwise it just keeps reading the first 32k of the file that was 
generated for the test.

--

___
Python tracker 

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



[issue41439] test_uuid.py and test_ssl.py failure on OSes without os.fork (VxWorks RTOS)

2020-08-03 Thread Peixing Xin


Peixing Xin  added the comment:

Terry, VxWorks has not been officially supported by community. Certainly no 
builtbot for VxWorks connected yet. I am porting cpython onto VxWorks RTOS now. 
Several issues you listed are the part of my porting effort. So I think we 
don't need to backport the fix to previous versions.

--

___
Python tracker 

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



[issue41469] Problem with serial communication

2020-08-03 Thread Jose Gabriel


New submission from Jose Gabriel :

I was doing a small serial communication system using pyserial. when I done the 
script on a .py file, it not worked. but when I opened
the python console and writed line by line the same code of the .py file, it 
worked.

the .py file:
import serial
ser = serial.Serial('com5')
ser.write('L'.encode())
ser.close()

it not worked.

on the python console:
python>> import serial
python>> ser = serial.Serial('com5')
python>> ser.write('L'.encode())
python>> ser.close()

It worked.

PySerial 3.4

--
messages: 374788
nosy: JDev
priority: normal
severity: normal
status: open
title: Problem with serial communication
type: resource usage
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



[issue41004] [CVE-2020-14422] Hash collisions in IPv4Interface and IPv6Interface

2020-08-03 Thread Larry Hastings


Change by Larry Hastings :


--
assignee: eric.smith -> 
status: open -> closed

___
Python tracker 

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



[issue41004] [CVE-2020-14422] Hash collisions in IPv4Interface and IPv6Interface

2020-08-03 Thread Larry Hastings


Larry Hastings  added the comment:


New changeset 11d258ceafdf60ab3840f9a5700f2d0ad3e2e2d1 by Tapas Kundu in branch 
'3.5':
[3.5] bpo-41004: Resolve hash collisions for IPv4Interface and IPv6Interface 
(GH-21033) (#21233)
https://github.com/python/cpython/commit/11d258ceafdf60ab3840f9a5700f2d0ad3e2e2d1


--
nosy: +larry

___
Python tracker 

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



[issue41326] Build failure in blurb-it repo: "Failed building wheel for yarl"

2020-08-03 Thread Inada Naoki


Inada Naoki  added the comment:

For the record, deprecation warning is just a waring. Build failure is coming 
from here:

```
  yarl/_quoting.c:1245:23: error: lvalue required as left operand of assignment
   Py_SIZE(list) = len+1;
```

It is not relating PEP 623, and it has been fixed already.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue29778] [CVE-2020-15523] _Py_CheckPython3 uses uninitialized dllpath when embedder sets module path with Py_SetPath

2020-08-03 Thread Larry Hastings


Larry Hastings  added the comment:


New changeset f205f1000a2d7f8b044caf281041b3705f293480 by Steve Dower in branch 
'3.5':
[3.5] bpo-29778: Ensure python3.dll is loaded from correct locations when 
Python is embedded (GH-21297) (#21377)
https://github.com/python/cpython/commit/f205f1000a2d7f8b044caf281041b3705f293480


--

___
Python tracker 

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



[issue41431] Optimize dict_merge for copy

2020-08-03 Thread Inada Naoki


Change by Inada Naoki :


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

___
Python tracker 

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



[issue41431] Optimize dict_merge for copy

2020-08-03 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset db6d9a50cee92c0ded7c5cb87331c5f0b1008698 by Inada Naoki in branch 
'master':
bpo-41431: Optimize dict_merge for copy (GH-21674)
https://github.com/python/cpython/commit/db6d9a50cee92c0ded7c5cb87331c5f0b1008698


--

___
Python tracker 

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



[issue41406] subprocess: Calling Popen.communicate() after Popen.stdout.read() returns an empty string

2020-08-03 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

A workaround should be pass bufsize=0.

There might be performance consequences.  That depends on your read patterns 
and child process.

If this is to be supported and fixed, the selectors used in POpen._communicate 
on the POSIX side presumably don't bother to look at buffered IO objects 
buffer.  https://github.com/python/cpython/blob/master/Lib/subprocess.py#L1959

manually consuming data from the stdout and stderr buffers, if any, before 
entering that loop is probably a fix.

Higher up the chain, should the 
https://docs.python.org/3/library/selectors.html be enhanced to support 
emptying the buffer on buffered IO objects?  That sounds complicated; probably 
even infeasible if in text mode.  In general it is understood that poll/select 
type APIs are meant to be used on unbuffered raw binary file objects.

--

___
Python tracker 

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



[issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed

2020-08-03 Thread miss-islington


miss-islington  added the comment:


New changeset 1d16229f3f5b91f2389c7c5c6425c5524c413651 by Miss Islington (bot) 
in branch '3.9':
bpo-41467: Fix asyncio recv_into() on Windows (GH-21720)
https://github.com/python/cpython/commit/1d16229f3f5b91f2389c7c5c6425c5524c413651


--

___
Python tracker 

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



[issue38156] input fucntion raises SystemError after specific input.

2020-08-03 Thread miss-islington


miss-islington  added the comment:


New changeset 46e448abbf35c051e5306a4695670d7ec7abc4e9 by Miss Islington (bot) 
in branch '3.8':
bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721)
https://github.com/python/cpython/commit/46e448abbf35c051e5306a4695670d7ec7abc4e9


--

___
Python tracker 

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



[issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed

2020-08-03 Thread miss-islington


miss-islington  added the comment:


New changeset b934d832d1e16bf235c536dcde3006faf29757fc by Miss Islington (bot) 
in branch '3.8':
bpo-41467: Fix asyncio recv_into() on Windows (GH-21720)
https://github.com/python/cpython/commit/b934d832d1e16bf235c536dcde3006faf29757fc


--

___
Python tracker 

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



[issue38156] input fucntion raises SystemError after specific input.

2020-08-03 Thread miss-islington


miss-islington  added the comment:


New changeset b6724be8047ac2404aab870d35d8f95bb0b7036a by Miss Islington (bot) 
in branch '3.9':
bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721)
https://github.com/python/cpython/commit/b6724be8047ac2404aab870d35d8f95bb0b7036a


--

___
Python tracker 

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



[issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed

2020-08-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20869
pull_request: https://github.com/python/cpython/pull/21726

___
Python tracker 

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



[issue38156] input fucntion raises SystemError after specific input.

2020-08-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20868
pull_request: https://github.com/python/cpython/pull/21725

___
Python tracker 

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



[issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed

2020-08-03 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +20867
pull_request: https://github.com/python/cpython/pull/21724

___
Python tracker 

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



[issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 602a971a2af3a685d625c912c400cadd452718b1 by Victor Stinner in 
branch 'master':
bpo-41467: Fix asyncio recv_into() on Windows (GH-21720)
https://github.com/python/cpython/commit/602a971a2af3a685d625c912c400cadd452718b1


--

___
Python tracker 

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



[issue38156] input fucntion raises SystemError after specific input.

2020-08-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20866
pull_request: https://github.com/python/cpython/pull/21723

___
Python tracker 

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



[issue38156] input fucntion raises SystemError after specific input.

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bde48fd8110cc5f128d5db44810d17811e328a24 by Victor Stinner in 
branch 'master':
bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721)
https://github.com/python/cpython/commit/bde48fd8110cc5f128d5db44810d17811e328a24


--

___
Python tracker 

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



[issue41330] Inefficient error-handle for CJK encodings

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:

(off topic)

> If nothing happens, I also would like to write a zstd module for stdlib 
> before the end of the year, but I dare not promise this.

I suggest you to publish it on PyPI. Once it will be mature, you can propose it 
on python-ideas. Last time someone proposed a new compression algorithm to the 
stdlib, it was rejected if I recall correctly. I forgot which one was proposed. 
Maybe search for "compresslib" on python-ideas.

--

___
Python tracker 

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



[issue41466] Windows installer: "Add to PATH" should be checked by default

2020-08-03 Thread Eryk Sun


Change by Eryk Sun :


--
components: +Installation
status: open -> 
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



[issue41330] Inefficient error-handle for CJK encodings

2020-08-03 Thread Ma Lin


Ma Lin  added the comment:

I'm working on issue41265.
If nothing happens, I also would like to write a zstd module for stdlib before 
the end of the year, but I dare not promise this.

If anyone wants to work on this issue, very grateful.

--

___
Python tracker 

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



[issue41335] free(): invalid pointer in list_ass_item() in Python 3.7.3

2020-08-03 Thread Howard A. Landman


Howard A. Landman  added the comment:

OK, this has been filed against the spidev library:
https://github.com/doceme/py-spidev/issues/107

Do you want it closed, or left open until that gets resolved?

--
resolution:  -> third party

___
Python tracker 

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



[issue41466] Windows installer: "Add to PATH" should be checked by default

2020-08-03 Thread Eryk Sun


Eryk Sun  added the comment:

Managing multiple Python installations in PATH is problematic, so by default 
the installer doesn't modify PATH. Instead, the "py.exe" launcher [1] is made 
available, which can run any registered installation of Python. 

Using a launcher fits the Windows environment better, which installs 
applications into separate subdirectories of "shell:ProgramFiles" or 
"shell:UserProgramFiles". This is similar to monolithic package installation in 
Unix into "/opt" or "~/.local/opt" (or "~/opt"). 

A recent update to the installer extends the message after a successful 
installation to suggest "[a]t your terminal, type 'py' to launch Python". It 
also includes a link to the "Using Python on Windows" documentation. Hopefully 
this will encourage more users to learn about and use the py launcher.

[1] https://docs.python.org/3/using/windows.html#launcher

--
nosy: +eryksun

___
Python tracker 

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



[issue40989] [C API] Remove _Py_NewReference() and _Py_ForgetReference() from the public C API

2020-08-03 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +20865
pull_request: https://github.com/python/cpython/pull/21722

___
Python tracker 

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



[issue38156] input fucntion raises SystemError after specific input.

2020-08-03 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner
nosy_count: 3.0 -> 4.0
pull_requests: +20864
pull_request: https://github.com/python/cpython/pull/21721

___
Python tracker 

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



[issue41326] Build failure in blurb-it repo: "Failed building wheel for yarl"

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:

yarl is a third party project, you should report the issue to 
https://github.com/aio-libs/yarl/

> blurb-it imports aiohttp which imports yarl. It might be a duplicate of 
> https://github.com/aio-libs/yarl/issues/459

Andrew Svetlov wrote "yarl 1.5.0 will be published with generated C files made 
by Cython 0.29.21"

At https://pypi.org/project/yarl/ I can see version 1.5.1.

I guess that the issue is now fixed.

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



[issue41326] Build failure in blurb-it repo: "Failed building wheel for yarl"

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:

> I'm not familiar with that part of codebase. If anyone has any insight, it 
> would be appreciated. Thanks.

See PEP 623 if you're curious ;-)

--

___
Python tracker 

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



[issue35247] test.test_socket.RDSTest.testPeek hangs indefinitely

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:

I cannot debug this issue on Fedora 32, since RDS sockets are not supported:

$ ./python -m test test_socket -m test.test_socket.RDSTest.testPeek -v
(...)
testPeek (test.test_socket.RDSTest) ... skipped 'RDS sockets required for this 
test.'
(...)

--

___
Python tracker 

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



[issue41370] PEP 585 and ForwardRef

2020-08-03 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue38119] resource tracker destroys shared memory segments when other processes should still have valid access

2020-08-03 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue41406] subprocess: Calling Popen.communicate() after Popen.stdout.read() returns an empty string

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:

Calling proc.communicate() after proc.stdout.read() doesn't seem to be 
supported. What is your use case? Why not just calling communicate()? Why not 
only using stdout directly?

--
components:  -2to3 (2.x to 3.x conversion tool), IO
nosy: +gregory.p.smith
title: BufferedReader causes Popen.communicate losing the remaining output. -> 
subprocess: Calling Popen.communicate() after Popen.stdout.read() returns an 
empty string
versions:  -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



[issue41330] Inefficient error-handle for CJK encodings

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:

Since CJK codecs have been implemented, unicodeobject.c got multiple 
optimizations:

* _PyUnicodeWriter for decoder: API designed with efficiency and PEP 393 
(compact string) in mind
* _PyBytesWriter for encoders: in short, API to overallocate a buffer
* _Py_error_handler enum and "_Py_error_handler _Py_GetErrorHandler(const char 
*errors)" function to pass an error handler as an integer rather than a string

But rewriting CJK codecs with these is a lot of effort, I'm not sure that it's 
worth it.

--

___
Python tracker 

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



[issue41401] Using non-ascii that require UTF-8 breaks AIX testing

2020-08-03 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue29269] test_socket failing in solaris

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:

> I am not sure how to get this bug fixed (...)

Someone has to write a fix. You may contact Solaris vendor or a company using 
Solaris who wants to pay a developer to write a fix.

--

___
Python tracker 

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



[issue41468] Unrecoverable server exiting

2020-08-03 Thread Albert Francis


New submission from Albert Francis :

How to solve unrecoverable server exiting in IDLE

--
assignee: terry.reedy
components: IDLE
messages: 374766
nosy: albertpython, terry.reedy
priority: normal
severity: normal
status: open
title: Unrecoverable server exiting
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue41439] test_uuid.py and test_ssl.py failure on OSes without os.fork (VxWorks RTOS)

2020-08-03 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_uuid.py and test_ssl.py failure on OSes without os.fork -> 
test_uuid.py and test_ssl.py failure on OSes without os.fork (VxWorks RTOS)

___
Python tracker 

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



[issue41303] perf_counter result does not count system sleep time in Mac OS

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:

perf_counter documentation says "It does include time elapsed during sleep and 
is system-wide." where "sleep" here means time.sleep():
https://docs.python.org/dev/library/time.html#time.perf_counter

Python clock functions don't provide any warranty regarding to system suspend 
or system hibernation. See PEP 418 for more details: "The behaviour of clocks 
after a system suspend is not defined in the documentation of new functions. 
The behaviour depends on the operating system: see the Monotonic Clocks section 
below."
https://www.python.org/dev/peps/pep-0418/#monotonic-clocks

I don't think that using mach_continuous_time() is needed, but the 
documentation should be clarified. The doc should explain that the behavior 
during system suspend is not defined (platform specific).

--

___
Python tracker 

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



[issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:

> This bug may be the root cause of bpo-38912 bug.

Yeah, very likely. This bug makes asyncio inconsistent. A transport is "not 
closed" and "closed" at the same time...

C:\vstinner\python\master\lib\asyncio\proactor_events.py:121: ResourceWarning: 
unclosed transport <_ProactorReadPipeTransport>
  _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback

Warning -- Unraisable exception
Exception ignored in: 
Traceback (most recent call last):
  File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 122, in 
__del__
self.close()
  File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 114, in 
close
self._loop.call_soon(self._call_connection_lost, None)
  File "C:\vstinner\python\master\lib\asyncio\base_events.py", line 746, in 
call_soon
self._check_closed()
  File "C:\vstinner\python\master\lib\asyncio\base_events.py", line 510, in 
_check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

--

___
Python tracker 

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



[issue38912] test_asyncio altered the execution environment

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:

File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 293, in 
_loop_reading
data = self._data[:length]
TypeError: slice indices must be integers or None or have an __index__ method

I created bpo-41467: asyncio: recv_into() must not return b'' if the 
socket/pipe is closed.

--

___
Python tracker 

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



[issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:

The function was added in 2017 in bpo-31819, PR 4051:

commit 525f40d231aba2c004619fc7a5207171ed65b0cb
Author: Antoine Pitrou 
Date:   Thu Oct 19 21:46:40 2017 +0200

bpo-31819: Add AbstractEventLoop.sock_recv_into() (#4051)

--

___
Python tracker 

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



[issue31819] Add sock_recv_into to AbstractEventLoop

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:

Follow-up issue, bpo-41467: asyncio: recv_into() must not return b'' if the 
socket/pipe is closed.

--
nosy:  -giampaolo.rodola

___
Python tracker 

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



[issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed

2020-08-03 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed

2020-08-03 Thread STINNER Victor


New submission from STINNER Victor :

The proactor event loop of asyncio returns b'' on recv_into() if the 
socket/pipe is closed:

def recv_into(self, conn, buf, flags=0):
...
try:
...
except BrokenPipeError:
return self._result(b'')
...

But a socket recv_into() must always return a number: the number of written 
bytes. Example with socket.socket.recv_into() method:
https://docs.python.org/3/library/socket.html#socket.socket.recv_into

IMHO zero must be returned here. This bug may be the root cause of bpo-38912 
bug.

Attached PR fix the issue.

--
components: asyncio
messages: 374760
nosy: asvetlov, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: asyncio: recv_into() must not return b'' if the socket/pipe is closed
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



[issue38912] test_asyncio altered the execution environment

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:

When I commented code to hide logs in the tests, I saw another bug.

Local patch:

diff --git a/Lib/test/test_asyncio/test_subprocess.py 
b/Lib/test/test_asyncio/test_subprocess.py   
index 177a02cdcc..3095b1d987 100644
--- a/Lib/test/test_asyncio/test_subprocess.py
+++ b/Lib/test/test_asyncio/test_subprocess.py
@@ -456,7 +456,8 @@ class SubprocessMixin:

 # ignore the log:
 # "Exception during subprocess creation, kill the subprocess"
-with test_utils.disable_logger():
+#with test_utils.disable_logger():
+if 1:
 self.loop.run_until_complete(cancel_make_transport())
 test_utils.run_briefly(self.loop)


Output:

0:00:05 [ 14] test_asyncio
test_cancel_post_init 
(test.test_asyncio.test_subprocess.SubprocessProactorTests) ...

Exception in call
back _ProactorReadPipeTransport._loop_reading()
handle: )>
Traceback (most recent call last):
  File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 293, in 
_loop_reading
data = self._data[:length]
TypeError: slice indices must be integers or None or have an __index__ method

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\vstinner\python\master\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
  File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 325, in 
_loop_reading
if length > -1:
TypeError: '>' not supported between instances of 'bytes' and 'int'


Exception in callback _ProactorReadPipeTransport._loop_reading()
handle: )>
Traceback (most recent call last):
  File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 293, in 
_loop_reading
data = self._data[:length]
TypeError: slice indices must be integers or None or have an __index__ method

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\vstinner\python\master\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
  File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 325, in 
_loop_reading
if length > -1:
TypeError: '>' not supported between instances of 'bytes' and 'int'
ok

--

___
Python tracker 

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



[issue41303] perf_counter result does not count system sleep time in Mac OS

2020-08-03 Thread Rishav Kundu


Change by Rishav Kundu :


--
keywords: +patch
nosy: +xrisk
nosy_count: 6.0 -> 7.0
pull_requests: +20862
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21719

___
Python tracker 

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



[issue38912] test_asyncio altered the execution environment

2020-08-03 Thread STINNER Victor

STINNER Victor  added the comment:

More info with my latest change.

AMD64 Windows10 3.x:
https://buildbot.python.org/all/#/builders/129/builds/1500

0:10:26 load avg: 3.17 [354/423/2] test_asyncio failed (env changed) (1 min 23 
sec) -- running: test_capi (1 min 3 sec)

Warning -- Unraisable exception
Exception ignored in: 
Traceback (most recent call last):
  File "D:\buildarea\3.x.bolen-windows10\build\lib\asyncio\proactor_events.py", 
line 115, in __del__
_warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
  File "D:\buildarea\3.x.bolen-windows10\build\lib\asyncio\proactor_events.py", 
line 79, in __repr__
info.append(f'fd={self._sock.fileno()}')
  File "D:\buildarea\3.x.bolen-windows10\build\lib\asyncio\windows_utils.py", 
line 102, in fileno
raise ValueError("I/O operation on closed pipe")
ValueError: I/O operation on closed pipe


It seems like the issue comes from SubprocessProactorTests. Using python -m 
test.bisect_cmd, I isolated one test which causes the issue:

+ C:\vstinner\python\master\PCbuild\amd64\python_d.exe -m test --matchfile 
C:\Users\vstinner\AppData\Local\Temp\tmpoe9_zui_ --fail-env-changed 
test_asyncio -v
== CPython 3.10.0a0 (heads/master:701b63894f, Aug 3 2020, 23:38:07) [MSC v.1916 
64 bit (AMD64)]
== Windows-10-10.0.18362-SP0 little-endian
== cwd: C:\vstinner\python\master\build\test_python_7732æ
== CPU count: 2
== encodings: locale=cp1252, FS=utf-8
0:00:00 Run tests sequentially
0:00:00 [1/1] test_asyncio
test_cancel_post_init 
(test.test_asyncio.test_subprocess.SubprocessProactorTests) ... ok

--

Ran 1 test in 0.015s

OK
C:\vstinner\python\master\lib\asyncio\windows_utils.py:112: ResourceWarning: 
unclosed 
  _warn(f"unclosed {self!r}", ResourceWarning, source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
C:\vstinner\python\master\lib\asyncio\windows_utils.py:112: ResourceWarning: 
unclosed 
  _warn(f"unclosed {self!r}", ResourceWarning, source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback

Warning -- Unraisable exception
Exception ignored in: 
Traceback (most recent call last):
  File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 115, in 
__del__
_warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
  File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 79, in 
__repr__
info.append(f'fd={self._sock.fileno()}')
  File "C:\vstinner\python\master\lib\asyncio\windows_utils.py", line 102, in 
fileno
raise ValueError("I/O operation on closed pipe")
ValueError: I/O operation on closed pipe

Warning -- Unraisable exception
Exception ignored in: 
Traceback (most recent call last):
  File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 115, in 
__del__
_warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
  File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 79, in 
__repr__
info.append(f'fd={self._sock.fileno()}')
  File "C:\vstinner\python\master\lib\asyncio\windows_utils.py", line 102, in 
fileno
raise ValueError("I/O operation on closed pipe")
ValueError: I/O operation on closed pipe
test_asyncio failed (env changed)

== Tests result: ENV CHANGED ==

--

___
Python tracker 

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



[issue41398] cgi module, parse_multipart fails

2020-08-03 Thread Guido van Rossum


Guido van Rossum  added the comment:

Could you submit a PR then? I don't think I've looked at that module in 20 
years.

--

___
Python tracker 

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



[issue41335] free(): invalid pointer in list_ass_item() in Python 3.7.3

2020-08-03 Thread Howard A. Landman


Howard A. Landman  added the comment:

It appears to be in the spidev library xfer method, when used for reading. 
Calling that 107.4M times (using the same code as inside my read_regs24() 
method) causes the free() error.

Breakpoint 1, malloc_printerr (str=0x76e028f8 "free(): invalid pointer")
at malloc.c:5341
5341malloc.c: No such file or directory.
(gdb) bt
#0  malloc_printerr (str=0x76e028f8 "free(): invalid pointer") at malloc.c:5341
#1  0x76d44d50 in _int_free (av=0x76e1f7d4 , 
p=0x43417c , have_lock=) at 
malloc.c:4165
#2  0x001b4f40 in list_dealloc (op=0x766d0f58) at ../Objects/listobject.c:324
#3  0x7669b660 in ?? ()
   from /usr/lib/python3/dist-packages/spidev.cpython-37m-arm-linux-gnueabihf.so
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Should I be worried about the "corrupt stack" message?

--

___
Python tracker 

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



[issue38912] test_asyncio altered the execution environment

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 701b63894fdb75b12865b9be6261ce4913da76f5 by Victor Stinner in 
branch 'master':
bpo-38912: regrtest logs unraisable exception into sys.__stderr__ (GH-21718)
https://github.com/python/cpython/commit/701b63894fdb75b12865b9be6261ce4913da76f5


--

___
Python tracker 

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



[issue29269] test_socket failing in solaris

2020-08-03 Thread Christian Heimes


Christian Heimes  added the comment:

What do you expect us to do? No Python core dev has access to a Solaris 
machine. We cannot debug the issue and have to rely on external contributions. 
We have not declared Solaris as unsupported yet because people are still 
contributing fixes.

If you are looking for wild speculations: I guess Solari' sendfile() is either 
broken or does not behave like on other platforms.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue41398] cgi module, parse_multipart fails

2020-08-03 Thread Magnus Johnsson


Magnus Johnsson  added the comment:

No, of course not.
The request is completely valid. Python's cgi library parses it wrong.

The 'resolution' that needs to be done is to fix it in python's source.
That, and the libraries that depend on it, like twisted, probably needs to move 
away from using python's cgi library at all, given the age of this bug.

As it stands, we have had to patch 16 separate calls, and will be moving away 
from the twisted-based server over it anyway, since it seems sketchy.

Going to have a peek at the source, but I am a bit hesitant to touch things 
that have that large a userbase.

--

___
Python tracker 

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



[issue41466] Windows installer: "Add to PATH" should be checked by default

2020-08-03 Thread cotree


New submission from cotree :

In the Windows installer, "Add Python 3.x to PATH" is unchecked by default:

https://docs.python.org/3/_images/win_installer.png

If it's unchecked, then "python", "pip", and any other commands from installed 
packages (like django-admin, etc) will not work, which is quite important 
functionality. Searching on Google shows that "'python' is not recognized..." 
is a commonly asked about error. Many users leave that box unchecked because 
they don't know what PATH is and they tend to stick with the defaults 
recommended by the installer.

On the other hand, I think not wanting Python on your PATH is more of an 
advanced use case. The people who opt for this are more likely to know what 
PATH is in the first place, so it's reasonable to ask them to decide to uncheck 
it.

--
components: Windows
messages: 374752
nosy: cotree, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows installer: "Add to PATH" should be checked by default
type: enhancement

___
Python tracker 

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



[issue41465] io.TextIOWrapper.errors not writable

2020-08-03 Thread Walter Dörwald

New submission from Walter Dörwald :

PEP 293 states the following:

"""
For stream readers/writers the errors attribute must be changeable to be able 
to switch between different error handling methods during the lifetime of the 
stream reader/writer. This is currently the case for codecs.StreamReader and 
codecs.StreamWriter and all their subclasses. All core codecs and probably most 
of the third party codecs (e.g. JapaneseCodecs) derive their stream 
readers/writers from these classes so this already works, but the attribute 
errors should be documented as a requirement.
"""

However for io.TextIOWrapper, the errors attribute can not be changed:

Python 3.8.5 (default, Jul 21 2020, 10:48:26)
[Clang 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import io
>>> s = io.TextIOWrapper(io.BytesIO())
>>> s.errors = 'replace'
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: attribute 'errors' of '_io.TextIOWrapper' objects is not 
writable

So the errors attribute of io.TextIOWrapper should be made writable.

--
components: IO
messages: 374751
nosy: doerwalter
priority: normal
severity: normal
status: open
title: io.TextIOWrapper.errors not writable
type: behavior

___
Python tracker 

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



[issue41459] pickle.load raises SystemError on malformed input

2020-08-03 Thread Guillaume


Guillaume  added the comment:

Hi Eric, 

I'm not aware of a practical problem caused by this. 

This was discovered via fuzzing. I reported it because the unexpected error 
suggest an internal issue within the pickle library. 

Just before reporting this, I browsed the bug tracker and noticed a similar 
comment suggesting this kind of pickle issue is of little consequences given 
pickle is not designed for untrusted input. So I've shifted my focus away from 
fuzzing pickle.

--

___
Python tracker 

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



[issue41449] An article on Python 3 stdout and stderr output buffering

2020-08-03 Thread Guido van Rossum


Guido van Rossum  added the comment:

If you don't even know whether it's Python, Docker or Kubernetes you really 
need to ask somewhere else.  Plenty of user groups around.

Python detects tty using the standard UNIX isatty() function.

To a tty we always get line buffering.

To a file we use a larger buffer.

For more details see the source at
https://github.com/python/cpython/blob/4660597b51b3d14ce6269d0ed865ab7e22c6ae1f/Python/pylifecycle.c#L1942

--

___
Python tracker 

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



[issue41458] Avoid overflow/underflow in math.prod()

2020-08-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I think what Raymond proposes makes sense and it will certainly add value, 
especially given the mentioned expectations on what an implementation on the 
stdlib should have. The only think I would like to know is how much 
code/measured performance impact this will have. I expect this not to be a 
problem but I think is an important factor to help us decide.

--

___
Python tracker 

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



[issue38628] Issue with ctypes in AIX

2020-08-03 Thread David Edelsohn


David Edelsohn  added the comment:

The example with memchr() never will be correct because it is invalid to call a 
function with an argument list that doesn't match the function signature.

Your comment mentions that the AIX structure is size 16, but it looks like 
Python calculates the AIX structure size as 24 bytes.  Have you tried 
increasing the value of MAX_STRUCT_SIZE in stgdict.c to 32 or 64, corresponding 
to the argument registers available in 32 bit or 64 bit mode?

--

___
Python tracker 

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



[issue41335] free(): invalid pointer in list_ass_item() in Python 3.7.3

2020-08-03 Thread Howard A. Landman


Howard A. Landman  added the comment:

Getting closer to isolating this. A small program that does nothing but call 
read_regs24() over and over dies with the same error after about 107.4M 
iterations. So it seems to be definitely in that method. But that only takes a 
few hours, not half a day. Going to try to separate the SPI operation from the 
remaining Python code next.

--

___
Python tracker 

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



[issue41208] An exploitable segmentation fault in marshal module

2020-08-03 Thread STINNER Victor


Change by STINNER Victor :


--
resolution: not a bug -> duplicate
superseder:  -> Pickle crashes unpickling invalid NEWOBJ_EX opcode

___
Python tracker 

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



[issue41458] Avoid overflow/underflow in math.prod()

2020-08-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The existing math.prod() already has a separate code path for floats.  The 
proposal is to add an overflow/underflow check to that existing path so that we 
don't get nonsense like 0.0, 1e+175, or Inf depending on the data ordering.  
That doesn't warrant a separate function.

FWIW fsum() is a separate function for several reasons, none of which apply to 
the current proposal:  1) we didn't already have a math.sum().  2) All inputs 
types get converted to float.  3) Even in common cases, it is measurably slower 
that sum().  4) It has a different signature than sum().

--

___
Python tracker 

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



[issue41464] Increase Code Coverage for operator.py

2020-08-03 Thread Irit Katriel


Irit Katriel  added the comment:

duplicates bpo-39664

--
resolution:  -> duplicate
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



[issue38912] test_asyncio altered the execution environment

2020-08-03 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38912] test_asyncio altered the execution environment

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:

Recent exmaple on AMD64 Windows10 3.x:
https://buildbot.python.org/all/#/builders/129/builds/1498

0:14:19 load avg: 0.10 [418/423/1] test_asyncio failed (env changed) (1 min 10 
sec) -- running: test_mmap (4 min 47 sec), test_io (3 min 41 sec)
Warning -- Unraisable exception
Warning -- Unraisable exception

--
nosy: +vstinner

___
Python tracker 

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



[issue41464] Increase Code Coverage for operator.py

2020-08-03 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue41464] Increase Code Coverage for operator.py

2020-08-03 Thread Irit Katriel


New submission from Irit Katriel :

Lib\operator.py currently missing coverage for not_, index and error cases of 
length_hint and iconcat.

--
components: Tests
messages: 374742
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: Increase Code Coverage for operator.py
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



[issue41306] test_tk test_widgets.ScaleTest fails with Tk 8.6.10

2020-08-03 Thread E. Paine


E. Paine  added the comment:

For reference, I have opened 
https://core.tcl-lang.org/tk/tktview?name=81c3ef93148d17ff280d9a0b4c4edfce453b972f
 to report this to the Tk team and ask if this change in behaviour is intended.

--

___
Python tracker 

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



[issue40275] test.support has way too many imports

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4660597b51b3d14ce6269d0ed865ab7e22c6ae1f by Hai Shi in branch 
'master':
bpo-40275: Use new test.support helper submodules in tests (GH-21448)
https://github.com/python/cpython/commit/4660597b51b3d14ce6269d0ed865ab7e22c6ae1f


--

___
Python tracker 

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



[issue40275] test.support has way too many imports

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bb0424b122e3d222a558bd4177ce37befd3e0347 by Hai Shi in branch 
'master':
bpo-40275: Use new test.support helper submodules in tests (GH-21451)
https://github.com/python/cpython/commit/bb0424b122e3d222a558bd4177ce37befd3e0347


--

___
Python tracker 

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



[issue40275] test.support has way too many imports

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a7f5d93bb6906d0f999248b47295d3a59b130f4d by Hai Shi in branch 
'master':
bpo-40275: Use new test.support helper submodules in tests (GH-21449)
https://github.com/python/cpython/commit/a7f5d93bb6906d0f999248b47295d3a59b130f4d


--

___
Python tracker 

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



[issue41458] Avoid overflow/underflow in math.prod()

2020-08-03 Thread Vedran Čačić

Vedran Čačić  added the comment:

Yes, fprod would be nice [though if you just want to avoid over/underflows, 
much easier solution is to first determine the sign, then sum the logarithms of 
absolute values, and exponentiate that]. But I agree with Tim that it should be 
a separate function. For the same reason that sum is not fsum. (The reason prod 
is in math is bureaucratic, not ontologic.)

--
nosy: +veky

___
Python tracker 

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



[issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration

2020-08-03 Thread STINNER Victor


STINNER Victor  added the comment:

https://github.com/sphinx-doc/sphinx/pull/7905 has been merged and will be part 
of the next Sphinx 3.2 release.

--

___
Python tracker 

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



[issue41306] test_tk test_widgets.ScaleTest fails with Tk 8.6.10

2020-08-03 Thread E. Paine


Change by E. Paine :


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

___
Python tracker 

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



[issue41463] Avoid duplicating jump information from opcode.py in compile.c

2020-08-03 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue41463] Avoid duplicating jump information from opcode.py in compile.c

2020-08-03 Thread Mark Shannon


New submission from Mark Shannon :

opcode.py declares which jumps are relative and which are absolute.
We duplicate that information in compile.c
We should generate lookup tables in opcodes.h and to repeating that information 
in compile.c

--
messages: 374735
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Avoid duplicating jump information from opcode.py in compile.c
type: enhancement

___
Python tracker 

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



[issue41458] Avoid overflow/underflow in math.prod()

2020-08-03 Thread Mark Dickinson


Mark Dickinson  added the comment:

This message from Tim, starting "I'd like to divorce `prod()` from 
floating-point complications", seems relevant here: 
https://bugs.python.org/issue35606#msg333090

--

___
Python tracker 

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



[issue41306] test_tk test_widgets.ScaleTest fails with Tk 8.6.10

2020-08-03 Thread E. Paine


E. Paine  added the comment:

+1 this issue. I have encountered this problem lots when testing patches and 
almost always just end up deleting the test_from method to get test_tk to pass. 
I am not sure of a solution, though, as we *need* to keep test compatibility 
with Tk 8.6.8 while (preferably) being able to recognise when the value is 
wrong for the given version. I hope to take a more in-depth look at the problem 
and possible solutions (I want to avoid, if possible, either checking the Tk 
version or allowing both 14.9 & 15.0 values to pass the test).

--
components: +Tkinter
nosy: +epaine

___
Python tracker 

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



[issue39017] [CVE-2019-20907] Infinite loop in the tarfile module

2020-08-03 Thread STINNER Victor


Change by STINNER Victor :


--
title: Infinite loop in the tarfile module -> [CVE-2019-20907] Infinite loop in 
the tarfile module

___
Python tracker 

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



[issue41462] os.set_blocking() raises OSError on VxWorks RTOS

2020-08-03 Thread Peixing Xin


Change by Peixing Xin :


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

___
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-08-03 Thread Allan Chandler


Allan Chandler  added the comment:

If you look through the source for PyExc, you'll find items for (over and above 
OsError) ValueError, NotImplementedError, TypeError, OverflowError, 
AttributeError, MemoryError, UnicodeEncodeError, and RuntimeWarning. I don't 
think ANY of those are documented so are we going to fix them all? Or should we 
just list them as possibilities in the doco (or, even more vaguely, state that 
exceptions other than the documented SSL ones are also possible)?

--
nosy: +paxdiablo

___
Python tracker 

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



[issue41462] os.set_blocking() raises OSError on VxWorks RTOS

2020-08-03 Thread Peixing Xin


New submission from Peixing Xin :

os.set_blocking() always raise OSError exception on VxWorks RTOS. See below for 
details.

[vxWorks *]# python3 -m unittest -v test.test_os.BlockingTests.test_blocking
Launching process 'python3' ...
Process 'python3' (process Id = 0x405808010) launched.
test_blocking (test.test_os.BlockingTests) ... ERROR

==
ERROR: test_blocking (test.test_os.BlockingTests)
--
Traceback (most recent call last):
  File "/usr/lib/python3.8/test/test_os.py", line 3640, in test_blocking
os.set_blocking(fd, False)
OSError: [Errno 35] not supported

--
components: Library (Lib)
messages: 374732
nosy: pxinwr
priority: normal
severity: normal
status: open
title: os.set_blocking() raises OSError on VxWorks RTOS
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue38628] Issue with ctypes in AIX

2020-08-03 Thread Tony Reix


Tony Reix  added the comment:

After more investigations, we (Damien and I) think that there are several 
issues in Python 3.8.5 :

1) Documentation.
  a) AFAIK, the only place in the Python ctypes documentation where it talks 
about how arrays in a structure are managed appears at: 
https://docs.python.org/3/library/ctypes.html#arrays
  b) the size of the structure in the example given here is much greater than 
in our case.
  c) The documentation does NOT talk that a structure <= 16 bytes and a 
structure greater than 16 bytes are managed differently. That's a bug in the 
documentation vs the code.

2) Tests
  Looking at tests, there are NO test about our case.

3) There is a bug in Python
  About the issue here, we see with gdb that Python provides libffi with a 
description saying that our case is passed as pointers. However, Python does 
NOT provides libffi with pointers for the array c_n, but with values.

4) libffi obeys Python directives given in description, thinking that it deals 
with 2 pointers, and thus it pushes only 2 values in registers R3 and R4.

=
Bug in Python:
-
1) gdb
(gdb) b ffi_call

Breakpoint 1 at 0x900016fab80: file ../src/powerpc/ffi_darwin.c, line 919.

(gdb) run

Starting program: /home2/freeware/bin/python3 /tmp/Pb_damien2.py

Thread 2 hit Breakpoint 1, ffi_call (cif=0xfffd108,

fn=@0x9001000a0082640: 0x91b0d60 ,

rvalue=0xfffd1d0, avalue=0xfffd1c0)

(gdb) p *(ffi_cif *)$r3

$9 = {abi = FFI_AIX, nargs = 2, arg_types = 0xfffd1b0, rtype = 
0xa435cb8, bytes = 144, flags = 8}

(gdb) x/2xg 0xfffd1b0

0xfffd1b0:  0x0a43ca48  0x08001000a0002a10

(gdb) p *(ffi_type *)0x0a43ca48

$11 = {size = 16, alignment = 8, type = 13, elements = 0xa12eed0}   <= 
13==FFI_TYPE_STRUCT size == 16 on AIX!!! == 24 on Linux

(gdb) p *(ffi_type *)0x08001000a0002a10

$12 = {size = 8, alignment = 8, type = 14, elements = 0x0} <= FFI_TYPE_POINTER


(gdb) x/3xg *(long *)$r6

0xa436050:  0x0a152200  0x0064

0xa436060:  0x0007  <= 7 is present in avalue[2]

(gdb) x/s 0x0a152200

0xa152200:  "abcdef"

-
2) prints in libffi: AIX : aix_adjust_aggregate_sizes()

TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size: 
8 s->type:14 : FFI_TYPE_POINTER
TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() 
s->size:24 s->type:13 : FFI_TYPE_STRUCT
TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() 
FFI_TYPE_STRUCT Before s->size:24
TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size: 
8 s->type:14 : FFI_TYPE_POINTER
TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() p->size: 
8 s->size: 8
TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size: 
8 s->type:14 : FFI_TYPE_POINTER
TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() p->size: 
8 s->size:16
TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() After 
ALIGN s->size:16
TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size: 
8 s->type:14 : FFI_TYPE_POINTER
TONY: libffi: src/powerpc/ffi_darwin.c: ffi_call: FFI_AIX
TONY: libffi: cif->abi:  1  -(long)cif->bytes : -144  cif->flags :  8  
ecif.rvalue : fffd200  fn: 9001000a0227760  FFI_FN(ffi_prep_args) : 
9001000a050a108
s   element  : char pointer: a153d40 abcdef
c_n element 0: a Long:   100  0X64 = 100  instead of a pointer
c_n element 1: a Long:   0  libffi obeys description given by Python 
and pushes to R4 only what it thinks is a pointer (100 instead), and nothing in 
R5



Summary:
- Python documentation is uncomplete vs the code
- Python code gives libffi a description about pointers
  but Python code provides libffi with values.

--

___
Python tracker 

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



[issue41075] IDLE: Better support history navigation

2020-08-03 Thread E. Paine


E. Paine  added the comment:

> but not with binding to modifier-up/down.

I cannot reproduce. I have tested on both Windows and Linux and found I could 
successfully change to (and use) the modifier-up/down bindings both through the 
Keys page of the configdialog and by editing the keys def. There was no 
traceback on either platform. @wyz23x2, can you reproduce this problem?

My personal preference for the new bindings, when tested, was alt-up/down as it 
is most similar to the existing bindings. Also, control-up/down is used in 
other apps for moving the cursor multiple lines at a time and shift-up/down (at 
least in my mind) seems like a weird/random choice. Terry, I don't know what 
you have in mind, but I think these bindings should be in addition to the 
existing ones rather than instead of (I also tested this and found it to work 
correctly).

--

___
Python tracker 

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



[issue38628] Issue with ctypes in AIX

2020-08-03 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge

___
Python tracker 

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



[issue41435] Allow to retrieve ongoing exception handled by every threads

2020-08-03 Thread Julien Danjou


Julien Danjou  added the comment:

Adding to the thread object might be a good idea, but it does not work if you 
ever start threads with the low-level `_thread` API.
It's also a different design from the existing `sys._current_frames`.

Adding it on top of a frame is interesting though. I think internally it's more 
linked to the execution stack in a thread than to a frame, though.

--

___
Python tracker 

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



[issue41435] Allow to retrieve ongoing exception handled by every threads

2020-08-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Would not be more useful to add a method to the Thread or frame object to 
obtain the topmost handled exception? Then you could iterate all threads or 
frames and obtain exceptions together with other useful information.

Note also that it omits exceptions in generators and coroutines.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38628] Issue with ctypes in AIX

2020-08-03 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Thanks for the code reference.

I'm not a ctypes expert, but do maintain another project using libffi. The 
comment in stgdict.c is correct, and that code is used for all platforms.

However, code to embed arrays into a struct (as described int the comment) is 
only used for structs with a size smaller than 16 bytes (MAX_STRUCT_SIZE), 
which AFAIK is not correct.  My other project does something similar, but for 
all struct sizes.

That said, I haven't studied the ctypes code in detail yet.

As a quick test you could check if increasing MAX_STRUCT_SIZE to (say) 32 fixes 
this particular example.

--

___
Python tracker 

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



[issue41461] test_pathlib assumes underlying filesystem permits creation with world-write permissions

2020-08-03 Thread Michael Felt


New submission from Michael Felt :

Two tests in test_pathlib test that the files created have mode o666 (rw-rw-rw).

However, on a filesystem (in my case NFS) configured to never permit global 
write - the test will always fail.

Is this something to be concerned about?

I can think of a few possible ways to react to an exception such as this, e.g., 
rather than 'FAIL' outright, try umask(2).



==
FAIL: test_open_mode (test.test_pathlib.PosixPathTest)
--
Traceback (most recent call last):
  File "/data/prj/python/src/py38-3.8.5/Lib/test/test_pathlib.py", line 2210, 
in test_open_mode
self.assertEqual(stat.S_IMODE(st.st_mode), 0o666)
AssertionError: 436 != 438

==
FAIL: test_touch_mode (test.test_pathlib.PosixPathTest)
--
Traceback (most recent call last):
  File "/data/prj/python/src/py38-3.8.5/Lib/test/test_pathlib.py", line 2223, 
in test_touch_mode
self.assertEqual(stat.S_IMODE(st.st_mode), 0o666)
AssertionError: 436 != 438

--


Just to verify it does work when on a 'local' filesystem.

cp -rp build /tmp/build
mv build build.nfs
ln -s /tmp/build build

== Tests result: SUCCESS ==

1 test OK.

Total duration: 7.8 sec
Tests result: SUCCESS

--
components: Tests
messages: 374725
nosy: Michael.Felt
priority: normal
severity: normal
status: open
title: test_pathlib assumes underlying filesystem permits creation with 
world-write permissions
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