[issue27860] Improvements to ipaddress module

2019-04-15 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 2430d532e240dea55f0082d1e9bf2e0f3d7505be by Inada Naoki in branch 
'master':
bpo-27860: use cached_property (GH-12832)
https://github.com/python/cpython/commit/2430d532e240dea55f0082d1e9bf2e0f3d7505be


--

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2019-04-15 Thread Peixing Xin


Change by Peixing Xin :


--
pull_requests: +12758

___
Python tracker 

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



[issue36610] os.sendfile can return EINVAL on Solaris

2019-04-15 Thread Jakub Kulik


Jakub Kulik  added the comment:

Here is a traceback from one failed test:

test test_lib2to3 failed
==
ERROR: test_refactor_file_write_unchanged_file 
(lib2to3.tests.test_refactor.TestRefactoringTool)
--
Traceback (most recent call last):
  File "/tmp/Python-3.8.0a3/Lib/lib2to3/tests/test_refactor.py", line 228, in 
test_refactor_file_write_unchanged_file
self.check_file_refactoring(test_file, fixers=(),
  File "/tmp/Python-3.8.0a3/Lib/lib2to3/tests/test_refactor.py", line 183, in 
check_file_refactoring
test_file = self.init_test_file(test_file)
  File "/tmp/Python-3.8.0a3/Lib/lib2to3/tests/test_refactor.py", line 202, in 
init_test_file
shutil.copy(test_file, tmpdir)
  File "/tmp/Python-3.8.0a3/Lib/shutil.py", line 401, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/tmp/Python-3.8.0a3/Lib/shutil.py", line 266, in copyfile
_fastcopy_sendfile(fsrc, fdst)
  File "/tmp/Python-3.8.0a3/Lib/shutil.py", line 165, in _fastcopy_sendfile
raise err
  File "/tmp/Python-3.8.0a3/Lib/shutil.py", line 145, in _fastcopy_sendfile
sent = os.sendfile(outfd, infd, offset, blocksize)
OSError: [Errno 22] Invalid argument: 
'/tmp/Python-3.8.0a3/Lib/lib2to3/tests/data/fixers/parrot_example.py' -> 
'/tmp/2to3-test_refactoruxve6nrz/parrot_example.py'


I also have a script which can reproduce this (attached). It happens to me 
every time my offset is bigger or equal than the size of the file, no matter 
whether the file is empty or offset is bigger than the size right from the 
start, even when in a loop, sending in several parts. The attached example 
works on my Linux machine (outputs 12 and 0), but breaks on Solaris (12 and 
exception). 

As I have said before, it might be just that Python (specifically sendfile 
implementation) is not compiled correctly on Solaris and changes to define 
guards might fix that.

--
Added file: https://bugs.python.org/file48266/example.py

___
Python tracker 

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



[issue36616] Optimize thread state handling in function call code

2019-04-15 Thread Petr Viktorin


Petr Viktorin  added the comment:

Indeed, this is a good idea.

--

___
Python tracker 

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



[issue36616] Optimize thread state handling in function call code

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

I wanted to do that, but I never measured the overhead of PyThreadState_GET() 
calls. Subtle detail: using _PyThreadState_GET() ("_Py") prefix rather than 
PyThreadState_GET() ensures that you get the optimized macro ;-)

--
nosy: +vstinner

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 236d0b75c41449a266201c683b4b0d6acdee02df by Victor Stinner 
(pxinwr) in branch 'master':
bpo-31904: Don't build the _crypt extension on VxWorks (GH-12833)
https://github.com/python/cpython/commit/236d0b75c41449a266201c683b4b0d6acdee02df


--

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f1464f4d2ecf9b809ff768c523c5eea1abd31c55 by Victor Stinner 
(pxinwr) in branch 'master':
bpo-31904: Port the time module on VxWorks (GH-12305)
https://github.com/python/cpython/commit/f1464f4d2ecf9b809ff768c523c5eea1abd31c55


--

___
Python tracker 

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



[issue36540] PEP 570: Python Positional-Only Parameters

2019-04-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PR 12701 makes breaking changes in the inspect module.

Currently we have two sets of APIs in the inspect module: old deprecated API 
that do not support keyword-only arguments, and new *full* API that supports 
them. Even many years since 3.0 the old API still has not been removed. Adding 
support for positional-only arguments needs changes of the same order as adding 
support of keyword-only arguments. It means deprecating the current API and 
introducing a new (*fuller*?) API. This is a slow process for many releases. We 
could also take opportunity to redesign APIs completely instead of just adding 
new parameters and fields.

I suggest to remove all breaking changes in the inspect module and defer them 
to the separate issue. This perhaps will need a discussion on Python-Dev, and 
maybe not one.

--

___
Python tracker 

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



[issue36540] PEP 570: Python Positional-Only Parameters

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like deprecating or removing "old" inspect functions is an issue. An 
option would be to raise an error if these functions is used on a function 
which has at least one positional argument.

--
nosy: +vstinner

___
Python tracker 

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



[issue36619] when is os.posix_spawn(setsid=True) safe?

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

Maybe we need to expose an object in the os module to list which parameters are 
supported. setsid is not argument, but scheduler is another argument. There is 
also a discussion to add another argument to os.posix_spawn() to specify the 
working directly: it's not possible on all platforms neither.

Currently, there are os.supports_* constants like os.supports_dir_fd (set of 
function names). But I would prefer to have an object just for posix_spawn. 
Maybe:

os.supported_posix_spawn_args = ('file_actions', setpgroup', 'resetids', 
'setsid', 'setsigmark', 'setsigdef', 'scheduler')

The value would depend depending on the platform.

--
nosy: +inada.naoki, pablogsal, serhiy.storchaka

___
Python tracker 

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



[issue36619] when is os.posix_spawn(setsid=True) safe?

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

Hum, os.supports_posix_spawn_args name would be more consistent with 
os.supports_dir_fd name.

--

___
Python tracker 

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



[issue36624] cleanup the stdlib and tests with regard to sys.platform usage

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

My previous attempt was: https://github.com/python/cpython/pull/7800

Serhiy Storchaka and Ned Deily were unable about this change:

* https://github.com/python/cpython/pull/7800#issuecomment-398688441
* https://github.com/python/cpython/pull/7800#issuecomment-399614918
* https://github.com/python/cpython/pull/7800#issuecomment-400134294

*If* a change is done, I would prefer to do it for Linux, macOS and Windows as 
well.

--

___
Python tracker 

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



[issue36624] cleanup the stdlib and tests with regard to sys.platform usage

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

support.is_android has two flaws:

* it's a constant: it must be spelled as UPPER CASE
* I dislike "is_" prefix: "MS_WINDOWS" constant is commonly used, and it 
doesn't start with "is_".

In my PR, I used support.ANDROID.

--

___
Python tracker 

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



[issue10417] [2.7] unittest triggers UnicodeEncodeError with non-ASCII character in the docstring of the test function

2019-04-15 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner
title: unittest triggers UnicodeEncodeError with non-ASCII character in the 
docstring of the test function -> [2.7] unittest triggers UnicodeEncodeError 
with non-ASCII character in the docstring of the test function

___
Python tracker 

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



[issue16079] list duplicate test names with patchcheck

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

This script should be part of Python and run in the pre-commit CI like Travis 
CI!

--

___
Python tracker 

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



[issue36630] failure of test_colors_funcs in test_curses with ncurses 6.1

2019-04-15 Thread Chih-Hsuan Yen


Chih-Hsuan Yen  added the comment:

I asked on bug-ncurses mailing list and Thomas Dickey suggests "improving the 
python curses binding to handle the newer terminal descriptions". Looks like 
that requires non-trivial efforts. On the other hand, I've also found a 
workaround:

$ TERM=xterm python -m test -u curses -v test_curses

(or anything without -256color suffix for $TERM)

How about setting TERM=xterm in tests and documenting that CPython does not 
support new terminal descriptions for now?

[1] http://lists.gnu.org/archive/html/bug-ncurses/2019-04/msg3.html

--
nosy: +yan12125

___
Python tracker 

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



[issue36629] imaplib test fails with errno 101

2019-04-15 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +12759
stage:  -> patch review

___
Python tracker 

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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

PyGC_Head structure size depends on the Python version, sizes of 64-bit:

* 2.7: 32 bytes
* 3.6, 3.7: 24 bytes
* 3.8 (master): 16 bytes

bpo-36618 "clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 
bytes" should be even worse on 3.7: 24 is not aligned on 16. I don't understand 
why nobody saw this alignment issue previously. Maybe clang only became stricer 
about 16 bytes alignment recently?

2.7:

typedef union _gc_head {
struct {
union _gc_head *gc_next;
union _gc_head *gc_prev;
Py_ssize_t gc_refs;
} gc;
double dummy; /* Force at least 8-byte alignment. */
char dummy_padding[sizeof(union _gc_head_old)];
} PyGC_Head;

3.7:

typedef union _gc_head {
struct {
union _gc_head *gc_next;
union _gc_head *gc_prev;
Py_ssize_t gc_refs;
} gc;
double dummy;  /* force worst-case alignment */
} PyGC_Head;

3.8:

typedef struct {
// Pointer to next object in the list.
// 0 means the object is not tracked
uintptr_t _gc_next;

// Pointer to previous object in the list.
// Lowest two bits are used for flags documented later.
uintptr_t _gc_prev;
} PyGC_Head;

In 3.8, the union used to ensure alignment on a C double is gone.

--

___
Python tracker 

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



[issue33632] undefined behaviour: signed integer overflow in threadmodule.c

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

In short, a+b can overflow, but a-b cannot?

--

___
Python tracker 

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



[issue36629] imaplib test fails with errno 101

2019-04-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12760

___
Python tracker 

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



[issue36629] imaplib test fails with errno 101

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3c7931e514faf509a39c218c2c9f55efb434628f by Victor Stinner in 
branch 'master':
bpo-36629: Add support.get_socket_conn_refused_errs() (GH-12834)
https://github.com/python/cpython/commit/3c7931e514faf509a39c218c2c9f55efb434628f


--

___
Python tracker 

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



[issue36631] test_urllib2net: test_ftp_no_timeout() killed after a timeout of 15 min

2019-04-15 Thread STINNER Victor


New submission from STINNER Victor :

It seems like test_urllib2net.test_ftp_no_timeout() has no timeout: it should 
use a timeout to not block the whole test suite if the FTP server is down.

x86 Gentoo Non-Debug with X 3.7:
https://buildbot.python.org/all/#/builders/115/builds/1044

0:26:50 load avg: 1.68 [413/416] test_genericpath passed -- running: 
test_urllib2net (11 min 59 sec)
0:26:52 load avg: 1.68 [414/416] test_tempfile passed -- running: 
test_urllib2net (12 min 1 sec)
0:26:52 load avg: 1.68 [415/416] test_pipes passed -- running: test_urllib2net 
(12 min 1 sec)
running: test_urllib2net (12 min 31 sec)
running: test_urllib2net (13 min 1 sec)
running: test_urllib2net (13 min 31 sec)
running: test_urllib2net (14 min 1 sec)
running: test_urllib2net (14 min 31 sec)
0:29:51 load avg: 1.49 [416/416/1] test_urllib2net crashed (Exit code 1)
Timeout (0:15:00)!
Thread 0xb7be2700 (most recent call first):
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/socket.py", 
line 716 in create_connection
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/ftplib.py", 
line 152 in connect
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/urllib/request.py",
 line 2384 in init
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/urllib/request.py",
 line 2375 in __init__
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/urllib/request.py",
 line 1555 in connect_ftp
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/urllib/request.py",
 line 1533 in ftp_open
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/urllib/request.py",
 line 503 in _call_chain
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/urllib/request.py",
 line 543 in _open
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/urllib/request.py",
 line 525 in open
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/urllib/request.py",
 line 222 in urlopen
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/test/test_urllib2net.py",
 line 19 in _retry_thrice
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/test/test_urllib2net.py",
 line 27 in wrapped
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/test/test_urllib2net.py",
 line 327 in test_ftp_no_timeout

--
components: Tests
messages: 340257
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_urllib2net: test_ftp_no_timeout() killed after a timeout of 15 min
versions: Python 2.7, Python 3.7, Python 3.8

___
Python tracker 

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



[issue27860] Improvements to ipaddress module

2019-04-15 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +12761

___
Python tracker 

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



[issue36629] imaplib test fails with errno 101

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 28ed39e83e4c545fa1da89fd7691cace280296f7 by Victor Stinner (Miss 
Islington (bot)) in branch '3.7':
bpo-36629: Add support.get_socket_conn_refused_errs() (GH-12834) (GH-12835)
https://github.com/python/cpython/commit/28ed39e83e4c545fa1da89fd7691cace280296f7


--

___
Python tracker 

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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-15 Thread Florian Weimer


Change by Florian Weimer :


--
nosy: +fweimer

___
Python tracker 

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



[issue27860] Improvements to ipaddress module

2019-04-15 Thread Inada Naoki


Inada Naoki  added the comment:

I am not owner of ipaddress module, so I don't know we should
support more form of masks.

On the other hand, IPv4Interface and IPv6Interface expose
netmask and hostmask attributes when address is not bytes or int.

These attributes are not documented.  I assume it was added
accidentally, when coping some code from Network classes.

But there are test for these attributes.
NetmaskTestMixin_v4.test_valid_netmask runs for IPv4Network and IPv4Interface.
It checks these attributes when constructor argument is string.
https://github.com/python/cpython/blob/3c7931e514faf509a39c218c2c9f55efb434628f/Lib/test/test_ipaddress.py#L422-L440

For safety, I added these attributes always, instead of remove them.

PR-12836 is fixing it, and extracts methods for Network/Interface constructor
(a part of PR-12774).  It doesn't add additional mask form support.

--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue36632] test_multiprocessing_forkserver: test_rapid_restart() leaked a dangling process on AMD64 FreeBSD 10-STABLE Non-Debug 3.x

2019-04-15 Thread STINNER Victor


New submission from STINNER Victor :

AMD64 FreeBSD 10-STABLE Non-Debug 3.x
https://buildbot.python.org/all/#/builders/167/builds/777

0:04:20 load avg: 4.05 [113/420/1] test_multiprocessing_forkserver failed (env 
changed) (3 min 43 sec)
...
test_listener_client 
(test.test_multiprocessing_forkserver.WithProcessesTestListenerClient) ... ok
test_lock (test.test_multiprocessing_forkserver.WithProcessesTestLock) ... ok
test_lock_context (test.test_multiprocessing_forkserver.WithProcessesTestLock) 
... ok
test_rlock (test.test_multiprocessing_forkserver.WithProcessesTestLock) ... ok
test_enable_logging 
(test.test_multiprocessing_forkserver.WithProcessesTestLogging) ... ok
test_level (test.test_multiprocessing_forkserver.WithProcessesTestLogging) ... 
ok
test_rapid_restart 
(test.test_multiprocessing_forkserver.WithProcessesTestManagerRestart) ... ok
Warning -- Dangling processes: {}
test_access 
(test.test_multiprocessing_forkserver.WithProcessesTestPicklingConnections) ... 
ok
test_pickling 
(test.test_multiprocessing_forkserver.WithProcessesTestPicklingConnections) ... 
ok
test_boundaries (test.test_multiprocessing_forkserver.WithProcessesTestPoll) 
... ok
...

--
components: Tests
messages: 340260
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_multiprocessing_forkserver: test_rapid_restart() leaked a dangling 
process on AMD64 FreeBSD 10-STABLE Non-Debug 3.x
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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-15 Thread Florian Weimer


Florian Weimer  added the comment:

The issue is related to the definition of PyCArgObject:

typedef struct tagPyCArgObject PyCArgObject;

struct tagPyCArgObject {
PyObject_HEAD
ffi_type *pffi_type;
char tag;
union {
char c;
char b;
short h;
int i;
long l;
long long q;
long double D;
double d;
float f;
void *p;
} value;
PyObject *obj;
Py_ssize_t size; /* for the 'V' tag */
};

This object must be allocated with suitable alignment (which is 16 on many 
platforms), and the default Python allocator apparently provides 8-byte 
alignment only on 64-bit platforms.  In short, using PyObject_New with 
PyCArgObject results in undefined behavior.

This issue potentially affects all compilers, not just Clang.

--

___
Python tracker 

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



[issue36632] test_multiprocessing_forkserver: test_rapid_restart() leaked a dangling process on AMD64 FreeBSD 10-STABLE Non-Debug 3.x

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

Fixed issues:

* bpo-31069: test_multiprocessing_spawn and test_multiprocessing_forkserver 
leak dangling processes
* bpo-31234: Make support.threading_cleanup() stricter

--

___
Python tracker 

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



[issue35866] concurrent.futures deadlock

2019-04-15 Thread Miro Hrončok

Miro Hrončok  added the comment:

Reverting 3b699932e5ac3e76031bbb6d700fbea07492641d makes problem go away.

--
nosy: +hroncok

___
Python tracker 

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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2019-04-15 Thread Inada Naoki


Inada Naoki  added the comment:

I had not noticed bpo-33374 changed Python 2.7.
I don't know why it caused segv only for Python 2.7.

--

___
Python tracker 

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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

The x86-64 ABI requires that memory allocated on the heap is aligned to 16 
bytes.

On x86-64, glibc malloc(size) aligns on 16 bytes for size >= 16, otherwise 
align to 8 bytes. So the glibc doesn't respect exactly the ABI. I understand 
that a compiler will not use instructions which require 16B align on a memory 
block smaller than 16B, so align to 8B for size < 16B should be fine *in 
practice*.

Python objects are at least 16B because of PyObject header. Moreover, objects 
tracked by the GC gets additional 16B header from PyGC_Head.

But pymalloc is also used for PyMem_Malloc() since Python 3.6, and 
PyMem_Malloc() is used to allocate things which are not PyObject.

--

___
Python tracker 

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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2019-04-15 Thread Florian Weimer


Florian Weimer  added the comment:

Minor correction: glibc malloc follows ABI on x86-64 and always returns a 
16-byte-aligned pointer, independently of allocation size.

However, other mallocs (such as jemalloc and tcmalloc) may return pointers with 
less alignment for allocation sizes less than 16 bytes, violating ABI.  They 
still follow ABI for allocations of 16 bytes and more.

But as you said, the distinction should not matter for Python because of the 
object header.  Furthermore, without LTO, the compiler will not be able to 
detect that a pointer returned from Py_NewObject is a top-level allocation, and 
therefore has to be more conservative about alignment, using information from 
the type definitions only.

--

___
Python tracker 

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



[issue36404] Document PendingDeprecationWarning is not so useful.

2019-04-15 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +12762

___
Python tracker 

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



[issue36629] imaplib test fails with errno 101

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks for your bug report Marat Sharafutdinov, it's now fixed in 3.7 and 
master (Python 2.7 is not affected, it doesn't have the test_imaplib test 
method).

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



[issue36629] imaplib test fails with errno 101

2019-04-15 Thread Marat Sharafutdinov


Marat Sharafutdinov  added the comment:

Thank you for the patch, Victor!

--

___
Python tracker 

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



[issue36625] Obsolete comments in docstrings in fractions module

2019-04-15 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset a9a28808e5a03d2e68e421227c113a38edc40946 by Mark Dickinson (Jakub 
Molinski) in branch 'master':
bpo-36625: Remove obsolete comments from docstrings in fractions module 
(GH-12822)
https://github.com/python/cpython/commit/a9a28808e5a03d2e68e421227c113a38edc40946


--

___
Python tracker 

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



[issue36625] Obsolete comments in docstrings in fractions module

2019-04-15 Thread Mark Dickinson


Change by Mark Dickinson :


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



[issue36404] Document PendingDeprecationWarning is not so useful.

2019-04-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12763

___
Python tracker 

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



[issue36616] Optimize thread state handling in function call code

2019-04-15 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


--
keywords: +patch
pull_requests: +12764
stage:  -> patch review

___
Python tracker 

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



[issue36616] Optimize thread state handling in function call code

2019-04-15 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

The gain is small, but it's there.

I made some further changes:

- replacing code of the form

sp = stack_pointer;
call_function(..., &sp, ...)
stack_pointer = sp;

  by

call_function(..., &stack_pointer, ...)

- fold the inline function do_call_core() in the main eval loop (the function 
became so small that there was no longer a reason to pull it out of the main 
loop)

- removed pointless check PyMethod_GET_SELF(func) != NULL (methods always have 
self != NULL)

--

___
Python tracker 

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



[issue36633] py_compile.compile: AttributeError on importlib.utils

2019-04-15 Thread Jens Vagelpohl


New submission from Jens Vagelpohl :

The following code in py_compile.compile fails (tested on 3.6.6 and 3.7.3) with 
tracebacks that end like the one shown at the bottom. There's an AttributeError 
about importlib.utils.

"""
if cfile is None:
if optimize >= 0:
optimization = optimize if optimize >= 1 else ''
cfile = importlib.util.cache_from_source(file,
 optimization=optimization)
else:
cfile = importlib.util.cache_from_source(file)
"""

Sample tail end of traceback:

"""
  File "/Users/jens/src/.eggs/Chameleon-3.6-py3.7.egg/chameleon/template.py", 
line 243, in _cook
cooked = self.loader.build(source, filename)
  File "/Users/jens/src/.eggs/Chameleon-3.6-py3.7.egg/chameleon/loader.py", 
line 177, in build
py_compile.compile(name)
  File 
"/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/py_compile.py",
 line 130, in compile
cfile = importlib.util.cache_from_source(file)
AttributeError: module 'importlib' has no attribute 'util'
"""

--
components: Library (Lib)
messages: 340271
nosy: dataflake
priority: normal
severity: normal
status: open
title: py_compile.compile: AttributeError on importlib.utils
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



[issue32451] python -m venv activation issue when using cygwin on windows

2019-04-15 Thread Erik Bray


Erik Bray  added the comment:

Coincidentally I just encountered this myself when trying to activate a venv 
created by Python for Windows while in a Cygwin shell.  Indeed, bash for Cygwin 
is just like bash anywhere else, and considers it a syntax error to encounter 
unexpected CR's.

Alas, venv creates //Scripts/activate with CRLFs.  After running 
dos2unix on it, this script can be sourced from Cygwin and otherwise works fine.

The issue that arises with interactive mode is a known issue not specific to 
Python or venv.  It can also be worked around by running python with winpty.

--

___
Python tracker 

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



[issue36624] cleanup the stdlib and tests with regard to sys.platform usage

2019-04-15 Thread Michael Felt


Michael Felt  added the comment:

On 15/04/2019 11:50, STINNER Victor wrote:
> STINNER Victor  added the comment:
>
> support.is_android has two flaws:
>
> * it's a constant: it must be spelled as UPPER CASE
> * I dislike "is_" prefix: "MS_WINDOWS" constant is commonly used, and it 
> doesn't start with "is_".

I do not like the is_xxx form either, but I am low in the (name) picking
order. I like ALL_CAPS because it is easier to recognize as a constant,

I have the habit of using _ (underscore) before a name - but the clear
consensus is to not use that for constants coming from support.test.

As to being 'backported', even manually - that is something I would work
on. I am an old dog - and this seems like a good enough bone for me.

So, I'll finish up for AIX - except I would like to underline again
something I have come across a few times (but cannot find right now) -
and that is to base these constants not on the platform being built on,
but the platform being run on (i.e., platform.system()). I expect there
may be specific tests that are relevant during the build moment, or
perhaps, "later", when using something such as 'pip' to add a module.

As, relatively speaking, a new-comer to Python, I see this as a vast
improvement to the readability (and clarity) of the code.

As to new tests, modifications, etc. it will become part of the PR
review to be sure this becomes and stays the standard.

Anyway, I'll get started with AIX - not that many - and I hope with all
the constant definitions being moved to one place that should simplify
maintenance (and perhaps even back-porting).

>
> In my PR, I used support.ANDROID.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue36634] venv: activate.bat fails for venv with parentheses in PATH

2019-04-15 Thread Bastian Wenzel


New submission from Bastian Wenzel :

After creating a virtual environment on win 7 (64bit) with:
py -3.7 -m venv venv

Running venv\Scripts\activate.bat will yield this result:
\Common was unexpected at this time.
(venv) C:\...

My PATH variable contains a path that starts with:
C:\Program Files (x86)\Common Files\...

To me this looks like this issue for virtualenv:
https://github.com/pypa/virtualenv/issues/35
https://github.com/pypa/virtualenv/pull/839

Running:
(venv) C:\Tools\venv_test>where python
C:\Python34\python.exe

This is my default python on PATH. Doing this with virtualenv:
(virtualenv) C:\Tools\venv_test>where python
C:\Tools\venv_test\virtualenv\Scripts\python.exe
C:\Python34\python.exe

I really hope this is not a duplicate.

--
components: Library (Lib)
messages: 340274
nosy: BWenzel
priority: normal
severity: normal
status: open
title: venv: activate.bat fails for venv with parentheses in PATH
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



[issue36633] py_compile.compile: AttributeError on importlib.utils

2019-04-15 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Can you please add a simplified script to reproduce this and possibly without 
any external dependencies? Looking at the traceback it seems to come from the 
project chameleon at 
https://github.com/malthe/chameleon/blob/983877e628a75f42c473cb2ea2350fb0727eb85b9/src/chameleon/loader.py#L177
 . The file seems standalone without some helper functions from utils file.

--
nosy: +xtreak

___
Python tracker 

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



[issue36634] venv: activate.bat fails for venv with parentheses in PATH

2019-04-15 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue26270] Support for read()/write()/select() on asyncio

2019-04-15 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
nosy: +asvetlov
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue36633] py_compile.compile: AttributeError on importlib.utils

2019-04-15 Thread Jens Vagelpohl


Jens Vagelpohl  added the comment:

Thank you for the prompt reply.

It turns out this is not a bug in py_compile. Other code we use imports 
importlib.util briefly for a quick check at module level and then deletes it, 
also at module scope. Removing the deletion fixes the issue.

Thanks again and apologies!

--
resolution:  -> third party

___
Python tracker 

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



[issue36633] py_compile.compile: AttributeError on importlib.utils

2019-04-15 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

No problem, closing the issue.

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



[issue35866] concurrent.futures deadlock

2019-04-15 Thread cagney


cagney  added the comment:

@hroncok see comment msg339370

Vanilla 3.7.0 (re-confirmed) didn't contain the change, nor did 3.6.8 (ok, that 
isn't vanilla) but both can hang using the test.  It can take a while and, 
subjectively, it seems to depend on machine load.  I've even struggled to get 
3.7.3 to fail without load.

Presumably there's a race and grinding the test machine into the ground 
increases the odds of it happening.

The patch for bpo-6721 could be causing many things, but two to mind:

- turning this bug into bpo-36533 (aka bpo-6721 caused a regression)
- slowed down the fork (sending time acquiring locks) which increased the odds 
of this hang

My hunch is the latter as the stack dumps look nothing like those I analyzed 
for bpo-36533 (see messages msg339454 and msg339458).

--

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2019-04-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12765

___
Python tracker 

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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

C++ has a __alignof__ function/macro/operator (not sure what is its kind) to 
get the alignment of a type.

C11 has  header which provides an alignof() function.

GCC has __alignof__().

I also found "_Alignof()" name.

... no sure which one is the most portable ...

--

___
Python tracker 

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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

I also found this macro:

#define ALIGNOF(type) offsetof (struct { char c; type member; }, member)

--

___
Python tracker 

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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

More info on alignof():
http://www.wambold.com/Martin/writings/alignof.html

--

___
Python tracker 

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



[issue36635] Add _testinternalcapi module

2019-04-15 Thread STINNER Victor


New submission from STINNER Victor :

Python headers are being reorganized to clarify what's public, specific to 
CPython or "internal". See issues bpo-35134 (Add a new Include/cpython/ 
subdirectory) and bpo-35081 (Move internal headers to Include/internal/).

Problem: the _testcapi module designed to only test the *public* API. Functions 
tested by _testcapi cannot be made internal.

I propose to add a new _testinternalcapi module reserved to test internal APIs.

Attached PR implements this idea: it makes _Py_GetConfigsAsDict() private and 
moves _testcapi.get_configs() to _testinternalcapi.get_configs().

--
components: Tests
messages: 340282
nosy: vstinner
priority: normal
severity: normal
status: open
title: Add _testinternalcapi module
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



[issue36635] Add _testinternalcapi module

2019-04-15 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +12766
stage:  -> patch review

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9820c07e4146e18bddc9ac1586cee7e542903de0 by Victor Stinner in 
branch 'master':
bpo-35134: Add Include/cpython/pymem.h (GH-12840)
https://github.com/python/cpython/commit/9820c07e4146e18bddc9ac1586cee7e542903de0


--

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2019-04-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12767

___
Python tracker 

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



[issue33632] undefined behaviour: signed integer overflow in threadmodule.c

2019-04-15 Thread Paul Ganssle


Paul Ganssle  added the comment:

> In short, a+b can overflow, but a-b cannot?

I think it's more that by always checking the elapsed time against `now() - 
starttime`, you never need to represent the time at which the timeout should 
happen - which may be so far in the future that it causes a signed overflow.

--

___
Python tracker 

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



[issue36624] cleanup the stdlib and tests with regard to sys.platform usage

2019-04-15 Thread Michael Felt


Change by Michael Felt :


--
keywords: +patch
pull_requests: +12768
stage:  -> patch review

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-04-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12769

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset aba7d662abbb847f9f45c6db58242a9b4bf65bff by Victor Stinner in 
branch 'master':
bpo-35134: Add cpython/pymem.h to build system (GH-12842)
https://github.com/python/cpython/commit/aba7d662abbb847f9f45c6db58242a9b4bf65bff


--

___
Python tracker 

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



[issue36626] asyncio run_forever blocks indefinitely

2019-04-15 Thread Dan Timofte


Change by Dan Timofte :


--
keywords: +patch
pull_requests: +12770
stage:  -> patch review

___
Python tracker 

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



[issue16079] list duplicate test names with patchcheck

2019-04-15 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

False positives must be added to the 'ignored_duplicates' file in order to have 
duplicate_code_names.py exit with success. Not sure whether this may be 
considered as an annoyance by commiters, if TRAVIS would fail when 
duplicate_code_names.py fails.

All the function or class names duplicates have been removed as false positives 
from the list in my previous post and this single false positive has been 
removed from the duplicate method names:

Lib/test/test_socket.py:4115 InterruptedTimeoutBase.setAlarm

All the duplicates are method names as reported now or five years ago in msg 
198586, so this script should get another command line option to only report 
duplicate method names.

--

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0810fa79885276114d1a94e2ce61da367ebb1ffc by Victor Stinner in 
branch 'master':
bpo-36389: Cleanup gc.set_threshold() (GH-12844)
https://github.com/python/cpython/commit/0810fa79885276114d1a94e2ce61da367ebb1ffc


--

___
Python tracker 

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



[issue30840] Contrary to documentation, relative imports cannot pass through the top level

2019-04-15 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

I actually opened a PR with the relevant documentation suggested by @ncoghlan 
but what am wondering is. 

when @ncoghlan says That part of the PEP was never implemented - relative 
imports have never been allowed to cross package boundaries in practice, does 
it mean we dont need this to work anymore as was earlier put in the PEP?  In 
which case this issue will be closed if my PR is merged or we should actually 
implement it to complete everything the PEP specified?

--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue28238] In xml.etree.ElementTree findall() can't search all elements in a namespace

2019-04-15 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +eli.bendersky, scoder, serhiy.storchaka
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue31954] Don't prevent dict optimization by coupling with OrderedDict

2019-04-15 Thread Eric Snow


Eric Snow  added the comment:

Please don't miss the fact that the main reason for mirroring the dict table is 
to get O(1) node lookup (in the linked list).  Otherwise most lookup-dependent 
operations, like __delitem__(), would become O(n); whereas in the pure-Python 
implementation they are O(1).  This is all explained in the notes at the top of 
Objects/odictobject.c.

Also, I didn't change anything in the dict implementation to rely on the 
OrderedDict implementation.  So while I would say OrderedDict is coupled to 
dict, I wouldn't say the reverse, that dict is coupled to OrderedDict.  If dict 
changes then OrderedDict must be updated apporpropriately, but not vice-versa.  
That should still hold.

--

___
Python tracker 

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



[issue26270] Support for read()/write()/select() on asyncio

2019-04-15 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue36616] Optimize thread state handling in function call code

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

> The gain is small, but it's there.

Do you mean a performance speedup? If yes, can you please run a micro-benchmark?

--

___
Python tracker 

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



[issue36632] test_multiprocessing_forkserver: test_rapid_restart() leaked a dangling process on AMD64 FreeBSD 10-STABLE Non-Debug 3.x

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

https://buildbot.python.org/all/#/builders/58/builds/2225

test_listener_client 
(test.test_multiprocessing_spawn.WithProcessesTestListenerClient) ... ok
test_lock (test.test_multiprocessing_spawn.WithProcessesTestLock) ... ok
test_lock_context (test.test_multiprocessing_spawn.WithProcessesTestLock) ... ok
test_rlock (test.test_multiprocessing_spawn.WithProcessesTestLock) ... ok
test_enable_logging (test.test_multiprocessing_spawn.WithProcessesTestLogging) 
... ok
test_level (test.test_multiprocessing_spawn.WithProcessesTestLogging) ... ok
test_rapid_restart 
(test.test_multiprocessing_spawn.WithProcessesTestManagerRestart) ... ok
Warning -- Dangling processes: {}
test_access 
(test.test_multiprocessing_spawn.WithProcessesTestPicklingConnections) ... ok
test_pickling 
(test.test_multiprocessing_spawn.WithProcessesTestPicklingConnections) ... ok

--

___
Python tracker 

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



[issue36348] test_imaplib.RemoteIMAP_STARTTLSTest.test_logout() fails randomly

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 74125a60b7a477451ff2b8385bfbce3fdaee8dbc by Victor Stinner in 
branch 'master':
bpo-36348: IMAP4.logout() doesn't ignore exc (GH-12411)
https://github.com/python/cpython/commit/74125a60b7a477451ff2b8385bfbce3fdaee8dbc


--

___
Python tracker 

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



[issue36348] test_imaplib.RemoteIMAP_STARTTLSTest.test_logout() fails randomly

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:

I pushed a change to get more information if the test fails again.

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



[issue36348] test_imaplib.RemoteIMAP_STARTTLSTest.test_logout() fails randomly

2019-04-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12771

___
Python tracker 

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



[issue36634] venv: activate.bat fails for venv with parentheses in PATH

2019-04-15 Thread Steve Dower


Steve Dower  added the comment:

Basically everyone has that directory in their PATH - we'd be hearing a lot 
more issues if it were a consistent bug.

Can you share the full contents of your activate.bat file? And if it's okay, 
your full PATH variable (before and after running activate.bat)

(You may not want to share PATH if there are applications in there that you 
don't want to be seen publicly - in that case, can you randomize letters rather 
than deleting them? e.g. "System32"->"Xborpm99" That way we won't lose 
potentially important information to this bug like punctuation.)

--

___
Python tracker 

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



[issue16079] list duplicate test names with patchcheck

2019-04-15 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Agreed, making duplicate method definitions a CI failure is the desired end 
state once our test suite is cleaned up and it doesn't have false positives.

FYI - pylint also implements this check quite reliably as function-redefined 
via its pylint.checkers.base.BasicErrorChecker._check_redefinition() method.

https://github.com/PyCQA/pylint/blob/2.2/pylint/checkers/base.py#L843

--

___
Python tracker 

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



[issue36348] test_imaplib.RemoteIMAP_STARTTLSTest.test_logout() fails randomly

2019-04-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2815bf5b1f39b9f677135473392887a8d261fc97 by Victor Stinner in 
branch '3.7':
bpo-36348: test_imaplib: add debug info (GH-12846)
https://github.com/python/cpython/commit/2815bf5b1f39b9f677135473392887a8d261fc97


--

___
Python tracker 

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



[issue36636] Inner exception is not being raised using asyncio.gather

2019-04-15 Thread Drew Budwin


New submission from Drew Budwin :

Using Python 3.7, I am trying to catch an exception and re-raise it by 
following an example I found on StackOverflow 
(https://stackoverflow.com/a/6246394/1595510). While the example does work, it 
doesn't seem to work for all situations. Below I have two asynchronous Python 
scripts that try to re-raise exceptions. The first example works, it will print 
both the inner and outer exception.

import asyncio

class Foo:
async def throw_exception(self):
raise Exception("This is the inner exception")

async def do_the_thing(self):
try:
await self.throw_exception()
except Exception as e:
raise Exception("This is the outer exception") from e

async def run():
await Foo().do_the_thing()

def main():
loop = asyncio.get_event_loop()
loop.run_until_complete(run())

if __name__ == "__main__":
main()

Running this will correctly output the following exception stack trace:

$ py test.py
Traceback (most recent call last):
  File "test.py", line 9, in do_the_thing
await self.throw_exception()
  File "test.py", line 5, in throw_exception
raise Exception("This is the inner exception")
Exception: This is the inner exception

The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "test.py", line 21, in 
main()
  File "test.py", line 18, in main
loop.run_until_complete(run())
  File "C:\Python37\lib\asyncio\base_events.py", line 584, in run_until_complete
return future.result()
  File "test.py", line 14, in run
await Foo().do_the_thing()
  File "test.py", line 11, in do_the_thing
raise Exception("This is the outer exception") from e
Exception: This is the outer exception

However, in my next Python script, I have multiple tasks that I queue up that I 
want to get a similar exception stack trace from. Essentially, I except the 
above stack trace to be printed 3 times (once for each task in the following 
script). The only difference between the above and below scripts is the run() 
function.

import asyncio

class Foo:
async def throw_exception(self):
raise Exception("This is the inner exception")

async def do_the_thing(self):
try:
await self.throw_exception()
except Exception as e:
raise Exception("This is the outer exception") from e

async def run():
tasks = []

foo = Foo()

tasks.append(asyncio.create_task(foo.do_the_thing()))
tasks.append(asyncio.create_task(foo.do_the_thing()))
tasks.append(asyncio.create_task(foo.do_the_thing()))

results = await asyncio.gather(*tasks, return_exceptions=True)

for result in results:
if isinstance(result, Exception):
print(f"Unexpected exception: {result}")

def main():
loop = asyncio.get_event_loop()
loop.run_until_complete(run())

if __name__ == "__main__":
main()

The above code snippet produces the disappointingly short exceptions lacking 
stack traces.

$ py test.py
Unexpected exception: This is the outer exception
Unexpected exception: This is the outer exception
Unexpected exception: This is the outer exception

If I change return_exceptions to be False, I will get the exceptions and stack 
trace printed out once and then execution stops and the remaining two tasks are 
cancelled. The output is identical to the output from the first script. The 
downside of this approach is, I want to continue processing tasks even when 
exceptions are encountered and then display all the exceptions at the end when 
all the tasks are completed.

--
components: asyncio
messages: 340297
nosy: Drew Budwin, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Inner exception is not being raised using asyncio.gather
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



[issue36637] Restrict syntax for tuple literals with one element

2019-04-15 Thread danijar


New submission from danijar :

A tuple can be created with or without parentheses:

a = (1, 2, 3)

a = 1, 2, 3

While both are intuitive in this example, omitting the parentheses can lead to 
hard to find errors when there is only one element:

a = (1,)

a = 1,

The first is clear but the second can easily occur as a typo when the 
programmer actually just wanted to assign an integer (comma is next to enter on 
many keyboards).

I think ideally, omitting parentheses in the single element case would throw a 
SyntaxError.

On the other hand, I assume that it could be difficult to separate the behavior 
or tuple creating with an without parentheses, since the parentheses are 
probably not actually part of the tuple literal.

--
components: Interpreter Core
messages: 340298
nosy: benjamin.peterson, brett.cannon, danijar, xtreak, yselivanov
priority: normal
severity: normal
status: open
title: Restrict syntax for tuple literals with one element

___
Python tracker 

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



[issue30840] Contrary to documentation, relative imports cannot pass through the top level

2019-04-15 Thread Brett Cannon


Brett Cannon  added the comment:

RE: "does it mean we dont need this to work anymore as was earlier put in the 
PEP?"

Correct, we aren't going to implement that part of the PEP ever.

--

___
Python tracker 

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



[issue36637] Restrict syntax for tuple literals with one element

2019-04-15 Thread Brett Cannon


Brett Cannon  added the comment:

Thanks for the idea, but this would break way too much code to warrant changing 
it. Plus making this act differently just in the single-item case is too much 
special-casing/surprise.

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



[issue28238] In xml.etree.ElementTree findall() can't search all elements in a namespace

2019-04-15 Thread Stefan Behnel


Stefan Behnel  added the comment:

lxml has a couple of nice features here:

- all tags in a namespace: "{namespace}*"
- a local name 'tag' in any (or no) namespace: "{*}tag"
- a tag without namespace: "{}tag"
- all tags without namespace: "{}*"

"{*}*" is also accepted but is the same as "*". Note that "*" is actually 
allowed as an XML tag name by the spec, but rare enough to hijack it for this 
purpose. I've actually never seen it used anywhere in the wild.

lxml's implementation isn't applicable to ElementTree (searching has been 
subject to excessive optimisation), but it shouldn't be hard to extend the one 
in ET's ElementPath.py module, as well as Element.iter() in ElementTree.py, to 
support this kind of tag comparison.

PR welcome.

lxml's tests are here (and in the following test methods):

https://github.com/lxml/lxml/blob/359f693b972c2e6b0d83d26a329d2d20b7581c48/src/lxml/tests/test_etree.py#L2911

Note that they actually test the deprecated .getiterator() method for 
historical reasons. They should probably call .iter() instead these days. 
lxml's ElementPath implementation is under src/lxml/_elementpath.py, but the 
tag comparison itself is done elsewhere in Cython code (here, in case it 
matters:)

https://github.com/lxml/lxml/blob/359f693b972c2e6b0d83d26a329d2d20b7581c48/src/lxml/apihelpers.pxi#L921-L1048

--
stage:  -> needs patch

___
Python tracker 

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



[issue30202] Update test.test_importlib.test_abc to test find_spec()

2019-04-15 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
keywords: +patch
pull_requests: +12772
stage: needs patch -> patch review

___
Python tracker 

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



[issue30202] Update test.test_importlib.test_abc to test find_spec()

2019-04-15 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +nanjekyejoannah
stage: patch review -> needs patch

___
Python tracker 

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



[issue30202] Update test.test_importlib.test_abc to test find_spec()

2019-04-15 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

Since it was almost 2 years since the last conversation, i opened a PR for 
this. 

@brett.cannon I may have not looked at all possible areas to use find_spec(), 
so please let me know in the reviews for this PR.

--

___
Python tracker 

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



[issue30840] Contrary to documentation, relative imports cannot pass through the top level

2019-04-15 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

Great, thanks for clarity.

--

___
Python tracker 

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



[issue24638] asyncio "loop argument must agree with future" error message could be improved

2019-04-15 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
pull_requests: +12773
stage:  -> patch review

___
Python tracker 

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



[issue24638] asyncio "loop argument must agree with future" error message could be improved

2019-04-15 Thread Zackery Spytz


Zackery Spytz  added the comment:

I've created a PR for this issue.

--
components: +asyncio
nosy: +ZackerySpytz, asvetlov, yselivanov
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



[issue35329] Documentation - capitalization issue

2019-04-15 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Hi Hans,

Would you be interested in making a pull request with this change?  Thanks!

--
nosy: +cheryl.sabella
stage:  -> needs patch
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



[issue31954] Don't prevent dict optimization by coupling with OrderedDict

2019-04-15 Thread Inada Naoki


Inada Naoki  added the comment:

@Serhiy

> It the pure Python implementation PyDict_GetItem also
> returns value, not node of linked list.

I missed pure Python implementation used two dicts.


@Eric

> Please don't miss the fact that the main reason for mirroring the dict table 
> is to get O(1) node lookup (in the linked list). 

I don't miss it, of course.  I'm proposing make linked list node as Python 
Object, and store it directly into dict, like LRU implementation in _functools.

In this idea, if dict.__getitem__ is called directly, a node of linked list is 
returned instead of value in the node.
I must admit this idea is too aggressive.

If we can redesign OrderedDict from scratch, I propose OrderedDict uses dict, 
without inheriting it.  But it is too late.

--

___
Python tracker 

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



[issue27860] Improvements to ipaddress module

2019-04-15 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 6fa84bd12c4b83bee6a41b989363230d5c03b96c by Inada Naoki in branch 
'master':
bpo-27860: ipaddress: fix Interface missed some attributes (GH-12836)
https://github.com/python/cpython/commit/6fa84bd12c4b83bee6a41b989363230d5c03b96c


--

___
Python tracker 

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



[issue27860] Improvements to ipaddress module

2019-04-15 Thread Inada Naoki


Inada Naoki  added the comment:

I merged all cleanups.

I don't merge accepting any IP representations as mask, because I'm not expert 
of this module.
At least, I don't want to pass prefix/netmask by something like 
IPv4Network("0.0.255.255").

--

___
Python tracker 

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



[issue36638] typeperf.exe is not in all skus of Windows

2019-04-15 Thread Paul Monson


New submission from Paul Monson :

typeperf.exe is not present on small editions 
of windows like Windows IoT Core or nanoserver
This causes WindowsLoadTracker to throw an exception during test initialization.

--
components: Tests
messages: 340309
nosy: Paul Monson
priority: normal
severity: normal
status: open
title: typeperf.exe is not in all skus of Windows
type: crash
versions: Python 3.8

___
Python tracker 

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



[issue36638] typeperf.exe is not in all skus of Windows

2019-04-15 Thread Paul Monson


Change by Paul Monson :


--
keywords: +patch
pull_requests: +12774
stage:  -> patch review

___
Python tracker 

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



[issue36638] typeperf.exe is not in all skus of Windows SKUs

2019-04-15 Thread Paul Monson


Change by Paul Monson :


--
title: typeperf.exe is not in all skus of Windows -> typeperf.exe is not in all 
skus of Windows SKUs

___
Python tracker 

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



[issue29930] Waiting for asyncio.StreamWriter.drain() twice in parallel raises an AssertionError when the transport stopped writing

2019-04-15 Thread Nic Watson


Change by Nic Watson :


--
nosy: +jnwatson

___
Python tracker 

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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2019-04-15 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +12775
stage:  -> patch review

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2019-04-15 Thread Peixing Xin


Change by Peixing Xin :


--
nosy: +pxinwr

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2019-04-15 Thread Peixing Xin


Peixing Xin  added the comment:

@vstinner I've informed WRS team of temporarily not creating new PRs in until 
less than 4 PRs are in the open state. Next we will keep open PRs less than 4. 
Thanks for your effort on them.

--

___
Python tracker 

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



  1   2   >