[issue39944] UserString.join should return UserString

2020-03-12 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

This is not a duplicate: issue16397 concerned

   " ".join([US("a"), US("b")])

While this is concerned about the return value and acceptable parameters for 
UserString.join().

--

___
Python tracker 

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



[issue39944] UserString.join should return UserString

2020-03-12 Thread Dennis Sweeney


Change by Dennis Sweeney :


--
resolution: duplicate -> 
status: closed -> open

___
Python tracker 

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



[issue39944] UserString.join should return UserString

2020-03-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

You are right. Sorry.

--
stage: resolved -> patch review
superseder: UserString doesn't combine nicely with strings -> 

___
Python tracker 

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



[issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base

2020-03-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset ab9c72912178cfdb4d0637be036d78913b769154 by Serhiy Storchaka in 
branch '3.8':
[3.8] bpo-38643: Raise SystemError instead of crashing when PyNumber_ToBase is 
called with invalid base. (GH-18863). (GH-18954)
https://github.com/python/cpython/commit/ab9c72912178cfdb4d0637be036d78913b769154


--

___
Python tracker 

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



[issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base

2020-03-12 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +18306
pull_request: https://github.com/python/cpython/pull/18955

___
Python tracker 

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



[issue39884] "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug

2020-03-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c7d2d69d95b263ee5f83511bc6fbe53acdc24ea3 by Victor Stinner in 
branch 'master':
bpo-39884: Add method name in "bad call flags" error (GH-18944)
https://github.com/python/cpython/commit/c7d2d69d95b263ee5f83511bc6fbe53acdc24ea3


--

___
Python tracker 

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



[issue39884] "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug

2020-03-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18307
pull_request: https://github.com/python/cpython/pull/18956

___
Python tracker 

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



[issue39884] "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug

2020-03-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18308
pull_request: https://github.com/python/cpython/pull/18957

___
Python tracker 

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



[issue39944] UserString.join should return UserString

2020-03-12 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This API is very old and doesn't seem to have a caused any issues in practice.  
Changing the API now is more likely to break existing code than to help anyone 
in the future.

--

___
Python tracker 

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



[issue39944] UserString.join should return UserString

2020-03-12 Thread Dennis Sweeney


Change by Dennis Sweeney :


--
resolution:  -> wont fix
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



[issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base

2020-03-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 6f4e7fcfca6923d0422b20fc8702240bd4e56ebd by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-38643: Raise SystemError instead of crashing when PyNumber_ToBase is 
called with invalid base. (GH-18863). (GH-18955)
https://github.com/python/cpython/commit/6f4e7fcfca6923d0422b20fc8702240bd4e56ebd


--

___
Python tracker 

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



[issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base

2020-03-12 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue38744] python 3.8 hang in multiprocessing.Pool() locking on FreeBSD / Linux

2020-03-12 Thread Arkadiusz Miskiewicz Arkadiusz Miskiewicz


Arkadiusz MiskiewiczArkadiusz Miskiewicz 
 added the comment:

That test program hangs even on Linux (kernel 4.9.184, glibc 2.30):


$ python3 a.py
Process ForkPoolWorker-13:
Process ForkPoolWorker-12:
Process ForkPoolWorker-16:
Process ForkPoolWorker-15:
Process ForkPoolWorker-11:
Process ForkPoolWorker-6:
Process ForkPoolWorker-7:
Process ForkPoolWorker-14:
Process ForkPoolWorker-5:
Process ForkPoolWorker-2:
Process ForkPoolWorker-10:
Process ForkPoolWorker-3:
Process ForkPoolWorker-8:
Process ForkPoolWorker-1:
Process ForkPoolWorker-4:
Exception ignored in: 
Traceback (most recent call last):
  File "/usr/lib64/python3.8/multiprocessing/util.py", line 201, in __call__
res = self._callback(*self._args, **self._kwargs)
  File "/usr/lib64/python3.8/multiprocessing/pool.py", line 689, in 
_terminate_pool
Process ForkPoolWorker-9:
cls._help_stuff_finish(inqueue, task_handler, len(pool))
  File "/usr/lib64/python3.8/multiprocessing/pool.py", line 674, in 
_help_stuff_finish
inqueue._rlock.acquire()
KeyboardInterrupt:

$ python3 --version
Python 3.8.2

--
nosy: +arekm
title: python 3.8 hang in multiprocessing.Pool() locking on FreeBSD -> python 
3.8 hang in multiprocessing.Pool() locking on FreeBSD / Linux

___
Python tracker 

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



[issue39945] Wrong example result in docs

2020-03-12 Thread Tomas Hak

New submission from Tomas Hak :

Step to reproduce:
Open page: https://docs.python.org/3/library/sched.html

Location: Documentation : sched — Event scheduler 

Description:
In the text is definition of priority: "Events scheduled for the same time will 
be executed in the order of their priority. A lower number represents a higher 
priority."

I assume it is correct, but example shows different behavior. There are 
scheduled two events with priority two and one. In print on the end of example, 
they are in wrong order :
Code:
s.enter(5, 2, print_time, argument=('positional',))
s.enter(5, 1, print_time, kwargs={'a': 'keyword'}) 

Current Result:
>From print_time 930343695.274 positional
>From print_time 930343695.275 keyword

Expected result:
>From print_time 930343695.274 keyword
>From print_time 930343695.275 positional

Conclusion :
I tested the example code and it gave me expected result in order 
"keyword","positional"

--
assignee: docs@python
components: Documentation
messages: 364004
nosy: docs@python, hook
priority: normal
severity: normal
status: open
title: Wrong example result in docs
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



[issue39945] Wrong example result in docs

2020-03-12 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This seems to be a duplicate of issue28297 and issue34677.

--
nosy: +xtreak

___
Python tracker 

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



[issue34305] inspect.getsourcefile and inspect.getcomments do not work with decorated functions

2020-03-12 Thread Eric Wieser


Eric Wieser  added the comment:

Nothing holding it up from my end, just waiting on someone to review it. 
Perhaps this ping will help with that.

--
nosy: +Eric Wieser

___
Python tracker 

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



[issue39945] Wrong example result in docs

2020-03-12 Thread Tomas Hak


Tomas Hak  added the comment:

I agree, it is duplicate.

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Petr Viktorin


Petr Viktorin  added the comment:

> So I vote for not handling incorrectly packed values and removing
"and any non-zero value will be True when unpacking" from the docs,
which does not seem to make any sense for _Bool.

I disagree. I don't think struct module's job is to be faithful to _Bool 
semantics.

Up to this point, "?" worked for bytes with "only 0 is false" semantics, in a 
reliable and documented way. I don't see a reason to let that continue.

You're right about trap representations, but IMO floats are much more tied to 
hardware (and serious users of float are aware of the pitfalls), while _Bool 
semantics are governed by the whims of the compiler.

Also, the "@" prefix is specifically documented to select native Byte order, 
Size, and Alignment; not how the bit-pattern is interpreted.

--

___
Python tracker 

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



[issue38500] PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API (Python 3.8 regression)

2020-03-12 Thread Mark Shannon


Mark Shannon  added the comment:

I'm not suggesting immediate removal of PEP 532.

I am requesting that you don't add a new function to the C API that will 
prevent implementation of many meaningful optimizations to CPython.
PEP 532 does not add any API functions.

I understand that you want to fix the regression.
Why not do so by reverting the change that caused it?

Adding a new API function is not fixing a regression.

--

___
Python tracker 

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



[issue39920] os.lstat() does not work with Window Dos devices

2020-03-12 Thread Eryk Sun


Eryk Sun  added the comment:

> This is an os.lstat() limitation, nothing to do with pathlib.

In 3.8+, stat() and lstat() work with a broader rang of device paths, at least 
for st_mode checks. For example:

>>> s = os.stat('//./PhysicalDrive0')
>>> stat.S_ISBLK(s.st_mode)
True

The problem is pathlib. It handles device paths improperly, such as normalizing 
'//./PhysicalDrive0' to add a trailing backslash. For example:

>>> p = Path('//./PhysicalDrive0')
>>> os.fspath(p)
'.\\PhysicalDrive0\\'

Issue 33898 covers the issue in more detail and has a pending PR. IMO, the PR 
needs work (e.g. correct handling of repeated slashes in UNC and device paths, 
IIRC). It doesn't have many people clamoring for a fix and stepping up to help. 
I'll try to get back to it soon -- when I'm up to it.

---

**Discussion of the observed error**

"\\.\PhysicalDrive" is an object symlink to a native Device object [1] that 
represents a physical disk device. Typically the native path is something like 
"\Device\Harddisk\DR". This is aliased as 
"\Device\Harddisk\Partition0", i.e. the 0th partition is the entire disk. A 
fixed disk will be partitioned into one or more volume devices such as 
"\Device\HarddiskVolume". Note that native volume device paths are 
transient, depending on PNP device removal and insertion. To work around this, 
the Mountpoint Manager maps the native path to a persistent "Volume{GUID}" 
name, and usually also a persistent DOS drive name such as "X:".

Disk and volume devices have a Volume Parameter Block (VPB) [2], which allows a 
filesystem device to mount them. The filesystem device manages the device 
namespace and acts as a proxy when accessing the device. In contrast, other 
device types have no VPB and thus directly manage their own namespace. (A 
device may implement full or partial support for filesystem functionality, 
without being mounted, such as "\\.\PIPE", i.e. "\Device\NamedPipe".) 

The VPB of a disk device is flagged VPB_RAW_MOUNT, which restricts it to the 
RAW filesystem. (A volume device that isn't formatted or doesn't have a 
recognizable filesystem will also use RAW.) The RAW filesystem device supports 
no namespace. Any remaining path, including a root path, fails with 
STATUS_INVALID_PARAMETER (0xC000_000D), i.e. Windows ERROR_INVALID_PARAMETER 
(87). 

In order to observe this error condition in action, the disk device has to 
first be mounted by RAW. This is possible with a Direct Access Storage Device 
(DASD) open, for which there is no remaining path and which requests more than 
just reading device metadata (attributes, security), such as requesting data 
access. 

The OP sees a different error because the disk isn't already mounted. This 
short circuits to the default result of STATUS_UNSUCCESSFUL (0xC000_0001), i.e. 
Windows ERROR_GEN_FAILURE (31). 

Here's an example to clarify the behavior.

In this first case, the VPB isn't mounted yet by RAW, and mounting fails since 
the device path includes a remaining path (i.e. a single trailing "/"):

>>> try: os.stat('//./PhysicalDrive0/')
... except OSError as e: print(e)
...
[WinError 31] A device attached to the system is not functioning


If one first mounts the disk with RAW by way of a DASD open, then subsequently 
one sees the expected invalid parameter error for a non-DASD open:

>>> f = open('//./PhysicalDrive0', 'rb')

>>> try: os.stat('//./PhysicalDrive0/')
... except OSError as e: print(e)
...
[WinError 87] The parameter is incorrect: '//./PhysicalDrive0/'


[1]: 
https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/ns-wdm-_device_object
[2]: 
https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/ns-wdm-_vpb

--

___
Python tracker 

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



[issue39761] Python 3.9.0a4 fails to build when configured with --with-dtrace

2020-03-12 Thread Petr Viktorin


Change by Petr Viktorin :


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



[issue38893] broken container/selinux integration

2020-03-12 Thread Christian Heimes


Christian Heimes  added the comment:

No, CPython's stdlib doesn't use libselinux.

I talked to an engineer from Red Hat's SELinux team today. SELinux returns 
EACCES for policy violations like in this case. The _copyxattr() helper 
function ignores EPERM but not EACCES. You are seeing a PermissionError 
exception because Python maps both EPERM and EACCES to PermissionError.

As first fix the _copyxattr() helper could ignore all permission errors for 
"security.*" namespace and just continue. This will get rid of the error but 
may still cause lots of AVC audit events.

A better but backwards incompatible approach is to handle the xattr namespaces 
differently. Linux defines four xattr namespaces: security, system, trusted, 
and user. The security namespace is used by security policies like Smack or 
SELinux. IMHO _copyxattr() should only copy user xattrs by default. The 
security namespace should only be copied when the caller opts-in. The cp tool 
has separate preserve settings for context (SELinux security context) and xattr 
(other extended attributes).

--

___
Python tracker 

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



[issue39884] "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug

2020-03-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 03ac090c5f8d5b281e56c5f5431c1754fd4efe5c by Victor Stinner in 
branch '3.8':
bpo-39884: Add method name in "bad call flags" error (GH-18944) (GH-18956)
https://github.com/python/cpython/commit/03ac090c5f8d5b281e56c5f5431c1754fd4efe5c


--

___
Python tracker 

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



[issue39884] "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug

2020-03-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 6a12676b1910d52c85561bdf4f1e20aa13fc8f46 by Victor Stinner in 
branch '3.7':
bpo-39884: Add method name in "bad call flags" error (GH-18944) (GH-18957)
https://github.com/python/cpython/commit/6a12676b1910d52c85561bdf4f1e20aa13fc8f46


--

___
Python tracker 

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



[issue39884] "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug

2020-03-12 Thread STINNER Victor


STINNER Victor  added the comment:

> While the issues definitely need to be resolved in the C extensions, where to 
> start is not completely clear. I had to put `printfs` in PyCFunction_NewEx 
> and PyDescr_NewMethod to track down the issues, e.g., (...)

I agree, I had the same issue :-) I fixed the issue in 3.7, 3.8 and master 
branches.

In 3.7, the modified functions are different and the error message was 
different but similar.

Thanks for your bug report ;-)

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7, Python 3.9

___
Python tracker 

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



[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2020-03-12 Thread STINNER Victor


STINNER Victor  added the comment:

FYI I modified SystemError("bad call flags") error message to include the 
method name in bpo-39884.

--

___
Python tracker 

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



[issue39938] RotatingFileHandler does not support any mode other than 'a'.

2020-03-12 Thread Vinay Sajip


Vinay Sajip  added the comment:

> supplying a mode to append bytes is not supported

That is correct, log files supported by standard library handlers are text 
files using some supported encoding. If you need to store arbitrary bytes 
directly in a log file, feel free to write your own handlers to do it.

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



[issue38500] PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API (Python 3.8 regression)

2020-03-12 Thread STINNER Victor


STINNER Victor  added the comment:

> Why not do so by reverting the change that caused it?

Making PyInterpreterState structure private was motivated by the 
subinterpreters work but also by the work on cleaning the C API.

Over time, PyInterpreterState became more and more complex because many other 
structures have been moved there. For example, the GIL, GC state, warnings 
state, parser state, etc.

I would really avoid exposing the GIL state in the C API since it uses the 
"pycore_atomic.h" header which caused a *lot* of compiler errors in the past. 
Most errors were on including the header file, even if the C extension didn't 
use any atomic variable.

I'm really happy that we managed to move atomic variables into the internal C 
API: we got less error coming from that. I'm strongly opposed to move 
PyInterpreterState structure back into the Include/cpython/ C API. That would 
be a big mistake for various reasons.

Even in CPython, pycore_pystate.h is causing a lot of troubles since 
PyInterpreterState became very complex. Example in posixmodule.c:
---
#include "Python.h"
#ifdef MS_WINDOWS
   /* include  early to avoid conflict with pycore_condvar.h:

#define WIN32_LEAN_AND_MEAN
#include 

  FSCTL_GET_REPARSE_POINT is not exported with WIN32_LEAN_AND_MEAN. */
#  include 
#endif

#include "pycore_ceval.h" /* _PyEval_ReInitThreads() */
#include "pycore_import.h"/* _PyImport_ReInitLock() */
#include "pycore_pystate.h"   /* _PyRuntime */
---

pycore_condvar.h is used by the GIL state.

--

___
Python tracker 

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



[issue39577] venv --prompt argument is ignored

2020-03-12 Thread Vinay Sajip


Vinay Sajip  added the comment:

> My question at this stage is, where is this "Prompt" variable set?

If you mean the VIRTUAL_ENV variable, it's set in one of the activation scripts 
for the venv. In any case, this doesn't look it it's a problem with venv code, 
more to do with your local environment. So I'll close this issue.

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



[issue26660] tempfile.TemporaryDirectory() cleanup exception if nonwriteable or non-searchable files or directories created

2020-03-12 Thread Vidar Fauske


Vidar Fauske  added the comment:

Seems as if this was resolved by the linked PR in 3.8, or am I missing 
something?

--
nosy: +vidartf

___
Python tracker 

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



[issue39939] Add str methods to remove prefixes or suffixes

2020-03-12 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

To be clear, are you only making a copy of the unchanged object if it is a 
mutable bytearray, not str or bytes?

--
nosy: +steven.daprano

___
Python tracker 

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



[issue39277] _PyTime_FromDouble() fails to detect an integer overflow when converting a C double to a C int64_t

2020-03-12 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, clang on FreeBSD spotted a similar bug in float.__trunc__()!

static PyObject *
float___trunc___impl(PyObject *self)
/*[clinic end generated code: output=dd3e289dd4c6b538 input=591b9ba0d650fdff]*/
{
double x = PyFloat_AsDouble(self);
double wholepart;   /* integral portion of x, rounded toward 0 */

(void)modf(x, &wholepart);
/* Try to get out cheap if this fits in a Python int.  The attempt
 * to cast to long must be protected, as C doesn't define what
 * happens if the double is too big to fit in a long.  Some rare
 * systems raise an exception then (RISCOS was mentioned as one,
 * and someone using a non-default option on Sun also bumped into
 * that).  Note that checking for >= and <= LONG_{MIN,MAX} would
 * still be vulnerable:  if a long has more bits of precision than
 * a double, casting MIN/MAX to double may yield an approximation,
 * and if that's rounded up, then, e.g., wholepart=LONG_MAX+1 would
 * yield true from the C expression wholepart<=LONG_MAX, despite
 * that wholepart is actually greater than LONG_MAX.
 */
if (LONG_MIN < wholepart && wholepart < LONG_MAX) {  /* <=== HERE */
const long aslong = (long)wholepart;
return PyLong_FromLong(aslong);
}
return PyLong_FromDouble(wholepart);
}


Objects/floatobject.c:881:45: warning: implicit conversion from 'long' to 
'double' changes value from 9223372036854775807 to 9223372036854775808
  [-Wimplicit-int-float-conversion]
if (LONG_MIN < wholepart && wholepart < LONG_MAX) {
  ~ ^~~~
/usr/include/sys/limits.h:64:18: note: expanded from macro 'LONG_MAX'
#define LONG_MAX__LONG_MAX  /* max for a long */
^~
/usr/include/x86/_limits.h:64:20: note: expanded from macro '__LONG_MAX'
#define __LONG_MAX  0x7fff  /* max for a long */
^~
1 warning generated.

--

___
Python tracker 

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



[issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount()

2020-03-12 Thread And Clover


Change by And Clover :


--
pull_requests: +18309
pull_request: https://github.com/python/cpython/pull/18959

___
Python tracker 

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



[issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount()

2020-03-12 Thread miss-islington


miss-islington  added the comment:


New changeset feaf0c37891dfe8f0f3e643c3711af3af23bf805 by bobince in branch 
'3.7':
[3.7] bpo-39847: EnterNonRecursiveMutex() uses GetTickCount64() (GH-18780) 
(GH-18959)
https://github.com/python/cpython/commit/feaf0c37891dfe8f0f3e643c3711af3af23bf805


--

___
Python tracker 

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



[issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount()

2020-03-12 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks, it's now fixed in 3.7, 3.8 and master branches.

Python 3.5 and 3.6 don't get bugfixes anymore: 
https://devguide.python.org/#status-of-python-branches

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9 -Python 3.5, Python 3.6

___
Python tracker 

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



[issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE

2020-03-12 Thread Roundup Robot


Change by Roundup Robot :


--
nosy: +python-dev
nosy_count: 24.0 -> 25.0
pull_requests: +18310
pull_request: https://github.com/python/cpython/pull/18960

___
Python tracker 

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



[issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE

2020-03-12 Thread miss-islington

miss-islington  added the comment:


New changeset 3c29675d8736cb1860f342d872ae41e342c6d383 by Raúl Cumplido in 
branch 'master':
bpo-1294959: Fix typo for new attribute platlibdir. (GH-18960)
https://github.com/python/cpython/commit/3c29675d8736cb1860f342d872ae41e342c6d383


--

___
Python tracker 

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Stefan Krah


Stefan Krah  added the comment:

The docs for native mode (we now always assume C99):

"The '?' conversion code corresponds to the _Bool type defined by C99."


The memoryview tests that fail are essentially auto-generated and not
prescriptive. They just happened to work without UBSan:


>>> x = array.array("B", [0,1,2,3])
>>> m = memoryview(x)
>>> m.format
'B'
>>> c = m.cast("?") # Wrong!
>>> c.tolist()
[False, True, True, True]


I don't see the point in working around UB for the purposes of
displaying the wrong cast.

If you do subsequent array operations with the variable "c", UB will happen 
there.



In theory you can do the same with a cast from unsigned to signed
integers. Signed integers are allowed to be trap representations,
though I don't know an actual platform where this is the case.

--

___
Python tracker 

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Petr Viktorin


Petr Viktorin  added the comment:

> The docs for native mode (we now always assume C99):
>
> "The '?' conversion code corresponds to the _Bool type defined by C99."

But, nowhere is it suggested that conversion is "do memcpy and then interpret 
the bit pattern". That is pretty weird way to convert values in C; it seems to 
me that it's only a hack to avoid unaligned access.
IMO, casting is a more natural way to convert values. And casting to _Bool 
coerces the value to 0 or 1.

--

___
Python tracker 

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Stefan Krah


Stefan Krah  added the comment:

The memcpy() is NOT a hack and performs exactly the same operation
as casting the pointer and then dereferencing, only in a manner that
avoids unaligned accesses.

On platforms like x86 the memcpy() is optimized to a simple assignment.

Casting the pointer and then dereferencing would also be subject
to the UB warnings.


You are the one who wanted to *introduce* a hack by dereferencing
as char and then cast to _Bool. :-)

--

___
Python tracker 

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



[issue39939] Add str methods to remove prefixes or suffixes

2020-03-12 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Yes:

>>> x = "A"*10**6
>>> x.cutprefix("B") is x
True
>>> x.cutprefix("") is x
True

>>> y = b"A"*10**6
>>> y.cutprefix(b"B") is y
True
>>> y.cutprefix(b"") is y
True

>>> z = bytearray(b"A")*10**6
>>> z.cutprefix(b"B") is z
False
>>> z.cutprefix(b"") is z
False

I'm not sure whether this should be part of the spec or an implementation 
detail. The (str/bytes).replace method docs don't clarify this, but they have 
the same behavior:

>>> x = "A"*10**6
>>> x.replace("B", "C") is x
True
>>> x.replace("", "") is x
True

>>> y = b"A"*10**6
>>> y.replace(b"B", b"C") is y
True
>>> y.replace(b"", b"") is y
True

>>> z = bytearray(b"A")*10**6
>>> z.replace(b"B", b"C") is z
False
>>> z.replace(b"", b"") is z
False

--

___
Python tracker 

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



[issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll

2020-03-12 Thread miss-islington


miss-islington  added the comment:


New changeset 35ae5d916c6c2e9f211666a3a97965be3d2977ae by Miss Islington (bot) 
in branch '3.8':
bpo-39930: Fix MSBuild detection for Build Tools (GH-18938)
https://github.com/python/cpython/commit/35ae5d916c6c2e9f211666a3a97965be3d2977ae


--

___
Python tracker 

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



[issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll

2020-03-12 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +18311
pull_request: https://github.com/python/cpython/pull/18962

___
Python tracker 

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



[issue38500] PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API (Python 3.8 regression)

2020-03-12 Thread STINNER Victor


STINNER Victor  added the comment:

For me, the *short term* goal is to find a way to limit the number of broken C 
extension module while we modify the C API to make it more opaque.

We cannot reach all goals at once (opaque C API, subinterpreter, more 
optimizations, etc). We have to move step by step.

For me it's ok to deprecate or even remove 
PyInterpreterState_SetEvalFrameFunc() later, once we will have a good reason 
for that.

I'm also ok with having an alternative Python implementation which doesn't 
support PyInterpreterState_SetEvalFrameFunc(). Users would be able to make a 
choice: faster Python without PyInterpreterState_SetEvalFrameFunc(), or regular 
"slow" Python with PyInterpreterState_SetEvalFrameFunc(). That's part of my 
larger https://pythoncapi.readthedocs.io/ goal: the ability to use different 
Python "runtimes".

>From what I understood, to be able to provide multiple Python runtimes, we 
>have first to "fix" the C API. The HPy project is another approach to this 
>problem. Making the C API opaque makes CPython closer to this goal.

--

___
Python tracker 

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



[issue39946] Is it time to remove _PyThreadState_GetFrame() hook?

2020-03-12 Thread STINNER Victor


New submission from STINNER Victor :

Python has an internal function to get the frame of the PyThreadState:

/* hook for PyEval_GetFrame(), requested for Psyco */
#define _PyThreadState_GetFrame _PyRuntime.gilstate.getframe

It is used by the public function PyEval_GetFrame() for example.


The indirection was added in 2002 by:

commit 019a78e76d3542d4d56a08015e6980f8c8aeaba1
Author: Michael W. Hudson 
Date:   Fri Nov 8 12:53:11 2002 +

Assorted patches from Armin Rigo:

[ 617309 ] getframe hook (Psyco #1)
[ 617311 ] Tiny profiling info (Psyco #2)
[ 617312 ] debugger-controlled jumps (Psyco #3)

These are forward ports from 2.2.2.


... but psyco is outdated for a very long time (superseded by PyPy which is no 
longer based on CPython). Is it time to drop _PyThreadState_GetFrame() (which 
became _PyRuntime.gilstate.getframe in the meanwhile)?

Or if we keep it, we should use it rather accessing directly 
PyThreadState.frame (read or write).

See also PEP 523 "Adding a frame evaluation API to CPython" and a recent 
discussion on this PEP: bpo-38500.

--
components: Interpreter Core
messages: 364031
nosy: vstinner
priority: normal
severity: normal
status: open
title: Is it time to remove _PyThreadState_GetFrame() hook?
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



[issue39946] Is it time to remove _PyThreadState_GetFrame() hook?

2020-03-12 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +Mark.Shannon, brett.cannon

___
Python tracker 

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



[issue38500] PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API (Python 3.8 regression)

2020-03-12 Thread STINNER Victor


STINNER Victor  added the comment:

Somehow related, I just created bpo-39946: "Is it time to remove 
_PyThreadState_GetFrame() hook?".

--

___
Python tracker 

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



[issue31727] FTP_TLS errors when use certain subcommands

2020-03-12 Thread Jonathan Castro


Jonathan Castro  added the comment:

I had the same problem but when i was trying to upload the files using FTPS 
with explicit TLS 1.2 over an AWS Lambda function.
Each time that i was trying upload a file, there was an lambda timeout on the 
storbinary called, and the function ended whit error on each execution.
Finally the only solution that i founded, to solve this issue, was:

1- It using a threading to do the storebinary process.
2- Put an sleep depending do File size.
3- After the sleep function, it using ftplib.dir.

--
nosy: +unixjon

___
Python tracker 

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



[issue39947] Move PyThreadState structure to the internal C API

2020-03-12 Thread STINNER Victor

New submission from STINNER Victor :

Python 3.8 moved PyInterpreterState to the internal C API (commit 
be3b295838547bba267eb08434b418ef0df87ee0 of bpo-35886)... which caused 
bpo-38500 issue.

In Python 3.9, I provided Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() 
as regular functions for the limited API: commit 
f4b1e3d7c64985f5d5b00f6cc9a1c146bbbfd613 of bpo-38644. Previously, there were 
defined as macros, but these macros didn’t compile with the limited C API which 
cannot access PyThreadState.recursion_depth field (the structure is opaque in 
the limited C API).

That's an enhancement for the limited C API, but PyThreadState is still exposed 
to the "cpython" C API (Include/cpython/).


We should prepare the C API to make the PyThreadState structure opaque. It 
cannot be done at once, there are different consumers of the PyThreadState 
structure. In CPython code base, I found:

* Py_TRASHCAN_BEGIN_CONDITION and Py_TRASHCAN_END macros access 
tstate->trash_delete_nesting field. Maybe we can hide these implementation 
details into new private function calls.

* faulthandler.c: faulthandler_py_enable() reads tstate->interp. We should 
maybe provide a getter function.

* _tracemalloc.c: traceback_get_frames() reads tstate->frame. We should maybe 
provide a getter function.

* Private _Py_EnterRecursiveCall() and _Py_LeaveRecursiveCall() access 
tstate->recursion_depth. One solution is to move these functions to the 
internal C API.


faulthandler and _tracemalloc are low-level debugging C extensions. Maybe it's 
ok for them to use the internal C API. But they are examples of C extensions 
accessing directly the PyThreadState structure.


See also bpo-39946 "Is it time to remove _PyThreadState_GetFrame() hook?" about 
PyThreadState.frame.

--
components: C API
messages: 364034
nosy: vstinner
priority: normal
severity: normal
status: open
title: Move PyThreadState structure to the internal C API
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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-12 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +Mark.Shannon, eric.snow
title: Move PyThreadState structure to the internal C API -> Make the 
PyThreadState structure opaque (move it to the internal C API)

___
Python tracker 

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



[issue38500] PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API (Python 3.8 regression)

2020-03-12 Thread STINNER Victor


STINNER Victor  added the comment:

Mark Shannon: `PyThreadState` is an internal opaque data structure, which means 
we are free to change it.

I guess that you mean PyInterpreterState which was moved to the internal C API 
in Python 3.8. It was part of public C API in Python 3.7. See commit 
be3b295838547bba267eb08434b418ef0df87ee0 of bpo-35886.

By the way, I just created bpo-39947: "Make the PyThreadState structure opaque 
(move it to the internal C API)".

--

___
Python tracker 

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



[issue38500] PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API (Python 3.8 regression)

2020-03-12 Thread STINNER Victor


STINNER Victor  added the comment:

Mark:
> PEP 523 is quite vague, but the rationale indicates that exposing 
> `eval_frame` is for "a method-level JIT". PEP 523 did not suggest adding an 
> API.

I disagree, the PEP is quite explicit: "Third-party code may then set their own 
frame evaluation function instead to control the execution of Python code." 
That's the whole point of the PEP: let third-party code set eval_frame to use 
the feature.

The PEP was written in 2016, when the PyInterpreterState structure was part of 
the public C API. But PyInterpreterState was moved to the internal C API, after 
the PEP was approved.

--

___
Python tracker 

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Stefan Krah


Change by Stefan Krah :


--
pull_requests: +18312
pull_request: https://github.com/python/cpython/pull/18964

___
Python tracker 

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



[issue39936] Python fails to build _asyncio on module on AIX

2020-03-12 Thread Michael Felt


Michael Felt  added the comment:

re: Michael: this issue is about bootstraping Python. If you want to test a 
patch or test something else, you must restart from a clean copy of the source 
code. Either use "make distclean", "git clean -fdx", or recreate the source 
directory (git clone, decompress an archive, etc.). Then restart from scratch: 
./configure && make.

Understood: between these two timestamps: Date: 2020-03-11 18:55 and Date: 
2020-03-11 21:36 - I was doing just that on 4 different VM's: AIX 5.3, 6.1, 7.1 
and 7.2 - just in case there may be anything specific re: AIX versions (the 
bots run on AIX 7.1 and 7.2). I also switched away from any NFS based builds 
because test behaves differently when the build area is an NFS area compared to 
jfs2.

FYI: I have decided to focus on AIX 7.1 and AIX 7.2 - and am only using gcc (I 
was also testing runs with both xlc and gcc before I started posting).

Further, I like your suggestion to try: subprocess except _bootsubprocess and 
shall make a PR to that end. Much more clear about what is going on.

What I am going to do bewtween now and my next post is again - clean slate - 
update master to latest version - on two servers.

On one server I'll apply your suggestion to _aix_platform.py; on the other I'll 
patch Lib/distutils/util.py and Lib/sysconfig.py to not even call 
_aix_platform.py. Ideally, there will be a difference that leads to an 
understanding of the root cause.

--

___
Python tracker 

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Stefan Krah


Stefan Krah  added the comment:


New changeset 1ae9cde4b2323235b5f9ff4bc76e4175a2257172 by Stefan Krah in branch 
'master':
bpo-39689: Do not test undefined casts to _Bool (GH-18964)
https://github.com/python/cpython/commit/1ae9cde4b2323235b5f9ff4bc76e4175a2257172


--

___
Python tracker 

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18314
pull_request: https://github.com/python/cpython/pull/18966

___
Python tracker 

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 9.0 -> 10.0
pull_requests: +18313
pull_request: https://github.com/python/cpython/pull/18965

___
Python tracker 

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



[issue39924] pathlib handles missing `os.link`, `os.symlink` and `os.readlink` inconsistently

2020-03-12 Thread Manjusaka


Manjusaka  added the comment:

I don't think rename 'link_to'  to 'link' directly is a good idea. Because 
there are many third-party libs have used this name. Unless we can keep two 
names in this version, and remind people the 'link_to' function will be 
deprecated totally in a future version. But is there any way to make a function 
as deprecated?

About 'os.readlink', we can hide this function in the platform that doesn't 
support readlink() just like `epoll' in mac or etc.

--
nosy: +Manjusaka

___
Python tracker 

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



[issue39924] pathlib handles missing `os.link`, `os.symlink` and `os.readlink` inconsistently

2020-03-12 Thread Manjusaka


Manjusaka  added the comment:

But when will os.readlink() be unavailable?

--

___
Python tracker 

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



[issue39924] pathlib handles missing `os.link`, `os.symlink` and `os.readlink` inconsistently

2020-03-12 Thread Manjusaka


Manjusaka  added the comment:

Fine, I get your means

--

___
Python tracker 

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Stefan Krah


Stefan Krah  added the comment:


New changeset 636eecc16229432ec8e26e6da287c52f3ca3 by Miss Islington (bot) 
in branch '3.7':
bpo-39689: Do not test undefined casts to _Bool (GH-18964) (#18965)
https://github.com/python/cpython/commit/636eecc16229432ec8e26e6da287c52f3ca3


--

___
Python tracker 

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Stefan Krah


Stefan Krah  added the comment:


New changeset f8ce3e2dae277baa2ef92e8a3e935953dc6c3f39 by Miss Islington (bot) 
in branch '3.8':
bpo-39689: Do not test undefined casts to _Bool (GH-18964) (#18966)
https://github.com/python/cpython/commit/f8ce3e2dae277baa2ef92e8a3e935953dc6c3f39


--

___
Python tracker 

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Stefan Krah


Stefan Krah  added the comment:

memoryview only supports the native format, so I've disabled the
(wrong) test that casts arrays with arbitrary values to _Bool. So
memoryview is done.


IMO the problem in _struct is that it swaps the x->unpack function
for the native one, which does not seem right for _Bool:

/* Scan through the native table, find a matching
   entry in the endian table and swap in the
   native implementations whenever possible
   (64-bit platforms may not have "standard" sizes) */

If one disables that swap, the tests pass here.

--

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-03-12 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +18315
pull_request: https://github.com/python/cpython/pull/18967

___
Python tracker 

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



[issue39562] Asynchronous comprehensions don't work in asyncio REPL

2020-03-12 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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

___
Python tracker 

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



[issue39936] Python fails to build _asyncio on module on AIX

2020-03-12 Thread Michael Felt


Michael Felt  added the comment:

The good news! Your patch, better rewrite, of _aix_platform.py is working!

Many thanks!

--

___
Python tracker 

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



[issue24119] Carry comments with the AST

2020-03-12 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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Stefan Krah


Change by Stefan Krah :


--
pull_requests: +18317
pull_request: https://github.com/python/cpython/pull/18969

___
Python tracker 

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



[issue38500] PEP 523: Add private _PyInterpreterState_SetEvalFrameFunc() function to the C API (Python 3.8 regression)

2020-03-12 Thread STINNER Victor


Change by STINNER Victor :


--
title: PEP 523: Add PyInterpreterState_SetEvalFrameFunc() to the public C API 
(Python 3.8 regression) -> PEP 523: Add private 
_PyInterpreterState_SetEvalFrameFunc() function to the C API (Python 3.8 
regression)

___
Python tracker 

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



[issue38500] PEP 523: Add private _PyInterpreterState_SetEvalFrameFunc() function to the C API (Python 3.8 regression)

2020-03-12 Thread STINNER Victor


STINNER Victor  added the comment:

I took Mark's concerns in account and I updated my PR to only add *private* 
functions to the C API, not *public* functions.

--

___
Python tracker 

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



[issue38500] PEP 523: Add private _PyInterpreterState_SetEvalFrameFunc() function to the C API (Python 3.8 regression)

2020-03-12 Thread STINNER Victor


STINNER Victor  added the comment:

Mark: Would you mind to open a separated issue for your following idea?

> I propose a new method on code objects `withCallAtLine(callable: Callable[], 
> line:int)` which returns a new code object with calls to the given callable 
> at the given line.
> A breakpoint can then be inserted at line L in function f with `f.__code__ = 
> f.__code__.withCallAtLine(sys.breakpoint, L)`.

I prefer to restrict this issue to the PEP 523.

--

___
Python tracker 

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



[issue39936] Python fails to build _asyncio on module on AIX

2020-03-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18318
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18970

___
Python tracker 

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



[issue39936] Python fails to build _asyncio on module on AIX

2020-03-12 Thread STINNER Victor


STINNER Victor  added the comment:

I converted attached _aix_support.py into PR 18970 (with minor changes).

--

___
Python tracker 

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



[issue39927] IDLE.app fails on macOS 10.15 if denied access to Documents

2020-03-12 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Note that IDLE.app sets the current working directory to ~/Documents to have a 
sane working directory (and hence sane behavior in file dialogs), by default 
app bundles on macOS are launched with the root directory as the current 
working directory. 

For "python3 -m idlelib" it is not really necessary to change the working 
directory, and changing it might confuse users that also use IDLE on other 
platforms.

--

___
Python tracker 

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



[issue39862] Why are the union relationships not implemented by default for ≤ and ≥?

2020-03-12 Thread Géry

Géry  added the comment:

Note that other relationships are always valid _and already implemented by 
default in the interpreter (through the `NotImplemented` return value 
protocol)_: = is the 
[converse](https://en.wikipedia.org/wiki/Binary_relation#Converse) of itself, ≠ 
is the converse of itself, < and > are each other’s converse, ≤ and ≥ as each 
other’s converse. ("converse" is loosely called "reflected" in the Python 
documentation.)

Which also makes me think that the last sentence of this documentation 
paragraph is incorrect:

> By default, `__ne__()` delegates to `__eq__()` and inverts the result
> unless it is `NotImplemented`. There are no other implied
> relationships among the comparison operators, for example, the truth
> of `(x are each 
other’s converse, and ≤ and ≥ are each other’s converse.

--

___
Python tracker 

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



[issue39948] Python 3.8 unconditionally uses functions not available on OS X 10.4 and 10.5

2020-03-12 Thread dgelessus


New submission from dgelessus :

In particular, the implementation of posix._fcopyfile uses  
(available since OS X 10.5), and the implementation of threading.get_native_id 
uses pthread_threadid_np (available since OS X 10.6). This breaks builds for OS 
X 10.5 and older.

I'm aware that the oldest officially supported OS X version is 10.6, but 
according to a python-dev post 
(https://mail.python.org/pipermail/python-dev/2018-May/153725.html), earlier 
versions are "supported on a best-effort basis".

Would patches for these old versions still be accepted? I have the patch for 
this issue almost completely worked out, and it's not very complicated or 
intrusive - it mainly just adds standard autoconf checks for the 
functions/headers in question.

--
components: macOS
messages: 364051
nosy: dgelessus, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Python 3.8 unconditionally uses functions not available on OS X 10.4 and 
10.5
versions: 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



[issue39949] truncating match in regular expression match objects repr

2020-03-12 Thread Seth Troisi


New submission from Seth Troisi :

Following on https://bugs.python.org/issue17087

Today I was mystified by why a regex wasn't working.

>>> import re
>>> re.match(r'.{10}', 'A'*49+'B')
<_sre.SRE_Match object; span=(0, 10), match='AA'>

>>> re.match(r'.{49}', 'A'*49+'B')
<_sre.SRE_Match object; span=(0, 49), 
match='A>

>>> re.match(r'.{50}', 'A'*49+'B')
<_sre.SRE_Match object; span=(0, 50), 
match='A>

I became confused on why the B wasn't matching in the third example; It is 
matching just
in the interactive debugger it doesn't fit on the line and doesn't show


My suggestion would be to truncate match (in the repr) and append '...' when 
it's right quote wouldn't show


with short matches (or exactly enough space) there would be no change

>>> re.match(r'.{48}', string.ascii_letters)
<_sre.SRE_Match object; span=(0, 48), 
match='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV'>

when not all of match can be displayed

>>> re.match(r'.{49}', string.ascii_letters)
<_sre.SRE_Match object; span=(0, 49), 
match='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW>
<_sre.SRE_Match object; span=(0, 49), 
match='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS'...>


I'm happy to help out by writing tests or impl if folks thing this is a good 
idea.

I couldn't think of other examples (urllib maybe?) in Python of how this is 
handled but I could potentially look for some if that would help

--
components: Library (Lib)
messages: 364052
nosy: Seth.Troisi, serhiy.storchaka
priority: normal
severity: normal
status: open
title: truncating match in regular expression match objects repr
type: enhancement

___
Python tracker 

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



[issue39949] truncating match in regular expression match objects repr

2020-03-12 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think the missing closing quote is supposed to be your visual clue that it's 
truncated. Although I'll grant you that it's pretty subtle.

--
nosy: +eric.smith
versions: +Python 3.9

___
Python tracker 

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



[issue39936] Python fails to build _asyncio on module on AIX

2020-03-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c846ef004d79ee8e9645d3e5e8b3b0cb97b5013f by Victor Stinner in 
branch 'master':
bpo-39936: _aix_support uses _bootsubprocess (GH-18970)
https://github.com/python/cpython/commit/c846ef004d79ee8e9645d3e5e8b3b0cb97b5013f


--

___
Python tracker 

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



[issue38500] PEP 523: Add private _PyInterpreterState_SetEvalFrameFunc() function to the C API (Python 3.8 regression)

2020-03-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0b72b23fb0c130279f65f3bcd23521acf4a98c88 by Victor Stinner in 
branch 'master':
bpo-38500: Add _PyInterpreterState_SetEvalFrameFunc() (GH-17340)
https://github.com/python/cpython/commit/0b72b23fb0c130279f65f3bcd23521acf4a98c88


--

___
Python tracker 

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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-12 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18320
pull_request: https://github.com/python/cpython/pull/18972

___
Python tracker 

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



[issue39924] pathlib handles missing `os.link`, `os.symlink` and `os.readlink` inconsistently

2020-03-12 Thread Barney Gale


Barney Gale  added the comment:

Good points! Do you know of an example of a community library that uses 
`_Accessor.link`? Thanks

--

___
Python tracker 

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



[issue39291] "pathlib.Path.link_to()" and "pathlib.Path.symlink_to()" have reversed usage

2020-03-12 Thread Barney Gale


Barney Gale  added the comment:

Per discussion on the mailing list, I'd like to request that this bug be 
re-opened.

https://mail.python.org/archives/list/python-...@python.org/thread/7QPLYW36ZK6QTW4SV4FI6C343KYWCPAT/

--
nosy: +barneygale

___
Python tracker 

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



[issue39291] "pathlib.Path.link_to()" and "pathlib.Path.symlink_to()" have reversed usage

2020-03-12 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

Am hesitant on re-opening this.

I think it sounds more meaningful to open a new issue for the new
suggestion that requires deprecating this
current behavior and introducing the new intended functionality.

Best,
Joannah

On Thu, Mar 12, 2020 at 8:40 PM Barney Gale  wrote:

>
> Barney Gale  added the comment:
>
> Per discussion on the mailing list, I'd like to request that this bug be
> re-opened.
>
>
> https://mail.python.org/archives/list/python-...@python.org/thread/7QPLYW36ZK6QTW4SV4FI6C343KYWCPAT/
>
> --
> nosy: +barneygale
>
> ___
> Python tracker 
> 
> ___
>

-- 
Best,
Joannah Nanjekye

*"You think you know when you learn, are more sure when you can write, even
more when you can teach, but certain when you can program." Alan J. Perlis*

--

___
Python tracker 

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



[issue28775] Option to set startup directory in IDLE

2020-03-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The rule for whether to switch to the configured directory might be
  if sys.stdout is None: chdir...

On windows, this is true when starting in the console with
  pyw(pythonw) -m idlelib
But there is no need to include the (Windows-only) 'w'.  It is meant to be used 
in the Windows icon shortcut.  The option to start in the configured directory 
even from the console might be seen as a plus.

--

___
Python tracker 

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



[issue39950] Add pathlib.Path.hardlink_to()

2020-03-12 Thread Barney Gale


New submission from Barney Gale :

Per bpo-39291, the argument order for `pathlib.Path.link_to()` is inconsistent 
with `symlink_to()` and its own documentation.

This ticket covers adding a new `hardlink_to()` method with the correct 
argument order, and deprecating `link_to()`.

Discussion on python-dev: 
https://mail.python.org/archives/list/python-...@python.org/thread/7QPLYW36ZK6QTW4SV4FI6C343KYWCPAT/

--
components: Library (Lib)
messages: 364060
nosy: barneygale
priority: normal
severity: normal
status: open
title: Add pathlib.Path.hardlink_to()
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue39950] Add pathlib.Path.hardlink_to()

2020-03-12 Thread Barney Gale


Change by Barney Gale :


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

___
Python tracker 

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



[issue24119] Carry comments with the AST

2020-03-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

I propose to close this issue, since (as of Python 3.8) we now have 
ast.parse(source, type_comments=True).

--

___
Python tracker 

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



[issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library

2020-03-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

If people are looking for a concrete CST that works now, maybe LibCST will 
work? https://github.com/Instagram/LibCST

--

___
Python tracker 

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



[issue22121] Start IDLE from icon in a better place.

2020-03-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#39927 is about changing the Mac-specific chdir hidden away in
  Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py, line 8
A generic solution should supercede that.

--

___
Python tracker 

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



[issue39933] test_gdb fails on AMD64 FreeBSD Shared 3.x: ptrace: Operation not permitted

2020-03-12 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

Testing with security.bsd.unprivileged_proc_debug=1

--

___
Python tracker 

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



[issue39927] IDLE.app fails on macOS 10.15 if denied access to Documents

2020-03-12 Thread Ned Deily

Ned Deily  added the comment:

As Ronald notes, the chdir to the user’s Documents folder is *only* needed when 
launching via IDLE.app (for example by double-clicking an IDLE.app icon in the 
macOS Finder) because the user has no control over the launched app’s working 
directory in that case and the default is inappropriate. Whereas, when 
launching IDLE from a command line (for example, with “python -m idlelib’), 
IDLE inherits the working directory of the UNIX shell process which the user 
has complete control over. This is how users experience IDLE today on all UNIXy 
platforms. Thus, the chdir location is correct and current code and behavior 
should not be changed except to catch a chdir failure. The only question is 
what to do when an exception is caught.

--

___
Python tracker 

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



[issue35712] Make NotImplemented unusable in boolean context

2020-03-12 Thread Ethan Furman


Ethan Furman  added the comment:

Hmm.  Okay, I'm happy with just raising a TypeError in NotImplemented.__bool__.

--

___
Python tracker 

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



[issue31122] SSLContext.wrap_socket() throws OSError with errno == 0

2020-03-12 Thread Dima Tisnek

Dima Tisnek  added the comment:

If someone can review https://github.com/python/cpython/pull/18772 then 
pretty-please review 🙏

--

___
Python tracker 

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



[issue22121] Start IDLE from icon in a better place.

2020-03-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Recap and proposal

When editing a named file, Open and Save start in the directory of that file.  
Running a file sets the initial working directory of the execution process, 
which affects imports in the code.

We are here discussing the working directory for the IDLE process.  This 
affects a. the working directory for interactive code entered without having 
first run from the editor; b. the start directory for Open and Save in both 
Shell and any untitled editor windows.

When IDLE is started with command line 'python -m idlelib', its working 
directory is that of the console.  We agree that IDLE should not change this.  
In this case, sys.stdout is not None.  (The exception is when one starts with 
pythonw, which which is normally useless in the console.)

When IDLE is started Windows Explorer by right clicking a file and selecting 
'Edit with IDLE' its working directory is the same as the file.  I propose that 
IDLE should not change the directory in this case either. In this case, there 
is at least one filename in sys.args, which IDLE parses anyway.

I initially considered this issue to be about changing the installed Start menu 
shortcut.  But it was suggested that IDLE code might be better.  Adding a 
configuration option would require this.  Such code would also not be limited 
to Windows.  I am currently thinking of something like

if sys.stdout is None and no file in sys.argv:
start_dir = idleConf(...) #28775, default None?.
if start_dir is None:
start_dir = 
try:
chdir(expanduser('~'))
except OSError as e:
 

This might be somehow coordinated with .idlerc location search.

--

___
Python tracker 

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



[issue39927] IDLE.app fails on macOS 10.15 if denied access to Documents

2020-03-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Right.  I rechecked and Terminal starts in /Users/ and a user can 
easily switch to Documents or anything else.  Dialogs open in the same 
directory.  IDLE should stay wherever when started from terminal. That was 
agreed on #22121  (Checking 'sys.stdout is None' should work.)

Will my suggested change work in idlemain.py?  Is there any issue with 
importing tkinter.messagebox there?

If the solution for #22121 is an all-systems patch (see msg364068), as I now 
expect, the chdir in idlemain could be deleted.

--

___
Python tracker 

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



[issue39920] os.stat() and os.lstat() fail with Windows device paths

2020-03-12 Thread Eryk Sun


Eryk Sun  added the comment:

The particular error reported here is due to pathlib, which is a duplicate of 
issue 33898. That said, since the OP is using 3.7, I've left this issue open in 
case someone wants to backport the win32_xstat_impl changes that enable stat() 
(and in particular setting st_mode) for Windows 'character' (e.g. //./NUL and 
//./CONIN$) and 'block' devices (e.g. //./C: and //./PhysicalDrive0). I don't 
recall why Steve Dower decided against backporting this update.

--
components: +Library (Lib)
title: os.lstat() does not work with Window Dos devices -> os.stat() and 
os.lstat() fail  with Windows device paths
versions:  -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



[issue39943] Meta: Clean up various issues in C internals

2020-03-12 Thread Andy Lester


Change by Andy Lester :


--
pull_requests: +18322
pull_request: https://github.com/python/cpython/pull/18973

___
Python tracker 

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



[issue39951] Ignore specific errors when closing ssl connections

2020-03-12 Thread Dima Tisnek


New submission from Dima Tisnek :

When a connection wrapped in ssl is closed, sometimes the ssl library reports 
an error, which I believe should be ignored.

The error code is `291` and the name of the error is either SSL_R_KRB5_S_INIT 
(KRB5_S_INIT) or SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY depending on openssl 
header file.
It's only one code, somehow `ssl.h` (depending on version?) has different 
symbolic name for the error.
TBH, I consider `KRB5_S_INIT` a misnomer, there's no Kerberos here.

The explanation for openssl reporting this error is here:

https://github.com/openssl/openssl/blob/6d53ad6b5cf726d92860e973d7bc8c1930762086/ssl/record/rec_layer_s3.c#L1657-L1668

> The peer is continuing to send application data, but we have
> already sent close_notify. If this was expected we should have
> been called via SSL_read() and this would have been handled
> above.

This situation is easily achieved, because of network delays. Just because we 
sent "close notify", doesn't mean the other end has received it, and even if it 
did, there could still be return data in flight.

Reproducer is here: 
https://gist.github.com/dimaqq/087c66dd7b4a85a669a00221dc3792ea

--
components: Extension Modules, Library (Lib)
messages: 364071
nosy: Dima.Tisnek
priority: normal
severity: normal
status: open
title: Ignore specific errors when closing ssl connections
versions: 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



  1   2   >