[issue42159] AsyncMock restores stopped patch if same object stopped multiple times

2020-10-27 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This is not a problem with AsyncMock. The patching is not done when the patch 
object is created to store reference to the original unpatched function. Hence 
patcher1, patcher2 that patch the same function don't store a reference to the 
original sync_func. The lookup is done during start(). patcher1.start() makes a 
lookup and stores the function. When patcher2.start() makes a lookup the 
function is already patched with a mock and thus it resorts to the original as 
the mock. 

When stop is called on patcher1 it resets back to the original function. 
Meanwhile for patcher2 the original function set during start itself is a mock 
and it resets back to that. The lookup is done at 
https://github.com/python/cpython/blob/a6879d9445f98833c4e300e187956e2a218a2315/Lib/unittest/mock.py#L1360
 . Here target will print the function for patcher1.start() but the mock for 
patcher2.start().

import asyncio
import unittest
from unittest import TestCase
from unittest.mock import *

def sync_func():
raise Exception

class Test(TestCase):

def test_simultaneous_mocks_sync(self):
patcher1 = patch(f"{__name__}.sync_func")
patcher2 = patch(f"{__name__}.sync_func")

patcher1.start()
print(sync_func())

patcher2.start()
print(sync_func())

breakpoint()
patcher1.stop()
with self.assertRaises(Exception):
sync_func()

breakpoint()
patcher2.stop()

with self.assertRaises(Exception): # Fails, mock is restored!
sync_func()

if __name__ == "__main__":
unittest.main()

--
components: +Library (Lib)
type:  -> behavior

___
Python tracker 

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



[issue42165] Question about converting numpy float to bytes (bug??)

2020-10-27 Thread hyoxt121


New submission from hyoxt121 :

Hi! In order to convert numpy float to bytes, we are using tobytes() method:

import pickle
import numpy as np
pickle.loads(np.float64(0.34103))

and the expected result is like below (because np.float64(0.34103) is not bytes 
objects, appropriate errors are expected)
---
UnpicklingError Traceback (most recent call last)
 in 
> 1 pickle.loads(np.float64(0.34103))

UnpicklingError: invalid load key, '\xc1'.


Here we have some questions that some numbers (it is rare) like 0.34104 prints 
the following result without errors.
pickle.loads(np.float64(0.34104))
=> True

This occurs only when the converted bytes start with b'\x88 (for example 
0.04263, 0.08526, 0.11651 ...)
Can anyone answer whether this issue is Python bugs?

Any answer will be highly appreciated.

--
components: Library (Lib)
messages: 379738
nosy: hyoxt121
priority: normal
severity: normal
status: open
title: Question about converting numpy float to bytes (bug??)
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue42151] Pure Python xml.etree.ElementTree is missing default attribute values

2020-10-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

specified_attributes = True is also set in xml.dom.expatbuilder. Should not it 
be set to true in the C implementation of ElementTree?

--

___
Python tracker 

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



[issue42165] Question about converting numpy float to bytes (bug??)

2020-10-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Seems that np.float64 implements the buffer protocol, i.e. it can be accepted 
in any function that supports the buffer protocol (for example 
b'abc\xc1\x1c=~o\xd3\xd5?def'.index(np.float64(0.34103))). And pickle.loads() 
is one of such functions, it accepts bytes, bytearray, memoryview, mmap, etc.

There is no bug in Python, and I suppose it is an intended behavior in NumPy. 
It just happens that two features are used together in wrong way. The bug is in 
your code which passes wrong argument to pickle.loads().

--
nosy: +serhiy.storchaka
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



[issue42096] zipfile.is_zipfile incorrectly identifying a gzipped file as a zip archive

2020-10-27 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

ZipFile.open() is not the code for opening a zip file. :)

That's the code for opening a file embedded within an already constructed 
mode='r' archive as done the ZipFile.__init__() constructor.  By the time 
you've gotten to the open() method, you've loaded the entire unbounded in size 
central directory into memory as ZipInfo objects [constructor] and are checking 
signature of an individual file header you are attempting to read out of the 
archive.

Follow the ZipFile() constructor, it calls ZipFile._RealGetContents() which is 
the true start of parsing the archive.  
https://github.com/python/cpython/blob/master/Lib/zipfile.py#L1317

Sure, more and more steps can be done.  But if you want to do that, you may as 
well just get rid of is_zipfile() entirely - a functions who's point is to be 
fast and not consume an amount of memory determined by the input data - and 
have people just call `zipfile.ZipFile(path_in_question, mode='r')` and live 
with the consequences of attempting to load and parse the whole thing.  If that 
doesn't raise an exception, it is more likely to be a zip file.  But that could 
still raise an exception when trying to open each of the files inside, so you'd 
need to iterate over this and open those and make sure they're valid.

is_zipfile() isn't a verify_zipfile_integrity() routine.  Just a quick best 
guess.

is_zipfile() cannot be perfect and is not intended to be.  There is always 
going to be yet another thing it _could_ try.  It isn't worth chasing the 
impossible goal and making it not be fast.

Just update the is_zipfile() docs.

--

___
Python tracker 

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



[issue30681] email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2020-10-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

>>> email.utils.parsedate_to_datetime(None)
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/serhiy/py/cpython/Lib/email/utils.py", line 200, in 
parsedate_to_datetime
raise ValueError('Invalid date value or format "%s"' % str(data))
ValueError: Invalid date value or format "None"

First, the date value is None, not "None".

Second, why not just return None? parsedate() can be used in code like:

   parsedata(headers.get('Date'))

None is an expected argument if the header "Date" is absent. 
parsedate_to_datetime() is not compatible with parsedata() in this case.

It was a regression introduced in issue16714. Before that 
parsedate_to_datetime(None) returned None.

--
nosy: +serhiy.storchaka
status: closed -> open

___
Python tracker 

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



[issue42166] corrupted size vs. prev_size

2020-10-27 Thread kannan


New submission from kannan :

Getting the below error from long running python processes
--

2020-10-18T21:52:59.383Z === Backtrace: =
2020-10-18T21:52:59.383Z /lib64/libc.so.6(+0x7f3e4)[0x7f7bd3e053e4]
2020-10-18T21:52:59.383Z /lib64/libc.so.6(+0x814db)[0x7f7bd3e074db]
2020-10-18T21:52:59.383Z 
/lib64/libcrypto.so.10(CRYPTO_free+0x1d)[0x7f7bd1cfe80d]
2020-10-18T21:52:59.383Z /lib64/libssl.so.10(+0x41aa3)[0x7f7bd2134aa3]
2020-10-18T21:52:59.383Z /lib64/libssl.so.10(SSL_CTX_free+0x147)[0x7f7bd2136977]
2020-10-18T21:52:59.383Z 
/usr/local/lib/python3.7/lib-dynload/_ssl.cpython-37m-x86_64-linux-gnu.so(+0xe50b)[0x7f7bcf9d750b]
2020-10-18T21:52:59.383Z /lib64/libpython3.7m.so.1.0(+0x101bab)[0x7f7bd4db1bab]
2020-10-18T21:52:59.384Z /lib64/libpython3.7m.so.1.0(+0xe2416)[0x7f7bd4d92416]
2020-10-18T21:52:59.384Z /lib64/libpython3.7m.so.1.0(+0x101ca1)[0x7f7bd4db1ca1]
2020-10-18T21:52:59.384Z /lib64/libpython3.7m.so.1.0(+0xca6d9)[0x7f7bd4d7a6d9]
2020-10-18T21:52:59.384Z /lib64/libpython3.7m.so.1.0(+0x1f6255)[0x7f7bd4ea6255]
2020-10-18T21:52:59.384Z /lib64/libpython3.7m.so.1.0(+0x19fede)[0x7f7bd4e4fede]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyObject_GC_Malloc+0x133)[0x7f7bd4e50943]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyObject_GC_New+0xd)[0x7f7bd4e5099d]
2020-10-18T21:52:59.384Z /lib64/libpython3.7m.so.1.0(+0xe3fdf)[0x7f7bd4d93fdf]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(PyObject_GetIter+0x16)[0x7f7bd4d62d86]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0x133a)[0x7f7bd4e0c55a]
2020-10-18T21:52:59.384Z /lib64/libpython3.7m.so.1.0(+0xc562b)[0x7f7bd4d7562b]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0xa16)[0x7f7bd4e0bc36]
2020-10-18T21:52:59.384Z /lib64/libpython3.7m.so.1.0(+0xc562b)[0x7f7bd4d7562b]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0xa16)[0x7f7bd4e0bc36]
2020-10-18T21:52:59.384Z /lib64/libpython3.7m.so.1.0(+0xc562b)[0x7f7bd4d7562b]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0xa16)[0x7f7bd4e0bc36]
2020-10-18T21:52:59.384Z /lib64/libpython3.7m.so.1.0(+0xc562b)[0x7f7bd4d7562b]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0xa16)[0x7f7bd4e0bc36]
2020-10-18T21:52:59.384Z /lib64/libpython3.7m.so.1.0(+0xc562b)[0x7f7bd4d7562b]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0xa16)[0x7f7bd4e0bc36]
2020-10-18T21:52:59.384Z /lib64/libpython3.7m.so.1.0(+0xc562b)[0x7f7bd4d7562b]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0xa16)[0x7f7bd4e0bc36]
2020-10-18T21:52:59.384Z /lib64/libpython3.7m.so.1.0(+0xc562b)[0x7f7bd4d7562b]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0xa16)[0x7f7bd4e0bc36]
2020-10-18T21:52:59.384Z /lib64/libpython3.7m.so.1.0(+0xc562b)[0x7f7bd4d7562b]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0xa16)[0x7f7bd4e0bc36]
2020-10-18T21:52:59.384Z /lib64/libpython3.7m.so.1.0(+0xc562b)[0x7f7bd4d7562b]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0xa16)[0x7f7bd4e0bc36]
2020-10-18T21:52:59.384Z /lib64/libpython3.7m.so.1.0(+0xc562b)[0x7f7bd4d7562b]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0xa16)[0x7f7bd4e0bc36]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyEval_EvalCodeWithName+0x27e)[0x7f7bd4e1602e]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyFunction_FastCallKeywords+0xda)[0x7f7bd4d6d4aa]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0x4f34)[0x7f7bd4e10154]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyEval_EvalCodeWithName+0x27e)[0x7f7bd4e1602e]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyFunction_FastCallKeywords+0xda)[0x7f7bd4d6d4aa]
2020-10-18T21:52:59.384Z 
/lib64/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0x4f34)[0x7f7bd4e10154]
2020-10-18T21:52:59.385Z /lib64/libpython3.7m.so.1.0(+0xbcdfa)[0x7f7bd4d6cdfa]
2020-10-18T21:52:59.385Z 
/lib64/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0x4f34)[0x7f7bd4e10154]
2020-10-18T21:52:59.385Z /lib64/libpython3.7m.so.1.0(+0xbcdfa)[0x7f7bd4d6cdfa]
2020-10-18T21:52:59.385Z 
/lib64/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0x79c)[0x7f7bd4e0b9bc]
2020-10-18T21:52:59.385Z /lib64/libpython3.7m.so.1.0(+0xbcdfa)[0x7f7bd4d6cdfa]
2020-10-18T21:52:59.385Z 
/lib64/libpython3.7m.so.1.0(_PyFunction_FastCallDict+0x66)[0x7f7bd4d6cfc6]
2020-10-18T21:52:59.385Z 
/lib64/libpython3.7m.so.1.0(_PyObject_Call_Prepend+0x7b)[0x7f7bd4d6ef0b]
2020-10-18T21:52:59.385Z /lib64/libpython3.7m.so.1.0(+0x107b81)[0x7f7bd4db7b81]
2020-10-18T21:52:59.385Z /lib64/libpython3.7m.so.1.0(+0x1038a2)[0x7f7bd4db38a2]
2020-10-18T21:52:59.385Z 
/lib64/libpython3.7m.so.1.0(_PyObject_FastCallKeywords+0x99)[0x7f7bd4d6dc89]
2020-10-18T21:52:59.3

[issue42166] corrupted size vs. prev_size

2020-10-27 Thread kannan


kannan  added the comment:

python process getting killed after this error

--

___
Python tracker 

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



[issue42166] corrupted size vs. prev_size

2020-10-27 Thread kannan


kannan  added the comment:

Implementation details
1). python long running stomp.py client (stomp+ssl)
2). main process thread used to create connection (while true sleep for holding 
the process)
3). listener thread receives message in another thread

--

___
Python tracker 

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



[issue42166] corrupted size vs. prev_size

2020-10-27 Thread kannan


kannan  added the comment:

Implementation details
1). python long running stomp.py client (stomp+ssl)
2). main process thread used to create connection (while true sleep for holding 
the process)
3). listener thread receives message and processes it

--

___
Python tracker 

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



[issue42166] corrupted size vs. prev_size

2020-10-27 Thread Christian Heimes


Christian Heimes  added the comment:

Could you please provide detailed information about your platform (OS, CPU, 
vendor/distribution, Python version, and OpenSSL version), a full stacktrace 
with debug symbols, and Python code to reproduce the error?

Why is the _ssl module in /usr/local/lib while the rest of your Python 
installation is in /lib64? Did you compile the module yourself?

--

___
Python tracker 

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



[issue42165] Question about converting numpy float to bytes (bug??)

2020-10-27 Thread hyoxt121


hyoxt121  added the comment:

If so, regardless of invalid operation, can anyone explain why 
"pickle.loads(np.float64(0.34104))" prints "True"?

--

___
Python tracker 

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



[issue42167] Documentation for SETUP_WITH opcode is wrong

2020-10-27 Thread Patrick Reader


New submission from Patrick Reader :

bpo-33387 introduced two new opcodes, `RERAISE` and `WITH_EXCEPT_START` 
(previously called `WITH_EXCEPT_FINISH`), replacing the previous 
`WITH_CLEANUP_START`, `WITH_CLEANUP_FINISH`,
`BEGIN_FINALLY`, `END_FINALLY`, `CALL_FINALLY` and `POP_FINALLY`.

The 
[documentation](https://docs.python.org/3.9/library/dis.html#opcode-SETUP_WITH) 
for it references the since removed `WITH_CLEANUP_START`, which is definitely 
wrong. I don't know enough to be able to fix it though, sorry, so I've added 
the core team.

--
assignee: docs@python
components: Documentation, Interpreter Core
messages: 379749
nosy: docs@python, pxeger
priority: normal
severity: normal
status: open
title: Documentation for SETUP_WITH opcode is wrong
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue42167] Documentation for SETUP_WITH opcode is wrong

2020-10-27 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue42168] Question about deserializing some numbers (bug??)

2020-10-27 Thread hyoxt121


New submission from hyoxt121 :

Hi! In order to deserialize bytes object, we use pickle.loads():

import pickle
import numpy as np
pickle.loads(np.float64(0.34103))

and the expected result is like below (because np.float64(0.34103) is not bytes 
objects, appropriate errors are expected)
---
UnpicklingError Traceback (most recent call last)
 in 
> 1 pickle.loads(np.float64(0.34103))

UnpicklingError: invalid load key, '\xc1'.


Here we have some questions that some numbers (it is rare) like 0.34104 prints 
the following result without errors.
pickle.loads(np.float64(0.34104))
=> True

This occurs only when the converted bytes start with b'\x88 (for example 
0.04263, 0.08526, 0.11651 ...)
np.float64(0.34104).tobytes()
=> b'\x88.\xa8o\x99\xd3\xd5?'
Can anyone answer whether this issue is Python bugs?

Any answer will be highly appreciated.

--
components: Library (Lib)
messages: 379750
nosy: hyoxt121
priority: normal
severity: normal
status: open
title: Question about deserializing some numbers (bug??)
versions: Python 3.6

___
Python tracker 

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



[issue42165] closed (reopen with other issue)

2020-10-27 Thread hyoxt121


Change by hyoxt121 :


--
title: Question about converting numpy float to bytes (bug??) -> closed (reopen 
with other issue)

___
Python tracker 

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



[issue42165] Question about converting numpy float to bytes (bug??)

2020-10-27 Thread hyoxt121


hyoxt121  added the comment:

I will close and reopen again with some modification.

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



[issue42168] Question about deserializing some numbers (bug??)

2020-10-27 Thread hyoxt121


hyoxt121  added the comment:

Can anyone explain "pickle.loads(np.float64(0.34104))" prints "True"?

--

___
Python tracker 

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



[issue42111] Make the xxlimited module an example of best extension module practices

2020-10-27 Thread Petr Viktorin


Petr Viktorin  added the comment:

Thanks! That's my plan, but when I added tests I realized I need to pt in some 
general improvements to the stable ABI first.

--

___
Python tracker 

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



[issue42169] Apparently all documentation on @typing.overload is wrong

2020-10-27 Thread Peilonrayz


New submission from Peilonrayz :

The documentation for `typing.overload` says in a non-stub file the last 
definition shouldn't be typed. However running that through `mypy --strict` 
fails. I opened an issue on mypy a couple of days ago, however was told to 
report this on CPython.

```
>>> import typing
>>> help(typing.overload)
Help on function overload in module typing:

overload(func)
Decorator for overloaded functions/methods.

In a stub file, place two or more stub definitions for the same
function in a row, each decorated with @overload.  For example:

  @overload
  def utf8(value: None) -> None: ...
  @overload
  def utf8(value: bytes) -> bytes: ...
  @overload
  def utf8(value: str) -> bytes: ...

In a non-stub file (i.e. a regular .py file), do the same but
follow it with an implementation.  The implementation should *not*
be decorated with @overload.  For example:

  @overload
  def utf8(value: None) -> None: ...
  @overload
  def utf8(value: bytes) -> bytes: ...
  @overload
  def utf8(value: str) -> bytes: ...
  def utf8(value):
  # implementation goes here
```

The typing docs and PEP 484 say similar things.  
typing docs - https://docs.python.org/3/library/typing.html#typing.overload  
PEP 484 - https://www.python.org/dev/peps/pep-0484/#function-method-overloading

Jelle Zijlstra told me to report this here. 
https://github.com/python/mypy/issues/9633#issuecomment-716201251

> You should annotate the implementation. The example in the typing docs should 
> perhaps also add an annotation, but that's an issue for the CPython repo, not 
> for mypy.

Either way mypy errors which can be seen in the following playgrounds.

docs - 
https://mypy-play.net/?mypy=latest&python=3.9&flags=strict&gist=cffb94a2de9d5d55142da5e7d960102f
```
main.py:9: error: Function is missing a type annotation
Found 1 error in 1 file (checked 1 source file)
```

proper way? - 
https://mypy-play.net/?mypy=latest&python=3.9&gist=bfadffe92571b4faad04ea151b2b1c54
```
main.py:3: error: An overloaded function outside a stub file must have an 
implementation
Found 1 error in 1 file (checked 1 source file)
```

Is all the documentation on `typing.overload` wrong - should the implementation 
be annotated?

--
assignee: docs@python
components: Documentation
messages: 379754
nosy: docs@python, peilonrayz
priority: normal
severity: normal
status: open
title: Apparently all documentation on @typing.overload is wrong
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



[issue42165] closed (reopen with other issue)

2020-10-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

To answer the question:

> "can anyone explain why "pickle.loads(np.float64(0.34104))" prints "True"

You can use pickletools.dis:

>>> bytes(np.float64(0.34104))
b'\x88.\xa8o\x99\xd3\xd5?'

>>> pickletools.dis(bytes(np.float64(0.34104)))
0: \x88 NEWTRUE
1: .STOP

Note that pickle ignores anything after the end of the pickle (the STOP 
opcode), so only the first 2 bytes are being used.

As Serhiy said, it's just chance that the bytes returned by numpy happen to be 
a valid pickle for some values. You should not be trying to .loads() something 
that isn't a valid pickle stream. It's not clear why you think a byte string 
returned by np.float64 would be a valid pickle.

--
nosy: +eric.smith
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



[issue42165] closed (reopen with other issue)

2020-10-27 Thread Ronald Oussoren


Change by Ronald Oussoren :


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



[issue42163] _replace() no longer works on platform.uname_result objects

2020-10-27 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
assignee:  -> jaraco

___
Python tracker 

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



[issue42163] _replace() no longer works on platform.uname_result objects

2020-10-27 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Indeed, it was unexpected that consumers of the `uname_result` were using 
`_replace`. In fact, the focus of the tests is on ensuring that users are able 
to access the items by index, e.g. `uname()[0]`.

It should be possible to support `_replace` on the `uname_result` as found in 
Python 3.9+. The real question is - is it important enough to declare and 
restore support for this use case based on this one report (and likely handful 
of other cases), or would it be better to discourage use of `_replace` for 
`uname_result` and provide a straightforward workaround (to be documented here) 
for those use-cases to employ?

Marc, do you have an opinion?

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



[issue39573] [C API] Make PyObject an opaque structure in the limited C API

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:

Miro:
> This also breaks pycurl:
> https://github.com/pycurl/pycurl/pull/660

Right, see my previous comment, another PR was already proposed in May!

me:
> This change broke pycurl:
> https://github.com/pycurl/pycurl/pull/636

Merged pycurl fix:
https://github.com/pycurl/pycurl/commit/e633f9a1ac4df5e249e78c218d5fbbd848219042

--

___
Python tracker 

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



[issue42170] splitdrive fails for UNC path with the "\\?\UNC\" prefix.

2020-10-27 Thread Quentin Peter


Change by Quentin Peter :


--
components: Library (Lib)
nosy: qpeter
priority: normal
severity: normal
status: open
title: splitdrive fails for UNC path with the "\\?\UNC\" prefix.
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue39573] [C API] Make PyObject an opaque structure in the limited C API

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:

Miro:
> I don't understand the rationale for this change in depth, but does the 
> benefit outweigh (yet another) backwards incompatibility?

I wrote PEP 620 "Hide implementation details from the C API" to explain the 
rationale:
https://www.python.org/dev/peps/pep-0620/

--

___
Python tracker 

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



[issue42170] splitdrive fails for UNC path with the "\\?\UNC\" prefix.

2020-10-27 Thread Quentin Peter


New submission from Quentin Peter :

Python 3.7.6 (default, Jan  8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 7.18.1 -- An enhanced Interactive Python.

In [1]: import os.path

In [2]: os.path.splitdrive(r"\\machine\mountpoint\directory")
Out[2]: ('machine\\mountpoint', '\\directory')

In [3]: os.path.splitdrive(r"\\?\UNC\machine\mountpoint\directory")
Out[3]: ('?\\UNC', '\\machine\\mountpoint\\directory')

In [4]:

--

___
Python tracker 

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



[issue42170] splitdrive fails for UNC path with the "\\?\UNC\" prefix.

2020-10-27 Thread Quentin Peter


Change by Quentin Peter :


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

___
Python tracker 

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



[issue42170] splitdrive fails for UNC path with the "\\?\UNC\" prefix.

2020-10-27 Thread Eryk Sun


Change by Eryk Sun :


--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> support "UNC" device paths in ntpath.splitdrive

___
Python tracker 

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



[issue42168] Question about deserializing some numbers (bug??)

2020-10-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

I explained this in https://bugs.python.org/issue42165#msg379755

This is not a bug in python, it's a bug in your code. You should not expect to 
unpickle something that wasn't created by pickling it.

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue42111] Make the xxlimited module an example of best extension module practices

2020-10-27 Thread Petr Viktorin


Change by Petr Viktorin :


--
assignee:  -> petr.viktorin

___
Python tracker 

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



[issue42168] Question about deserializing some numbers (bug??)

2020-10-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

Or stated differently: if you pass random byte strings to pickle.loads(), 
sometimes it might succeed and produce a random object because you've managed 
to create a valid pickle. But most often it will fail.

--

___
Python tracker 

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



[issue42171] Add PEP 573 to the stable ABI

2020-10-27 Thread Petr Viktorin


New submission from Petr Viktorin :

The following PEP 573 were not added to the Windows list of stable ABI symbols 
(PC/python3dll.c):
- PyModule_AddType
- PyType_FromModuleAndSpec
- PyType_GetModule
- PyType_GetModuleState

I'd like to add them.

Also, the PEP introduces the (METH_FASTCALL | METH_KEYWORDS | METH_METHOD) 
calling convention, but METH_FASTCALL is not part of the stable ABI (and it 
other uses are not suitable for stable ABI).
I propose adding a new value, METH_METHOD_ARGS_KWD (name up for bikeshedding), 
which would be equal to (METH_FASTCALL | METH_KEYWORDS | METH_METHOD) but part 
of the limited API.

Does that sound like a good idea?


On the sprint, Steve mentioned that it would be possible to backport this to 
Python 3.9.1, even though it would mean a weird minor-version requirement.
I no longer think that's a good idea: fixing the stable ABI will be a 
longer-term project, and I don't want to fight issues in a 3.9 backport.

FWIW, for the longer-term project, I started a brainstorming repo at 
https://github.com/encukou/abi3 (Yes, it has some overlap with Victor's more 
general notes at https://pythoncapi.readthedocs.io/ )
But I'd like to get the additions above in to unblock #42111 before I start on 
improving the stable ABI in general.

--
components: C API
messages: 379762
nosy: ncoghlan, petr.viktorin, scoder, vstinner
priority: normal
severity: normal
status: open
title: Add PEP 573 to the stable ABI
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



[issue32659] Solaris "stat" should support "st_fstype"

2020-10-27 Thread STINNER Victor


Change by STINNER Victor :


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



[issue42172] Typo in test library for test_socket.py

2020-10-27 Thread Akashkumar D Khunt

New submission from Akashkumar D Khunt :

There is a typo in test_socket.py file where instead of 
“testSecondCmsgTruncInData” function name is “testSecomdCmsgTruncInData”.

--
components: Tests
messages: 379763
nosy: adkhunt
priority: normal
severity: normal
status: open
title: Typo in test library for test_socket.py
type: enhancement
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



[issue42172] Typo in test library for test_socket.py

2020-10-27 Thread Dong-hee Na


Dong-hee Na  added the comment:

@adkhunt
Do you want to submit the patch for this?
If you want, please ping me on your PR

--
nosy: +corona10

___
Python tracker 

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



[issue42171] Add PEP 573 to the stable ABI

2020-10-27 Thread Dong-hee Na


Dong-hee Na  added the comment:

> I'd like to add it anyway.
Nice ;)

--
nosy: +corona10

___
Python tracker 

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



[issue42172] Typo in test library for test_socket.py

2020-10-27 Thread Dong-hee Na


Change by Dong-hee Na :


--
versions: +Python 3.10, Python 3.9

___
Python tracker 

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



[issue42171] Add PEP 573 to the stable ABI

2020-10-27 Thread Petr Viktorin


Petr Viktorin  added the comment:

Correction: PyModule_AddType is not from PEP 573. I'd like to add it anyway.

--

___
Python tracker 

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



[issue42173] Drop Solaris support

2020-10-27 Thread STINNER Victor

New submission from STINNER Victor :

In past years, very few Python core developers took care of the Solaris 
support. The latest significant Solaris enhancement was in 2018 with the 
addition of a new Solaris st_fstype attribute to os.stat(), in Python 3.7, by 
Jesús Cea Avión (bpo-32659).

Another recent Solaris-related change is bpo-41687: "Fix implementation of 
sendfile to be compatible with Solaris".

On the Oracle side, there was an article about Python on Solaris in 2019:
"Future of Python on Solaris" by  Darren Moffat 
https://blogs.oracle.com/solaris/future-of-python-on-solaris

I now that Giampaolo Rodola cares of the Solaris support for his psutil project:
https://github.com/giampaolo/psutil/

It's unclear to me if Oracle still plans to maintain Solaris. The latest 
release was published 2 years ago. The Wikipedia article says: "While Oracle 
did have a large layoff of Solaris development engineering staff, development 
continues today of which Solaris 11.4 was released in 2018."
https://en.wikipedia.org/wiki/Solaris_(operating_system)

There is currently 25 open issues which could be closed if we drop the Solaris 
support.

See also the PEP 11 for the process.

I asked asked 4 years ago (in 2016) if Solaris support should/can be removed:
"OpenIndiana and Solaris support"
https://mail.python.org/archives/list/python-...@python.org/message/NOT2RORSNX72ZLUHK2UUGBD4GTPNKBUS/

Python has no longer buildbot workers running on Solaris or a Solaris variant 
(OpenIndiana, Illumos, etc.).

I propose to drop the Solaris support in Python to reduce the maintenance 
burden.

Python has a few features specific to Solaris:

* st_fstype attribute of os.stat()
* select.devpoll and selectors.DevpollSelector
* time.CLOCK_HIGHRES constant
* stat.S_ISDOOR()
* tarfile: "Solaris extended header" (no need to remove this one)

Solaris has many names and variants:

* SunOS
* SRV4
* Solaris
* Illumos (still active in July 2020 at least)
* OpenSolaris: "On Friday, August 13, 2010, details started to emerge relating 
to the discontinuation of the OpenSolaris project and the pending release of a 
new closed-source, proprietary version of Solaris, Solaris 11." says Wikipedia
* OpenIndiana (latest release in 2020)

I'm not sure on how to process? Deprecate all Solaris-specific features in 
Python 3.10, make sure that Python 3.11 cannot be built on Solaris anymore, and 
drop the code in Python 3.12? Or drop everything as soon as possible in Python 
3.10?

The alternative is to leave the code unchanged and let the code slowly die, as 
we did for other platforms like HP-UX and IRIX.

See also my notes on platforms supported by Python:
https://pythondev.readthedocs.io/platforms.html

Attached draft PR gives an idea on how much code can be removed if Solaris 
support is removed. A coase estimation is the removal of 700 lines:

 Doc/c-api/init.rst   |   3 +-
 Doc/distutils/apiref.rst |   1 -
 Doc/library/gettext.rst  |  10 +-
 Doc/library/os.rst   |  12 +-
 Doc/library/platform.rst |   5 +-
 Doc/library/posix.rst|   8 +-
 Doc/library/sys.rst  |   3 +-
 Doc/library/sysconfig.rst|   1 -
 Doc/library/time.rst |  13 +-
 Doc/using/unix.rst   |   7 -
 Include/pyport.h |   5 -
 Lib/cgi.py   |   4 +-
 Lib/ctypes/test/test_byteswap.py |   2 +-
 Lib/ctypes/util.py   | 100 ++
 Lib/distutils/command/bdist.py   |   2 +-
 Lib/distutils/tests/support.py   |   2 +-
 Lib/distutils/tests/test_build_ext.py|  21 --
 Lib/distutils/util.py|  11 --
 Lib/gettext.py   |   3 -
 Lib/logging/handlers.py  |   2 -
 Lib/platform.py  |  27 +--
 Lib/sysconfig.py |  11 --
 Lib/test/fork_wait.py|   4 +-
 Lib/test/subprocessdata/fd_status.py |   3 -
 Lib/test/test__locale.py |  24 ---
 Lib/test/test_asyncio/test_sendfile.py   |   6 -
 Lib/test/test_asyncore.py|   2 -
 Lib/test/test_cmd_line.py|   2 +-
 Lib/test/test_curses.py  |   2 +-
 Lib/test/test_fileio.py  |   2 +-
 Lib/test/test_importlib/import_/test_path.py |   2 +-
 Lib/test/test_locale.py  |   2 +-
 Lib/test/test_os.py  |  14 +-
 Lib/test/test_posix.py   |   7 +-
 Lib/test/test_pty.py |   4 -
 Lib/test/test_selectors.py   |   2 +-
 Lib/test/test_shutil.py  |   2 +-
 Lib/test/test_socket.py  |   4 -
 Lib/test/test_strftime.py|   3 +

[issue42173] Drop Solaris support

2020-10-27 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue42173] Drop Solaris support

2020-10-27 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue42169] Apparently all documentation on @typing.overload is wrong

2020-10-27 Thread Ken Jin


Change by Ken Jin :


--
nosy: +gvanrossum, kj, levkivskyi
versions:  -Python 3.6, Python 3.7

___
Python tracker 

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



[issue42169] Apparently all documentation on @typing.overload is wrong

2020-10-27 Thread Ken Jin


Change by Ken Jin :


--
versions: +Python 3.6, Python 3.7 -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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 37834136d0afe51d274bfc79d8705514cbe73727 by Victor Stinner in 
branch 'master':
bpo-42161: Modules/ uses _PyLong_GetZero() and _PyLong_GetOne() (GH-22998)
https://github.com/python/cpython/commit/37834136d0afe51d274bfc79d8705514cbe73727


--

___
Python tracker 

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



[issue42169] Apparently all documentation on @typing.overload is wrong

2020-10-27 Thread Ken Jin


Ken Jin  added the comment:

Apologies to all for the spam, I made a misclick. 

Maybe the documentation could be clearer for that specific example. The 
following code seems to work on mypy (in a non-stub file):
```
from typing import overload, Any, Optional

@overload
def utf8(value: None) -> None: 
...
@overload
def utf8(value: bytes) -> bytes: 
...
def utf8(value: Optional[bytes]) -> Optional[bytes]:
if value is None:
return None
return b''
```
But I don't know if that's the intended usage, because that makes overload 
appear rather redundant.

--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21918
pull_request: https://github.com/python/cpython/pull/23003

___
Python tracker 

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



[issue6761] Class calling

2020-10-27 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +21919
pull_request: https://github.com/python/cpython/pull/23004

___
Python tracker 

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



[issue6761] Class calling

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 95f710c55714153f0c8cce48f8215bb3d866ac1d by Andre Delfino in 
branch 'master':
bpo-6761: Enhance __call__ documentation (GH-7987)
https://github.com/python/cpython/commit/95f710c55714153f0c8cce48f8215bb3d866ac1d


--
nosy: +vstinner

___
Python tracker 

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



[issue6761] Class calling

2020-10-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21920
pull_request: https://github.com/python/cpython/pull/23005

___
Python tracker 

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



[issue42162] The license page for Python 3.0 is messed up

2020-10-27 Thread Ken Jin


Ken Jin  added the comment:

Python 3.0.x is no longer being maintained. As such I don't think there's a way 
for a fix to be ported over. I might be wrong though.

--
nosy: +kj

___
Python tracker 

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



[issue6761] Class calling

2020-10-27 Thread miss-islington


miss-islington  added the comment:


New changeset b1ce0440bfe87e092ca5e2e57875fb7fc1129137 by Miss Skeleton (bot) 
in branch '3.8':
bpo-6761: Enhance __call__ documentation (GH-7987)
https://github.com/python/cpython/commit/b1ce0440bfe87e092ca5e2e57875fb7fc1129137


--

___
Python tracker 

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



[issue42174] shutil.get_terminal_size() returns 0 when run in a pty

2020-10-27 Thread Florian Bruhin


New submission from Florian Bruhin :

When shutil.get_terminal_size() is used in a PTY, the os.get_terminal_size() 
call can return (0, 0).

With the pty script from 
https://github.com/python/mypy/issues/8144#issue-537760245:

$ python3 t.py python3 -c 'import shutil; print(shutil.get_terminal_size())'

os.terminal_size(columns=0, lines=0)

While the following cases *are* handled by returning the fallback:

- COLUMNS or lines being non-existent or 0
- os.get_terminal_size raising

The case of os.get_terminal_size() succeeding but returning (0, 0) should 
probably be handled the same way as well.

This e.g. affects mypy when run with pre-commit:
https://github.com/pre-commit/mirrors-mypy/issues/29

--
components: Library (Lib)
messages: 379773
nosy: The Compiler, giampaolo.rodola, tarek
priority: normal
severity: normal
status: open
title: shutil.get_terminal_size() returns 0 when run in a pty
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue6761] Class calling

2020-10-27 Thread miss-islington


miss-islington  added the comment:


New changeset 2cb259fcf3cde56f359c2f393280689784dcc834 by Miss Skeleton (bot) 
in branch '3.9':
bpo-6761: Enhance __call__ documentation (GH-7987)
https://github.com/python/cpython/commit/2cb259fcf3cde56f359c2f393280689784dcc834


--

___
Python tracker 

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



[issue42166] corrupted size vs. prev_size

2020-10-27 Thread kannan


kannan  added the comment:

Thanks for the reply Christian Heimes
Environment details

1). os - centos 7
2). python - 3.7.3

python installed inside docker container and we are using AWS ECS with fargate 
for docker container deployment
while installing python37 we are copying below files

cp /usr/local/lib/libpython3.7m.so.1.0 /lib64/libpython3.7m.so.1.0
cp /usr/local/lib/python3.7 /usr/local/lib/python3.7

--

___
Python tracker 

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



[issue42166] corrupted size vs. prev_size

2020-10-27 Thread kannan


kannan  added the comment:

we didn't compile the _ssl module

--

___
Python tracker 

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



[issue42166] corrupted size vs. prev_size

2020-10-27 Thread Christian Heimes


Christian Heimes  added the comment:

Why are you copying the file around?

How did you install Python 3.7 in the first place. AFAIK CentOS 7 does not come 
with Python 3.7.

Python 3.7.3 is old and no longer supported. Can you upgrade to a more recent 
version of 3.7?

--

___
Python tracker 

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



[issue42166] corrupted size vs. prev_size

2020-10-27 Thread kannan


kannan  added the comment:

This error happens randomly and we couldn't able to reproduce the error.

--

___
Python tracker 

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



[issue42166] corrupted size vs. prev_size

2020-10-27 Thread kannan


kannan  added the comment:

we are installing python using wget
https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
export LD_LIBRARY_PATH=/usr/local/Python3.7/lib
export PATH="/usr/local/bin:$PATH"

--

___
Python tracker 

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



[issue37609] support "UNC" device paths in ntpath.splitdrive

2020-10-27 Thread Eryk Sun


Eryk Sun  added the comment:

I'm attaching a rewrite of splitdrive() from msg352355. This version uses an 
internal _next() function to get the indices of the next path component, 
ignoring repeated separators. It also flattens the nested structure of the 
previous implementation by adding multiple return statements.

--
Added file: https://bugs.python.org/file49541/splitdrive.py

___
Python tracker 

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



[issue36457] functools.singledispatchmethod interacts poorly with subclasses

2020-10-27 Thread Bojan Jovanovic


Change by Bojan Jovanovic :


--
nosy: +bojan.jovanovic.gtech

___
Python tracker 

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



[issue42166] corrupted size vs. prev_size

2020-10-27 Thread Christian Heimes


Christian Heimes  added the comment:

There isn't much I can do for you. CentOS 7 has OpenSSL 1.0.2. There might be a 
threading issue in OpenSSL or Python. Both Python 3.7.3 and OpenSSL 1.0.2 are 
no longer supported. The minimum supported versions are OpenSSL 1.1.1 and 
Python 3.7.9.  You'd have to update to CentOS 8 to get a more recent OpenSSL 
version.

--

___
Python tracker 

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



[issue42036] Unchecked return in Modules/posixmodule.c from multiple function calls

2020-10-27 Thread Sagar Pant


Sagar Pant  added the comment:

Bumping this up for updates.

--

___
Python tracker 

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



[issue42034] Unchecked return in Objects/typeobject.c and possible uninitialized variables in cls and new_mro

2020-10-27 Thread Sagar Pant


Sagar Pant  added the comment:

Bumping this up for updates.

--

___
Python tracker 

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



[issue42175] long lines from interactive stdin are truncated

2020-10-27 Thread Anthony Sottile


New submission from Anthony Sottile :

this was originally pointed out in a comment on my youtube video here: 
https://youtu.be/Xf_82stIbB8


here's a reproduction:

1. produce 5000 characters of output: python3 -c 'print("a"*5000)'
2. copy that to the clipboard
3. run this: python3 -c 'import sys; print(len(sys.stdin.read()))'
4. paste
5. press enter
6. ^D

I get the following:

$ python3 -c 'import sys; print(len(sys.stdin.read()))'
...
4096

but I expect the value to be 5001 (+1 for the \n)

--
messages: 379783
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: long lines from interactive stdin are truncated
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



[issue42166] corrupted size vs. prev_size

2020-10-27 Thread kannan


kannan  added the comment:

As you said we are using a threaded consumers in which main thread will create 
connection and listener thread will receive message.
We are passing main thread object to listener to acknowledge the message using 
connection object (conn.ack)

in connection class
self.conn = activemq stomp connection
self.listener_obj = ConsumerListener(self)

in listener class
self.conn = conn_obj_from_main_thread
self.conn.ack(msg_id, subscription)

--

___
Python tracker 

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



[issue42175] long lines from interactive stdin are truncated

2020-10-27 Thread Ammar Askar


Ammar Askar  added the comment:

This doesn't show up in piping so I think it might be a Linux terminal 
limitation. This thread claims a 4096 limit in cooked terminals, would you mind 
giving one of the work-arounds here a try and see if it that gets rid of it: 
https://unix.stackexchange.com/questions/131105/how-to-read-over-4k-input-without-new-lines-on-a-terminal

--
nosy: +ammar2

___
Python tracker 

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



[issue42169] Apparently all documentation on @typing.overload is wrong

2020-10-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

> The documentation for `typing.overload` says in a non-stub file the last 
> definition shouldn't be typed.

Incorrect. It doesn't say it shouldn't be *typed*, it says it shouldn't be 
*decorated with @overload*, which is a different thing.

The example is correct, since no annotation is the same as annotating with 
`Any`.

But with `mypy --strict`, no annotation causes an error, so if you are using 
that, you have to add *some* annotation (e.g. `Any`).

In your final example, the overloads are not redundant, since only the 
overloads tell the type checker that the output type corresponds to the input 
type.

For more information, please see Gitter (linked from the typing home page).

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



[issue42175] long lines from interactive stdin are truncated

2020-10-27 Thread Anthony Sottile


Anthony Sottile  added the comment:

indeed! that's it -- you learn something every day :)

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



[issue42175] long lines from interactive stdin are truncated

2020-10-27 Thread Eryk Sun


Eryk Sun  added the comment:

For Windows see issue 41849. The legacy limit (i.e. PYTHONLEGACYWINDOWSSTDIO) 
for reading input via io.FileIO is 8K characters in Windows, but with 
io._WindowsConsoleIO, it's only 512 characters, which is far too small in 
general. The legacy implementation of input() based on C fgets() is capped at 
4K characters in Windows, which is the same as a Linux terminal. The new 
implementation of input() in Windows (i.e. _PyOS_WindowsConsoleReadline) 
increases the limit to 16K characters. I'd like to see both cases increased to 
32K characters, which is the length limit of a command line or file path in 
Windows.

--
nosy: +eryksun

___
Python tracker 

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



[issue42176] Valgrind reports "Conditional jump or move depends on uninitialised value(s)" in `PyUnicode_AsEncodedString` and `PyUnicode_Decode`

2020-10-27 Thread Boris Staletic


New submission from Boris Staletic :

When running valgrind on a C code that calls `PyUnicode_AsEncodedString` and 
`PyUnicode_Decode`, valgrind reports that there's a conditional jump based on 
uninitialized variable, if the encoding is "latin1".

I am able to replicate the error 100% of the time, on Ubuntu 20.04, with python 
3.9.0 installed with pyenv. I also have repro'd the error in my CI (link 
below). Steps to repro:

1. docker run -it ubuntu:20.04 /bin/bash
2. apt update
3. apt install valgrind gcc build-essential libssl-dev zlib1g-dev libbz2-dev 
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev 
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
4. curl https://pyenv.run | bash
5. export PATH="/root/.pyenv/bin:$PATH"
6. eval "$(pyenv init -)"
7. PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.9.0
8. Take the attached C file.
9. gcc -ggdb3 -I/root/.pyenv/versions/3.9.0/include/python3.9 
-L/root/.pyenv/versions/3.9.0/lib test2.c -lpython3.9
10. LD_LIBRARY_PATH=/root/.pyenv/versions/3.9.0/lib/ PYTHONMALLOC=malloc 
valgrind ./a.out

Valgrind output:

==22783== Conditional jump or move depends on uninitialised value(s)
==22783==at 0x49ABE64: PyUnicode_Decode (unicodeobject.c:3443)
==22783==by 0x49ABE64: PyUnicode_Decode (unicodeobject.c:3398)
==22783==by 0x109251: main (test2.c:5)
==22783==
==22783== Conditional jump or move depends on uninitialised value(s)
==22783==at 0x499A294: PyUnicode_AsEncodedString (unicodeobject.c:3732)
==22783==by 0x499A294: PyUnicode_AsEncodedString (unicodeobject.c:3688)
==22783==by 0x10926D: main (test2.c:6)


CI log: 
https://dev.azure.com/borisstaletic/3ce92110-caa5-4c49-b8c3-44a433da676b/_apis/build/builds/1338/logs/6
Repository for testing the bug: 
https://github.com/bstaletic/ycmd/tree/python-error

--
components: Interpreter Core
files: test.c
messages: 379790
nosy: bstaletic
priority: normal
severity: normal
status: open
title: Valgrind reports "Conditional jump or move depends on uninitialised 
value(s)" in `PyUnicode_AsEncodedString` and `PyUnicode_Decode`
type: compile error
versions: Python 3.9
Added file: https://bugs.python.org/file49542/test.c

___
Python tracker 

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



[issue42096] zipfile.is_zipfile incorrectly identifying a gzipped file as a zip archive

2020-10-27 Thread Brian Kohan


Brian Kohan  added the comment:

I concur with Gregory. It seems that the action here is to just make it 
apparent in the docs the very real possibility of false positives.

In my experience processing data from the wild, I see a pretty high rate of 
about 1/1000. I'm sure the probability is a function of the types of files I'm 
working with. But in any case, is_zipfile can't be made to be sufficient in and 
of itself for reliably identifying zip files. It still has utility in weeding 
out true negatives though. In my case I don't ever expect to see a self 
extracting file or a file compounded into an executable so I use the results of 
is_zipfile as well as a manual check of the magic bytes at the start. So far so 
good.

--

___
Python tracker 

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



[issue41659] PEG discrepancy on 'if {x} {a}: pass'

2020-10-27 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:


New changeset 15acc4eaba8519d7d5f2acaffde65446b44dcf79 by Lysandros Nikolaou in 
branch 'master':
bpo-41659: Disallow curly brace directly after primary (GH-22996)
https://github.com/python/cpython/commit/15acc4eaba8519d7d5f2acaffde65446b44dcf79


--

___
Python tracker 

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



[issue42099] Fix reference to ob_type in unionobject.c and ceval

2020-10-27 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 0564aafb71a153dd0aca4b9266dfae9336a4f2cb by Neil Schemenauer in 
branch 'master':
bpo-42099: Fix reference to ob_type in unionobject.c and ceval (GH-22829)
https://github.com/python/cpython/commit/0564aafb71a153dd0aca4b9266dfae9336a4f2cb


--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue6761] Class calling

2020-10-27 Thread Éric Araujo

Change by Éric Araujo :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.9 -Python 2.6, Python 2.7, Python 3.1, Python 
3.2, Python 3.6, Python 3.7

___
Python tracker 

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



[issue42099] Fix reference to ob_type in unionobject.c and ceval

2020-10-27 Thread Mark Shannon


Mark Shannon  added the comment:

Thanks Neil

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



[issue41659] PEG discrepancy on 'if {x} {a}: pass'

2020-10-27 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +21921
pull_request: https://github.com/python/cpython/pull/23006

___
Python tracker 

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



[issue42169] Apparently all documentation on @typing.overload is wrong

2020-10-27 Thread Peilonrayz


Peilonrayz  added the comment:

Thank you for the insight Guido. Sorry to be a bother everyone.

--
resolution: not a bug -> 
versions: +Python 3.6, Python 3.7

___
Python tracker 

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



[issue42151] Pure Python xml.etree.ElementTree is missing default attribute values

2020-10-27 Thread Felix C. Stegerman


Felix C. Stegerman  added the comment:

> specified_attributes = True is also set in xml.dom.expatbuilder.

That's good to know and should perhaps be addressed as well.

> Should not it be set to true in the C implementation of ElementTree?

That would break existing code.  Including mine.

I also think the current behaviour of the C implementation makes a lot more 
sense, especially as there is currently no way to request the alternative.

I think using specified_attributes=False as the default behaviour for both 
implementations is the best solution.  But I certainly would not oppose adding 
e.g. a keyword argument to override the default behaviour for those who would 
prefer the alternative.

--

___
Python tracker 

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



[issue41100] Build failure on macOS 11 (beta)

2020-10-27 Thread Misty De Méo

Change by Misty De Méo :


--
nosy: +mistydemeo
nosy_count: 11.0 -> 12.0
pull_requests: +21922
pull_request: https://github.com/python/cpython/pull/22732

___
Python tracker 

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



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

2020-10-27 Thread Stavros Macrakis


Stavros Macrakis  added the comment:

I agree completely that the documentation should be more explicit. The concept 
of "os.stat signature" is not defined anywhere as far as I can tell. The naive 
reader (like me) might mistakenly assume that the "os.stat signature" is a 
"digital signature" (i.e. a hash) of all of os.stat, and in particular that it 
includes the st_ino.

I would suggest that the documentation be updated to read "If shallow is true, 
files with the same length, modification time, and mode are taken to be equal."

--
nosy: +macrakis

___
Python tracker 

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



[issue41100] Build failure on macOS 11 (beta)

2020-10-27 Thread Lawrence D'Anna


Change by Lawrence D'Anna :


--
pull_requests: +21923
pull_request: https://github.com/python/cpython/pull/21246

___
Python tracker 

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Why did you put _PyLong_GetOne() inside the loop for the fast path and outside 
the loop for the slow path?


==
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index 8990071f51..0e6c64d1a6 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -2278,6 +2278,8 @@ _collections__count_elements_impl(PyObject *module, 
PyObject *mapping,
 PyObject *dict_get;
 PyObject *mapping_setitem;
 PyObject *dict_setitem;
+PyObject *zero = _PyLong_GetZero();  // borrowed reference
+PyObject *one = _PyLong_GetOne();// borrowed reference

 it = PyObject_GetIter(iterable);
 if (it == NULL)
@@ -2324,10 +2326,10 @@ _collections__count_elements_impl(PyObject *module, 
PyObject *mapping,
 if (oldval == NULL) {
 if (PyErr_Occurred())
 goto done;
-if (_PyDict_SetItem_KnownHash(mapping, key, _PyLong_GetOne(), 
hash) < 0)
+if (_PyDict_SetItem_KnownHash(mapping, key, one, hash) < 0)
 goto done;
 } else {
-newval = PyNumber_Add(oldval, _PyLong_GetOne());
+newval = PyNumber_Add(oldval, one);
 if (newval == NULL)
 goto done;
 if (_PyDict_SetItem_KnownHash(mapping, key, newval, hash) < 0)
@@ -2341,8 +2343,6 @@ _collections__count_elements_impl(PyObject *module, 
PyObject *mapping,
 if (bound_get == NULL)
 goto done;

-PyObject *zero = _PyLong_GetZero();  // borrowed reference
-PyObject *one = _PyLong_GetOne();  // borrowed reference
 while (1) {
 key = PyIter_Next(it);
 if (key == NULL)

--
nosy: +rhettinger

___
Python tracker 

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21924
pull_request: https://github.com/python/cpython/pull/23008

___
Python tracker 

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:

> Why did you put _PyLong_GetOne() inside the loop for the fast path and 
> outside the loop for the slow path?

Oh, I didn't notice that the first part was also a loop. I wrote PR 23008 to 
move the call out of the loop.

I tried to avoid calling the function if it's possible that the variable it not 
used. But here, it's always used, so it's relevant to move the loop invariant 
out of the loop ;-)

--

___
Python tracker 

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c310185c081110741fae914c06c7aaf673ad3d0d by Victor Stinner in 
branch 'master':
bpo-42161: Remove private _PyLong_Zero and _PyLong_One (GH-23003)
https://github.com/python/cpython/commit/c310185c081110741fae914c06c7aaf673ad3d0d


--

___
Python tracker 

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



[issue42169] Apparently all documentation on @typing.overload is wrong

2020-10-27 Thread Guido van Rossum


Change by Guido van Rossum :


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



[issue42177] Improving KeyError exception

2020-10-27 Thread Orian Zinger


New submission from Orian Zinger :

Hi all,

As a Python developer, I encountered lots of blurry exception messages in the 
product logs such as:
   Failed to do something. 
Exception: 'some key'

I believe printing the key name without explaining the exception itself is bad 
(explicit is better than implicit).

Thus, after forking the repository, I added a short explanation about the 
Exception.
Now, it looks like:

>>> try:
... {}['some key']
... except Exception as e:
... print(e)
... 
Missing key: some key

I'm a newbie in a contribution to CPython, so please let me know if the idea 
behind my commit is good. If not, please explain how can I improve my commit so 
it'll be pulled later to the main branch.

https://github.com/zingero/cpython/commit/8c9e5d9e16296cee1f3ec05638dd6989dae8b811

Regards,
Orian.

--
messages: 379801
nosy: zingero
priority: normal
severity: normal
status: open
title: Improving KeyError exception
type: enhancement

___
Python tracker 

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



[issue42096] zipfile.is_zipfile incorrectly identifying a gzipped file as a zip archive

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:

>  functions who's point is to be fast and not consume an amount of memory 
> determined by the input data

I proposed to read the first 4 bytes of the file. It's a fixed length.

--

___
Python tracker 

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



[issue42178] failed pickle hangs python on exit in CMD.exe only

2020-10-27 Thread Charles McMarrow


New submission from Charles McMarrow :

This bug only happens for me in Windows 10 when using cmd.exe. This bug does 
not happen IDLE. It sometimes happens in PowerShell. 

I ran mp_hang.py
with 
3.9.0 hangs on cmd/powershell
3.8.6 hangs on cmd
3.8.5 hangs on cmd/powershell
Microsoft Windows [Version 10.0.19041.572]

3.8.6 error
```
Traceback (most recent call last):
  File "", line 1, in 
  File 
"C:\Users\yoshi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\spawn.py",
 line 102, in spawn_main
source_process = _winapi.OpenProcess(
OSError: [WinError 87] The parameter is incorrect
```

--
components: Windows
files: mp_hang.py
messages: 379803
nosy: charles.mcmarrow.4, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: failed pickle hangs python on exit in CMD.exe only
type: crash
versions: Python 3.9
Added file: https://bugs.python.org/file49543/mp_hang.py

___
Python tracker 

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 35b95aaf21534e4a8e3370dfd6f7482265316c9e by Victor Stinner in 
branch 'master':
bpo-42161: Micro-optimize _collections._count_elements() (GH-23008)
https://github.com/python/cpython/commit/35b95aaf21534e4a8e3370dfd6f7482265316c9e


--

___
Python tracker 

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Raymond, I fixed the code.

I close the issue, I removed _PyLong_Zero and _PyLong_One variables.

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



[issue41805] types.GenericAlias and types.Union have no documentation

2020-10-27 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 4173320920706b49a004b8d7108e8984e3fc by kj in branch 'master':
bpo-41805: Documentation for PEP 585 (GH-22615)
https://github.com/python/cpython/commit/4173320920706b49a004b8d7108e8984e3fc


--
nosy: +gvanrossum

___
Python tracker 

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



[issue10663] configure shouldn't set a default OPT

2020-10-27 Thread Irit Katriel


Irit Katriel  added the comment:

I couldn't find a configure.in. Is this issue out of date?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue42176] Valgrind reports "Conditional jump or move depends on uninitialised value(s)" in `PyUnicode_AsEncodedString` and `PyUnicode_Decode`

2020-10-27 Thread Boris Staletic


Boris Staletic  added the comment:

I can also reproduce the same problem with the ubuntu packaged python3, which 
is 3.8.5 on Ubuntu 20.04. The only problem is that, with a stripped library, 
you don't get line numbers in valgrind's output. Steps to repro:

1. apt install valgrind gcc python3-config
2. Save the same attached file from the first comment as test.c.
3. gcc $(python3-config --includes) $(python3-config --ldflags) -lpython3.8 -o 
python-error
4. PYTHONMALLOC=malloc valgrind ./python-error

Valgrind output:

==1200== Conditional jump or move depends on uninitialised value(s)
==1200==at 0x4A7B37B: PyUnicode_Decode (in 
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==1200==by 0x109264: main (in /python-error)
==1200==
==1200== Conditional jump or move depends on uninitialised value(s)
==1200==at 0x4A7AE57: PyUnicode_AsEncodedString (in 
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==1200==by 0x109280: main (in /python-error)

I have not checked earlier versions of python.

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



[issue8943] Bug in InteractiveConsole /pickle

2020-10-27 Thread Irit Katriel


Change by Irit Katriel :


--
title: Bug in InteractiveConsole -> Bug in InteractiveConsole /pickle
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.1, Python 3.2

___
Python tracker 

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



[issue15029] doc: Update Defining New Types chapter according to PEP 253

2020-10-27 Thread Irit Katriel


Change by Irit Katriel :


--
title: Update Defining New Types chapter according to PEP 253 -> doc: Update 
Defining New Types chapter according to PEP 253
versions: +Python 3.10, Python 3.9 -Python 3.2

___
Python tracker 

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



[issue42171] Add PEP 573 to the stable ABI

2020-10-27 Thread Petr Viktorin


Change by Petr Viktorin :


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

___
Python tracker 

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



[issue42163] _replace() no longer works on platform.uname_result objects

2020-10-27 Thread Jason R. Coombs


Change by Jason R. Coombs :


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

___
Python tracker 

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



  1   2   >