[issue36336] test_httplib, test_multiprocessing_forkserver leaks on x86 Gentoo

2019-03-18 Thread Stéphane Wirtel

New submission from Stéphane Wirtel :

See this build report: https://buildbot.python.org/all/#/builders/72/builds/523

test_multiprocessing_forkserver leaked [1, 1, 1] memory blocks, sum=3
test_httplib leaked [1, 1, 1] memory blocks, sum=3
Re-running failed tests in verbose mode
Re-running test 'test_multiprocessing_forkserver' in verbose mode
test_multiprocessing_forkserver leaked [0, 0, 2] file descriptors, sum=2
Re-running test 'test_httplib' in verbose mode

--
components: Library (Lib), Tests
keywords: 3.6regression
messages: 338165
nosy: matrixise
priority: normal
severity: normal
status: open
title: test_httplib, test_multiprocessing_forkserver leaks on x86 Gentoo
versions: Python 3.6

___
Python tracker 

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



[issue36337] Use socket.sendall()/send() send data larger than 2GB will be truncated and return None, without exception raised.

2019-03-18 Thread kmiku7


New submission from kmiku7 :

In file Modules/socketmodule.c, sock_send/sock_sendall use int to keep array 
length need be sent and has sent.

--
components: Library (Lib)
messages: 338166
nosy: kmiku7
priority: normal
severity: normal
status: open
title: Use socket.sendall()/send() send data larger than 2GB will be truncated 
and return None, without exception raised.
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue36321] Fix misspelled attribute name in namedtuple()

2019-03-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 23581c018fceb607fe829a41c6fbe81b4d502cab by Raymond Hettinger in 
branch 'master':
bpo-36321: Fix misspelled attribute in namedtuple() (GH-12375)
https://github.com/python/cpython/commit/23581c018fceb607fe829a41c6fbe81b4d502cab


--

___
Python tracker 

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



[issue36321] Fix misspelled attribute name in namedtuple()

2019-03-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12350

___
Python tracker 

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



[issue36336] test_httplib, test_multiprocessing_forkserver leaks on x86 Gentoo

2019-03-18 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

I have tested on my laptop (fedora 29) and I can't reproduce these memory leaks.

I suppose we can not debug on the builder...

--

___
Python tracker 

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



[issue36321] Fix misspelled attribute name in namedtuple()

2019-03-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset bedfbc790e18f14cfdd59cf27d27bb86518dc3fc by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.7':
bpo-36321: Fix misspelled attribute in namedtuple() (GH-12375) (GH-12395)
https://github.com/python/cpython/commit/bedfbc790e18f14cfdd59cf27d27bb86518dc3fc


--

___
Python tracker 

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



[issue36321] Fix misspelled attribute name in namedtuple()

2019-03-18 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue36337] Use socket.sendall()/send() send data larger than 2GB will be truncated and return None, without exception raised.

2019-03-18 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Related issue : issue18100 . Seems this was fixed in 3.x .

--
nosy: +xtreak

___
Python tracker 

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



[issue36336] test_httplib, test_multiprocessing_forkserver leaks on x86 Gentoo

2019-03-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +pablogsal, vstinner

___
Python tracker 

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



[issue36338] urlparse of urllib returns wrong hostname

2019-03-18 Thread Xianbo Wang


New submission from Xianbo Wang :

The urlparse function in Python urllib returns the wrong hostname when parsing 
URL crafted by the malicious user. This may be caused by incorrect handling of 
IPv6 addresses. The bug could lead to open redirect in web applications which 
rely on urlparse to extract and validate the domain of redirection URL.

The test case is as follows:

>>> from urllib.parse import urlparse
>>> urlparse(urlparse('http://benign.com\[attacker.com]').hostname
>>> 'attacker.com'

The correct behavior should be raising an invalid URL exception.

--
components: Library (Lib)
messages: 338171
nosy: Xianbo Wang
priority: normal
severity: normal
status: open
title: urlparse of urllib returns wrong hostname
type: security
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



[issue36338] urlparse of urllib returns wrong hostname

2019-03-18 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

I can confirm with 3.7.2 on fedora 29

--
nosy: +matrixise, orsenthil

___
Python tracker 

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



[issue36338] urlparse of urllib returns wrong hostname

2019-03-18 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Here is a unittest where you can test this issue and the result on Python 
3.8.0a2 and 3.7.2

>>> 3.8.0a2
./python /tmp/test_bug_36338.py
/tmp/test_bug_36338.py:8: SyntaxWarning: invalid escape sequence \[
  url = 'http://demo.com\[attacker.com]'
3.8.0a2+ (heads/master:23581c018f, Mar 18 2019, 09:17:05) 
[GCC 8.3.1 20190223 (Red Hat 8.3.1-2)]
test_bad_url (__main__.TestUrlparse) ... FAIL

==
FAIL: test_bad_url (__main__.TestUrlparse)
--
Traceback (most recent call last):
  File "/tmp/test_bug_36338.py", line 13, in test_bad_url
self.assertEqual(hostname, expected_hostname)
AssertionError: 'attacker.com' != 'demo.com'
- attacker.com
+ demo.com


--
Ran 1 test in 0.001s

FAILED (failures=1)

>>> 3.7.2
python /tmp/test_bug_36338.py
3.7.2 (default, Jan 16 2019, 19:49:22) 
[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)]
test_bad_url (__main__.TestUrlparse) ... FAIL

==
FAIL: test_bad_url (__main__.TestUrlparse)
--
Traceback (most recent call last):
  File "/tmp/test_bug_36338.py", line 13, in test_bad_url
self.assertEqual(hostname, expected_hostname)
AssertionError: 'attacker.com' != 'demo.com'
- attacker.com
+ demo.com


--
Ran 1 test in 0.000s

FAILED (failures=1)

--
Added file: https://bugs.python.org/file48215/test_bug_36338.py

___
Python tracker 

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



[issue36320] typing.NamedTuple to switch from OrderedDict to regular dict

2019-03-18 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue36337] Use socket.sendall()/send() send data larger than 2GB will be truncated and return None, without exception raised.

2019-03-18 Thread kmiku7


kmiku7  added the comment:

Can we fix it in 2.7?

--

___
Python tracker 

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



[issue36281] OSError: handle is closed for ProcessPoolExecutor and run_in_executor

2019-03-18 Thread Bas Nijholt


Change by Bas Nijholt :


--
type:  -> crash

___
Python tracker 

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



[issue36318] Adding support for setting the "disabled" attribute of loggers from logging.config.dictConfig

2019-03-18 Thread Géry

Géry  added the comment:

Actually people do this all the time, to deactivate the logging of some 
third-party libraries (me included). For instance:

* 
https://stackoverflow.com/questions/24344045/how-can-i-completely-remove-any-logging-from-requests-module-in-python
* 
https://stackoverflow.com/questions/34598952/how-to-disable-info-logging-from-a-third-party-module-in-python
* 
https://stackoverflow.com/questions/38102291/turn-off-logging-in-schedule-library

And currently we can only use either solution 2 or 3 with 
`logging.config.dictConfig` (which are more verbose and less explicit). We 
cannot use solution 1 with `logging.config.dictConfig`.

In addition, all public attributes in the `__init__` methods of the 
`logging.Formatter`, `logging.Handler` and `logging.Logger` classes can be set 
from `logging.config.dictConfig`, except the `disabled` attribute, which is 
inconsistent.

--

___
Python tracker 

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



[issue36338] urlparse of urllib returns wrong hostname

2019-03-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +martin.panter

___
Python tracker 

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



[issue36337] Use socket.sendall()/send() send data larger than 2GB will be truncated and return None, without exception raised.

2019-03-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue36337] Use socket.sendall()/send() send data larger than 2GB will be truncated and return None, without exception raised.

2019-03-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vstinner

___
Python tracker 

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



[issue36338] urlparse of urllib returns wrong hostname

2019-03-18 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


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



[issue36339] test_ttk_guionly: test_traversal() fails randomly on AMD64 Windows8.1 Refleaks 2.7

2019-03-18 Thread STINNER Victor


New submission from STINNER Victor :

AMD64 Windows8.1 Refleaks 2.7:

https://buildbot.python.org/all/#/builders/33/builds/538

Previous related issues:

* bpo-8445
* bpo-11925

Extract of the test code:

def test_traversal(self):
self.nb.pack()
self.nb.wait_visibility()

self.nb.select(0)

simulate_mouse_click(self.nb, 5, 5)
self.nb.focus_force()
self.nb.event_generate('')
self.assertEqual(self.nb.select(), str(self.child2))  # <~~~ HERE
self.nb.focus_force()
self.nb.event_generate('')
self.assertEqual(self.nb.select(), str(self.child1))
...


Buildbot logs:

test_traversal (test_ttk.test_widgets.NotebookTest) ... ok
test_traversal (test_ttk.test_widgets.NotebookTest) ... FAIL
...
test_xscrollcommand (test_ttk.test_widgets.TreeviewTest) ... ok
test_yscrollcommand (test_ttk.test_widgets.TreeviewTest) ... ok
test_identify (test_ttk.test_widgets.WidgetTest) ... ok
beginning 6 repetitions
123456
.test test_ttk_guionly failed -- Traceback (most recent call last):
  File 
"D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\test\test_ttk\test_widgets.py",
 line 1096, in test_traversal
self.assertEqual(self.nb.select(), str(self.child2))
AssertionError: '.85131176L' != '.85291096L'

test_widget_state (test_ttk.test_widgets.WidgetTest) ... ok

==
FAIL: test_traversal (test_ttk.test_widgets.NotebookTest)
--
Traceback (most recent call last):
  File 
"D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\test\test_ttk\test_widgets.py",
 line 1096, in test_traversal
self.assertEqual(self.nb.select(), str(self.child2))
AssertionError: '.85131176L' != '.85291096L'

--
Ran 273 tests in 2.843s

FAILED (failures=1)
1 test failed again:
test_ttk_guionly

--
components: Tests
messages: 338176
nosy: pablogsal, vstinner
priority: normal
severity: normal
status: open
title: test_ttk_guionly: test_traversal() fails randomly on AMD64 Windows8.1 
Refleaks 2.7
versions: Python 2.7

___
Python tracker 

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



[issue36336] test_httplib, test_multiprocessing_forkserver leaks on x86 Gentoo

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

Python 3.6 no longer accept bugfixes, I don't think that it's worth it to 
investigate such flaky tests.

--
resolution:  -> out of date
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



[issue36273] test_thread leaks a core dump on PPC64 AIX 3.x

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

David Edelsohn: Would you mind to have a look at this issue?

--

___
Python tracker 

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



[issue36340] 3.7.3rc1 Install Certificates fails on macOS

2019-03-18 Thread Dima Tisnek

New submission from Dima Tisnek :

I've just installed Python 3.7.3rc1 for macOS 10.9 or later from the macOS 
64-bit installer.

I've clicked the `Install Certificates.command`, which opened a Terminal, ran 
and failed with:

```
Last login: Mon Mar 18 16:36:21 on ttys010
Welcome to fish, the friendly interactive shell
… ~> /Applications/Python\ 3.7/Install\ Certificates.command ; exit;
 -- pip install --upgrade certifi
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", 
line 193, in _run_module_as_main
"__main__", mod_spec)
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", 
line 85, in _run_code
exec(code, run_globals)
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/__main__.py",
 line 16, in 
from pip._internal import main as _main  # isort:skip # noqa
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/__init__.py",
 line 19, in 
from pip._vendor.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.urllib3.exceptions'
Traceback (most recent call last):
  File "", line 44, in 
  File "", line 25, in main
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py",
 line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 
'['/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7', '-E', 
'-s', '-m', 'pip', 'install', '--upgrade', 'certifi']' returned non-zero exit 
status 1.

[Process completed]
```

I was able to run the same command from my regular shell (iTerm2, fish, $PATH 
addons, etc.) and that completed just fine and installed certifi==2019.3.9

Either there's just something wrong with my system (what?) or the initial 
experience for average user is broken (unlikely?)...

--
components: Installation
messages: 338179
nosy: Dima.Tisnek
priority: normal
severity: normal
status: open
title: 3.7.3rc1 Install Certificates fails on macOS
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



[issue35813] shared memory construct to avoid need for serialization between processes

2019-03-18 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

After changeset e895de3e7f3cc2f7213b87621cfe9812ea4343f0, test_all fails on 
platforms that lack the _posixshmem extension module (Android for example):

==
FAIL: test_all (test.test___all__.AllTest) (module='multiprocessing.managers')
--
Traceback (most recent call last):
File "/data/local/tmp/python/lib/python3.8/test/test___all__.py", line 34, in 
check_all
  exec("from %s import *" % modname, names)
AttributeError: module 'multiprocessing.managers' has no attribute 
'SharedMemoryManager'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/data/local/tmp/python/lib/python3.8/test/test___all__.py", line 37, in 
check_all
  self.fail("__all__ failure in {}: {}: {}".format(
AssertionError: __all__ failure in multiprocessing.managers: AttributeError: 
module 'multiprocessing.managers' has no attribute 'SharedMemoryManager'


The following patch fixes the problem:

diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py
index 7973012b98..3fdd60fff7 100644
--- a/Lib/multiprocessing/managers.py
+++ b/Lib/multiprocessing/managers.py
@@ -8,8 +8,7 @@
# Licensed to PSF under a Contributor Agreement.
#

-__all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token',
-'SharedMemoryManager' ]
+__all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token' ]

#
# Imports
@@ -33,6 +32,7 @@ from . import get_context
try:
   from . import shared_memory
   HAS_SHMEM = True
+__all__.append('SharedMemoryManager')
except ImportError:
   HAS_SHMEM = False

--
nosy: +xdegaye

___
Python tracker 

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



[issue36340] 3.7.3rc1 Install Certificates fails on macOS

2019-03-18 Thread Dima Tisnek


Dima Tisnek  added the comment:

More system info:
I've had 3.7.2 installed from official installer prior to this.
Before that, I had 3.7.1 installed from official installer.
I also have 3.8a2. 3.6.8, 2.7.15 on the system, as well as an odd version from 
Homebrew.

My system site-packages for 3.7 now (after manual fix) contains ceritifi, pip 
(19.0.3), setuptools, pkg_resources, easy_install.py and README.

--

___
Python tracker 

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



[issue36337] Use socket.sendall()/send() send data larger than 2GB will be truncated and return None, without exception raised.

2019-03-18 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


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

___
Python tracker 

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



[issue36337] Use socket.sendall()/send() send data larger than 2GB will be truncated and return None, without exception raised.

2019-03-18 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

2.7 is in bugfix mode, but I have created a PR (not yet completed, need to be 
tested with real unittest).

Could you try my PR and why not produce a script for the tests.

Thank you.

--
nosy: +matrixise

___
Python tracker 

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



[issue36340] 3.7.3rc1 Install Certificates fails on macOS

2019-03-18 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
components: +macOS
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



[issue36341] bind() on AF_UNIX socket may fail in tests run as non-root

2019-03-18 Thread Xavier de Gaye


New submission from Xavier de Gaye :

This happens on Android where a SELinux policy prevents a plain user to bind() 
a pathname AF_UNIX socket (abstract and unnamed sockets are not constrained by 
this policy).

The errors are:

test_asyncio:
==
ERROR: test_start_unix_server_1 
(test.test_asyncio.test_server.SelectorStartServerTests)
--
Traceback (most recent call last):
File "/data/local/tmp/python/lib/python3.8/test/test_asyncio/test_server.py", 
line 105, in test_start_unix_server_1
  srv = self.loop.run_until_complete(asyncio.start_unix_server(
File "/data/local/tmp/python/lib/python3.8/asyncio/base_events.py", line 589, 
in run_until_complete
  return future.result()
File "/data/local/tmp/python/lib/python3.8/asyncio/streams.py", line 115, in 
start_unix_server
  return await loop.create_unix_server(factory, path, **kwds)
File "/data/local/tmp/python/lib/python3.8/asyncio/unix_events.py", line 285, 
in create_unix_server
  sock.bind(path)
PermissionError: [Errno 13] Permission denied

test_socket:
==
ERROR: test_socket_fileno (test.test_socket.GeneralModuleTests)
--
Traceback (most recent call last):
File "/data/local/tmp/python/lib/python3.8/test/test_socket.py", line 1780, in 
test_socket_fileno
  s.bind(os.path.join(tmpdir, 'socket'))
PermissionError: [Errno 13] Permission denied

test_stat:
==
ERROR: test_socket (test.test_stat.TestFilemodeCStat)
--
Traceback (most recent call last):
File "/data/local/tmp/python/lib/python3.8/test/test_stat.py", line 198, in 
test_socket
  s.bind(TESTFN)
PermissionError: [Errno 13] Permission denied

==
ERROR: test_socket (test.test_stat.TestFilemodePyStat)
--
Traceback (most recent call last):
File "/data/local/tmp/python/lib/python3.8/test/test_stat.py", line 198, in 
test_socket
  s.bind(TESTFN)
PermissionError: [Errno 13] Permission denied

--
components: Tests
messages: 338183
nosy: xdegaye
priority: normal
severity: normal
stage: needs patch
status: open
title: bind() on AF_UNIX socket may fail in tests run as non-root
type: behavior
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



[issue36332] compile() error on AST object with assignment expression

2019-03-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue36332] compile() error on AST object with assignment expression

2019-03-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal

___
Python tracker 

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



[issue36297] Remove unicode_internal codec

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks INADA-san. IMHO Python has too many codecs, it's painful to maintain 
them. So it's nice to see deprecate ones to be removed.

Next step: remove all deprecated APIs using Py_UNICODE* :-D (I know that Serhiy 
is working on that.)

--

___
Python tracker 

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



[issue36333] memory leaks detected with valgrind for python -V

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

I assign the issue to myself, since I'm currently working on the code: 
bpo-36301.

--
assignee:  -> vstinner

___
Python tracker 

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



[issue36337] Use socket.sendall()/send() send data larger than 2GB will be truncated and return None, without exception raised.

2019-03-18 Thread kmiku7


kmiku7  added the comment:

Thanks for your contribute! I just have read your PR on github.
Because I am not familiar about how to contribute a patch, I doubt it's 
reasonable to write a test which will consuming more than 2GB memory space? 
Because if write a test to cover this case, we will build a string larger than 
2GB, and use socket to send it. Dose the machine running tests have enough 
memory resource?

--
nosy:  -giampaolo.rodola, vstinner, xtreak

___
Python tracker 

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



[issue36341] bind() on AF_UNIX socket may fail in tests run as non-root

2019-03-18 Thread Xavier de Gaye


Change by Xavier de Gaye :


--
keywords: +patch
pull_requests: +12354
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



[issue36333] memory leaks detected with valgrind for python -V

2019-03-18 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
pull_requests: +12355

___
Python tracker 

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



[issue36337] Use socket.sendall()/send() send data larger than 2GB will be truncated and return None, without exception raised.

2019-03-18 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi @kmiku7, it's possible to write tests that use a large amount of memory and 
to run them only when asked to with bigmemtest: 
https://docs.python.org/3/library/test.html#test.support.bigmemtest

There is some tests that use it in the codebase like 
https://github.com/python/cpython/blob/1561703a78849ac3511055590d9d1bd2c62a2072/Lib/test/test_bz2.py#L646-L647

Creating a large string and sending it through a socket should be ok if you 
mark the test with this decorator.

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue36342] test_multiprocessing fails on platforms lacking a functioning sem_open

2019-03-18 Thread Xavier de Gaye


New submission from Xavier de Gaye :

test_multiprocessing fails on platforms lacking a functioning sem_open (Android 
for example) with:

==
ERROR: test_multiprocessing (test.test_venv.BasicTest)
--
Traceback (most recent call last):
  File "/data/local/tmp/python/lib/python3.8/test/test_venv.py", line 317, in 
test_multiprocessing
out, err = check_output([envpy, '-c',
  File "/data/local/tmp/python/lib/python3.8/test/test_venv.py", line 37, in 
check_output
raise subprocess.CalledProcessError(
subprocess.CalledProcessError: Command 
'['/data/local/tmp/python/tmp/tmpli0_hkdl/bin/python', '-c', 'from 
multiprocessing import Pool; 
print(Pool(1).apply_async("Python".lower).get(3))']' returned non-zero exit 
status 1.

--
components: Tests
messages: 338188
nosy: xdegaye
priority: normal
severity: normal
stage: needs patch
status: open
title: test_multiprocessing fails on platforms lacking a functioning sem_open
type: behavior
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



[issue36342] test_multiprocessing fails on platforms lacking a functioning sem_open

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

Are you sure that multiprocessing is the issue? On bpo-35978, the test fails 
because of venv, not because of multiprocessing. Can it be the same issue?

--
nosy: +vstinner

___
Python tracker 

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



[issue36297] Remove unicode_internal codec

2019-03-18 Thread Inada Naoki


Inada Naoki  added the comment:

I tried to remove all legacy API and wchar_t cache in unicodeobject.  This is 
experimental branch.
https://github.com/methane/cpython/pull/18/files


I'm thinking about adding configure option to remove them from 3.8.

* It may help people to find third party extensions using legacy API.
* Projects which doesn't use such third party extension can use this option to 
reduce some memory usage (8 byte for all unicode object).

--

___
Python tracker 

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



[issue36333] memory leaks detected with valgrind for python -V

2019-03-18 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
assignee:  -> vstinner

___
Python tracker 

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



[issue36333] memory leaks detected with valgrind for python -V

2019-03-18 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

I close the PR 12389 because it superseded by PR 12400 (only the fix for 
_PyRuntimeState_Fini).

--
assignee: vstinner -> 

___
Python tracker 

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



[issue36342] test_venv fails on Android with clang

2019-03-18 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

You are right, this is a duplicate of bpo-35978.
Closing as duplicate.

--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
title: test_multiprocessing fails on platforms lacking a functioning sem_open 
-> test_venv fails on Android with clang

___
Python tracker 

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



[issue23984] Documentation error: Descriptors

2019-03-18 Thread Carl Bordum Hansen


Change by Carl Bordum Hansen :


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

___
Python tracker 

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



[issue23984] Documentation error: Descriptors

2019-03-18 Thread Carl Bordum Hansen


Carl Bordum Hansen  added the comment:

I submitted a PR that addresses this and the next example, which also uses 
print unnecessarily.

To answer your last comment rhettinger; the preceding text tells you /why/ one 
might want to use a staticmethod:

"""
Good candidates for static methods are methods that do not reference the
``self`` variable.

For instance, a statistics package may include a container class for
experimental data.  The class provides normal methods for computing the average,
mean, median, and other descriptive statistics that depend on the data. However,
there may be useful functions which are conceptually related but do not depend
on the data.  For instance, ``erf(x)`` is handy conversion routine that comes up
in statistical work but does not directly depend on a particular dataset.
It can be called either from an object or the class:  ``s.erf(1.5) --> .9332`` 
or
``Sample.erf(1.5) --> .9332``.

Since staticmethods return the underlying function with no changes, the example
calls are unexciting::
"""

--
nosy: +carlbordum
versions: +Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue36307] Upgrade Travis CI config to Xenial from near-EoL Trusty and remove obsolete sudo: false key

2019-03-18 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 74ae50e53e59bbe39d6287b902757f0cd01327dc by Inada Naoki (CAM 
Gerlach) in branch 'master':
bpo-36307: Travis: upgrade to Xenial environment (GH-12356)
https://github.com/python/cpython/commit/74ae50e53e59bbe39d6287b902757f0cd01327dc


--
nosy: +inada.naoki

___
Python tracker 

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



[issue36329] use the right python "make -C Doc/ serve"

2019-03-18 Thread Julien Palard

Julien Palard  added the comment:


New changeset 09a9f1799c8c58f573c50cb2d526422436b8658b by Julien Palard 
(Stéphane Wirtel) in branch 'master':
bpo-36329: Declare the version of Python to use for Tools/scripts/serve.py 
(#12385)
https://github.com/python/cpython/commit/09a9f1799c8c58f573c50cb2d526422436b8658b


--
nosy: +mdk

___
Python tracker 

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



[issue36317] Typo in documentation of _PyObject_FastCallDict

2019-03-18 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
pull_requests: +12357

___
Python tracker 

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



[issue30040] Speedup empty dict creation and reduce its memory usage

2019-03-18 Thread Inada Naoki


Change by Inada Naoki :


--
title: new empty dict can be more small -> Speedup empty dict creation and 
reduce its memory usage

___
Python tracker 

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



[issue30040] Speedup empty dict creation and reduce its memory usage

2019-03-18 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 2ddc7f6d6223840c9971b36b30da4b3371d6e52b by Inada Naoki in branch 
'master':
bpo-30040: optimize inserting into empty dict (GH-12307)
https://github.com/python/cpython/commit/2ddc7f6d6223840c9971b36b30da4b3371d6e52b


--

___
Python tracker 

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



[issue35066] Inconsistency between dangling '%' handling in time.strftime() and datetime.strftime()

2019-03-18 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

The new test added by changeset 454b3d4ea246e8751534e105548d141ed7b0b032 fails 
on Android:

==
FAIL: test_strftime_trailing_percent (test.datetimetester.TestDate_Pure)
--
Traceback (most recent call last):
  File "/data/local/tmp/python/lib/python3.8/test/datetimetester.py", line 
1400, in test_strftime_trailing_percent
self.assertEqual(t.strftime('%'), '%')
AssertionError: '' != '%'
+ %

The implementation of strftime() on Android does not seem to be posix compliant:
>>> import time
>>> time.strftime('A%Q')
'AQ'
>>> time.strftime('%')
''

However the new test is not about testing posix compliance and the following 
patch fixes this test failure on Android while still testing that the changes 
made by this changeset cause a trailing '%' to not raise the exception anymore:

diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index 715f0ea6b4..ae1a97f0b4 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -1397,8 +1397,10 @@ class TestDate(HarmlessMixedComparison, 
unittest.TestCase):
 _time.strftime('%')
 except ValueError:
 self.skipTest('time module does not support trailing %')
-self.assertEqual(t.strftime('%'), '%')
-self.assertEqual(t.strftime("m:%m d:%d y:%y %"), "m:03 d:02 y:05 %")
+trailing_percent = _time.strftime('%')
+self.assertEqual(t.strftime('%'), trailing_percent)
+self.assertEqual(t.strftime("m:%m d:%d y:%y %"),
+ "m:03 d:02 y:05 %s" % trailing_percent)
 
 def test_format(self):
 dt = self.theclass(2007, 9, 10)

--
nosy: +xdegaye

___
Python tracker 

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



[issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set

2019-03-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12358

___
Python tracker 

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



[issue36343] Certificate added to Win Store not available

2019-03-18 Thread Christian Herdtweck

New submission from Christian Herdtweck :

I have created a self-signed certificate as my fake CA, used it to sign the 
certificate of my test server. I added the fake CA to the client (Windows 7) 
certificate store (System settings > Internet Settings > Content > 
Certificates), imported it there first only to "trusted root certificate 
authorities (translating from German "Vertrauenswürdige 
Stammzertifizierungsstellen" here), after failed tests to all tabs (including 
"own certificates", "intermediate certification authorities", but not the the 
"non-trusted issuers").

I can see my fake ca certificate in the lists in the windows settings, but 
querying the windows CA store through python (version 3.7), either through 
ssl.create_default_context().get_ca_certs() or ssl.enum_certificates(store) for 
store in ("CA", "ROOT", "MY") I only see some default builtin authorities 
(digicert, microsoft, comodo, verisign, etc).

This might be related to https://bugs.python.org/issue36011 . The related PR 
https://github.com/python/cpython/pull/11923 is now closed but I do not see the 
commit in master/3.7/feature-version branch. Was it dismissed?

I am aware there are options to add certificate files to SSL_CERT_DIR, but it 
is my understanding that python now uses the windows certificate store and that 
is where in my case the certificate should go.

--
assignee: christian.heimes
components: SSL
messages: 338198
nosy: christian-intra2net, christian.heimes
priority: normal
severity: normal
status: open
title: Certificate added to Win Store not available
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



[issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

Chih-Hsuan Yen: After this patch, test_distutils failed if $CPPFLAGS is not 
empty when building CPython.

Aha, more sysconfig configuration variables and environment variables should be 
mocked. I wrote PR 12403 to mock all variables. Would you mind to test and 
review it?

--

___
Python tracker 

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



[issue36343] Certificate added to Win Store not available

2019-03-18 Thread Christian Herdtweck


Christian Herdtweck  added the comment:

I should have added the behavioral result:

(1) opening my server's web (https, port 443) page using IE works fine without 
certificate questions/errors
(2) creating a ssl-wrapped socket to the server on the same port (443) fails 
with a Certificat error

--

___
Python tracker 

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



[issue36307] Upgrade Travis CI config to Xenial from near-EoL Trusty and remove obsolete sudo: false key

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

INADA-san: I would prefer to use the same OS to test Python 2.7 and 3.7. Are 
you ok to backport this change? (if it didn't break the CI yet? :-))

--

___
Python tracker 

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



[issue30040] Speedup empty dict creation and reduce its memory usage

2019-03-18 Thread Inada Naoki


Inada Naoki  added the comment:

I merged PR-12307 instead of PR-12308 because:

* PR-12308 adds much code, it makes difficult to maintain dict (I faced many 
SEGV while creating PR-12308)
* PR-12308 is based on PR-12307.  So they are not mutually exclusive.

And I close this issue because there are no more drawbacks about first 
insertion.
If you really hate `ma_keys == Py_EMPTY_KEYS` and prefer `ma_keys == NULL` to 
it, please reopen this issue and PR 12308.  I won't remove empty-dict3 branch 
for a while.

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



[issue36307] Upgrade Travis CI config to Xenial from near-EoL Trusty and remove obsolete sudo: false key

2019-03-18 Thread Inada Naoki


Inada Naoki  added the comment:

Ah, miss-islington is still broken...

I'll create backport PR manually if travis succeed to build master branch.
https://travis-ci.org/python/cpython/builds/507808242

--

___
Python tracker 

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



[issue36317] Typo in documentation of _PyObject_FastCallDict

2019-03-18 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 67294f64256a5cb29ca3c22d1a8d324e7ea177c6 by Victor Stinner (Rémi 
Lapeyre) in branch '3.7':
bpo-36317: Fix typo in _PyObject_FastCallDict documentation (GH-12383) 
(GH-12402)
https://github.com/python/cpython/commit/67294f64256a5cb29ca3c22d1a8d324e7ea177c6


--

___
Python tracker 

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



[issue36317] Typo in documentation of _PyObject_FastCallDict

2019-03-18 Thread STINNER Victor

STINNER Victor  added the comment:

https://github.com/python/cpython/pull/12383 has been merged into master:

commit b4b97af8bed21e32eb77e7f7497acde1f8af4e70
Author: Rémi Lapeyre 
Date:   Mon Mar 18 11:07:53 2019 +0100

Fix typo in _PyObject_FastCallDict documentation (GH-12383)

Thanks Rémi Lapeyre.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue36307] Upgrade Travis CI config to Xenial from near-EoL Trusty and remove obsolete sudo: false key

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

> Ah, miss-islington is still broken...

Right: https://github.com/python/miss-islington/issues/219

--

___
Python tracker 

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



[issue35066] Inconsistency between dangling '%' handling in time.strftime() and datetime.strftime()

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

Xavier de Gaye: That's why I asked to stop relying on the exact behavior of 
strftime() of the libc to get portable behavior :-/ See my previous comments.

IMHO the correct fix is to strip trailing % from the format string, call 
strftime() and then concatenate the trailing %.

--

___
Python tracker 

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



[issue31603] Please add argument to override stdin/out/err in the input builtin

2019-03-18 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

For reference, here's the link to the Python ideas thread:

https://mail.python.org/pipermail/python-ideas/2017-September/047230.html

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue36236] Python crash on macOS when CWD is invalid

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

> Omitting it from sys.path in that case makes sense to me, but I'm not sure 
> what sys.argv[0] should be set to.

I propose to use ".". It would be consistent with platforms which doesn't 
implement realpath:

if (have_module_arg) {
#if defined(HAVE_REALPATH) || defined(MS_WINDOWS)
_Py_wgetcwd(fullpath, Py_ARRAY_LENGTH(fullpath));
argv0 = fullpath;
n = wcslen(argv0);
#else
argv0 = L".";
n = 1;
#endif
}

And it defers the error handler to later. Example of Python 3 running in a 
removed directory:

$ python3
Python 3.7.2 (default, Jan 16 2019, 19:49:22) 
>>> import os
>>> os.getcwd()
FileNotFoundError: [Errno 2] No such file or directory

>>> os.path.abspath('.')
Traceback (most recent call last):
  File "/usr/lib64/python3.7/posixpath.py", line 383, in abspath
cwd = os.getcwd()
FileNotFoundError: [Errno 2] No such file or directory

I would prefer "." than "-m".

--

___
Python tracker 

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



[issue36307] Upgrade Travis CI config to Xenial from near-EoL Trusty and remove obsolete sudo: false key

2019-03-18 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +12359

___
Python tracker 

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



[issue36307] Upgrade Travis CI config to Xenial from near-EoL Trusty and remove obsolete sudo: false key

2019-03-18 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +12360

___
Python tracker 

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



[issue23984] Documentation error: Descriptors

2019-03-18 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

@carlbordum, thank you for the PR, but the original PR already addresses the 
issues.  In a code review message on that PR 
(https://github.com/python/cpython/pull/1034#pullrequestreview-32006381), 
@rhettinger commented on the removal of the print statement in the method call, 
which was addressed by the creator of that PR.  PR1034 was just waiting for 
final review and approval.

The difference between this and the print in the classmethod example is that 
having to two prints in this example resulted in output of:
  >>> E.f(3)
  3
  >>> print(E.f(3))
  3
  None

whereas the classmethod example doesn't have the issue of printing `None`.

I don't think the second PR is necessary.

--
nosy: +cheryl.sabella
versions:  -Python 3.4, 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



[issue36344] install_certificates.command too complicated, copy from pip's dir instead

2019-03-18 Thread Dmitrii Pasechnik


New submission from Dmitrii Pasechnik :

Currently (e.g. on the released Python 2.7.16) 
Mac/BuildScript/resources/install_certificates.command does install certifi 
module from the net and symlinks its cacert.pem to provide openssl with a 
working certificate. The same task may be accomplished much easier, by 
symlinking pip's cacert.pem, as follows (just shell commands, for the purposes 
of demonstration)

cd local/openssl
rm -f local/openssl/cert.pem
ln -s ../lib/python2.7/site-packages/pip/_vendor/certifi/cacert.pem cert.pem 

This works as pip's cacert.pem contains the same certificate as the one 
provided by unvendored certifi (as can be seen by looking at it using "openssl 
x509 -in ..." on it).

I'd be happy to provide a PR if this is acceptable.

--
components: macOS
messages: 338211
nosy: dimpase, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: install_certificates.command too complicated,  copy from pip's dir 
instead
type: enhancement
versions: Python 2.7

___
Python tracker 

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



[issue33875] Allow dynamic password evaluation in pypirc configuration file.

2019-03-18 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

I think there might be a need for a new function in the getpass module that 
fetch it from the operating system secure enclave, like KeyChain on OSX.

Currently there is no facility for storing secrets securely, the documentation 
of secrets says:

> Applications should not store passwords in a recoverable format, whether 
> plain text or encrypted.

but as far as I know there is no facility to save a secret when you actually 
need to get it back in plaintext.

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue36085] Enable better DLL resolution

2019-03-18 Thread Łukasz Langa

Łukasz Langa  added the comment:

Personally I am fine with Python 3.8 dropping Windows 7 support entirely if 
this makes it work better in Windows 8+. However, the 3 month overlap here 
would set a precedent that we don't have to adhere to self-imposed timing 
restrictions which is dangerous territory.

I think it's reasonable to leave Windows 7 support but *require* KB2533625 to 
be in. We've done similar things before on other platforms.

--

___
Python tracker 

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



[issue12622] failfast argument to TextTestRunner not documented

2019-03-18 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

I agree with @xtreak.  Closing this as a duplicate.

--
nosy: +cheryl.sabella
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Wrong signature of TextTestRunner's init function

___
Python tracker 

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



[issue36245] PCBuild/build.bat errors, probably from space characters in paths

2019-03-18 Thread Steve Dower


Steve Dower  added the comment:

For this one you're probably waiting on me to get time. I try to find an hour 
or two each week, depending on what releases are going on, but it can be a 
little unpredictable.

Zachary could also review and merge if he gets time first. I don't think anyone 
else is likely to look at this.

--
assignee:  -> steve.dower

___
Python tracker 

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



[issue35066] Inconsistency between dangling '%' handling in time.strftime() and datetime.strftime()

2019-03-18 Thread Michael Saah


Michael Saah  added the comment:

While I agree with Victor that reworking time.strftime to be more portable
is a great idea, this issue was never about that; it was about making
exception throwing behavior consistent across datetime's two strftime
implementations (python and C), and also bringing them into line with what
time.strftime does.

Xavier's bug shows that my test methodology didn't take into account the
range of libc strftime behavior. The patch proposed makes sense to me.

--

___
Python tracker 

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



[issue36333] memory leaks detected with valgrind for python -V

2019-03-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12361

___
Python tracker 

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



[issue27432] Unittest truncating of error message not works

2019-03-18 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

This one is a little more complicated, but I'm going to assign to @Mariatta for 
the sprints.

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



[issue36307] Upgrade Travis CI config to Xenial from near-EoL Trusty and remove obsolete sudo: false key

2019-03-18 Thread Inada Naoki


Inada Naoki  added the comment:

https://travis-ci.org/python/cpython/jobs/507821992
"pyenv: python3.7: command not found"

Hmm, `dist: xenial; group beta` seems not stable yet.
I'll try removing "group: beta" for stable build.

--

___
Python tracker 

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



[issue35066] Inconsistency between dangling '%' handling in time.strftime() and datetime.strftime()

2019-03-18 Thread Paul Ganssle


Paul Ganssle  added the comment:

I think the proposed change to the test will work, or we can mark the test as 
an expected failure on Android (on the theory that the test *should* work 
because we want the behavior normalized, but we are not living up to that).

In either case, I think a separate issue for normalizing the behavior of 
`strftime` across platforms would be good. I agree with Victor that the 
inconsistencies in libc are not a great experience for our users.

--

___
Python tracker 

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



[issue35066] Inconsistency between dangling '%' handling in time.strftime() and datetime.strftime()

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

> or we can mark the test as an expected failure on Android

No please, don't do that :-(

--

___
Python tracker 

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



[issue36327] Remove EOLed Py34 from "Status of Python branches"

2019-03-18 Thread Larry Hastings


Larry Hastings  added the comment:

Python 3.4.10 has not been released yet, and so it hasn't reached EOL yet, so 
this is jumping the gun a little.  All things in time.

--

___
Python tracker 

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



[issue35066] Inconsistency between dangling '%' handling in time.strftime() and datetime.strftime()

2019-03-18 Thread Paul Ganssle


Paul Ganssle  added the comment:

> No please, don't do that :-(

Interesting, I don't feel terribly strongly about it, but I would have thought 
that you'd be more in favor of that solution, maybe we have a different 
definition of "expected failure"?

Usually in my projects, I use xfail if I have *tests* for a bug, but no fix for 
it yet. The xfail-ing test serves two purposes: 1. it notifies me if the bug is 
incidentally fixed (so that I can remove the xfail and it becomes a regression 
test, and I close the bug report) and 2. it allows me to encode acceptance 
criteria for fixing the bug directly into the test suite.

I do personally like the idea of separate tests for "is this consistent across 
platforms" and "does this throw an error", but it is true that once it's 
possible to pass the consistency test it *also* serves as a test that no errors 
are thrown.

--

___
Python tracker 

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



[issue36332] compile() error on AST object with assignment expression

2019-03-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 0c9258a6d299e0484538ef8d4b23f30515283db2 by Pablo Galindo in 
branch 'master':
bpo-36332: Allow compile() to handle AST objects with assignment expressions 
(GH-12398)
https://github.com/python/cpython/commit/0c9258a6d299e0484538ef8d4b23f30515283db2


--

___
Python tracker 

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



[issue36332] compile() error on AST object with assignment expression

2019-03-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue36345] Deprecate Tools/scripts/serve.py in favour of python -m http.server -d

2019-03-18 Thread Stéphane Wirtel

New submission from Stéphane Wirtel :

The Makefile of Doc/ has a `serve` target. Currently, this one uses 
`Tools/scripts/serve.py`. But since 3.7, this script could be replaced by 
`python -m http.server -d directory`.

@mdk and myself thinking we could deprecate `Tools/scripts/serve.py` with a 
warning and propose to use `-m http.server -d directory`

--
assignee: docs@python
components: Documentation
messages: 338224
nosy: docs@python, matrixise
priority: normal
severity: normal
status: open
title: Deprecate Tools/scripts/serve.py in favour of python -m http.server -d
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



[issue36345] Deprecate Tools/scripts/serve.py in favour of python -m http.server -d

2019-03-18 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
nosy: +mdk

___
Python tracker 

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



[issue36337] Use socket.sendall()/send() send data larger than 2GB will be truncated and return None, without exception raised.

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

@kmiku7: Did you find this issue in production or while testing Python? Or did 
you spot the idea while reading Python source code?

--
nosy: +vstinner

___
Python tracker 

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



[issue36337] Use socket.sendall()/send() send data larger than 2GB will be truncated and return None, without exception raised.

2019-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

> Because I am not familiar about how to contribute a patch, I doubt it's 
> reasonable to write a test which will consuming more than 2GB memory space? 
> Because if write a test to cover this case, we will build a string larger 
> than 2GB, and use socket to send it. Dose the machine running tests have 
> enough memory resource?

Most computers have at least 4 GB of memory. It would be possible to write a 
"bigmem" test which build a string longer than 2 GiB, send it and check the 
received length, but I'm not sure that it's worth it: there is no such test in 
the master branch.

--

___
Python tracker 

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



[issue36345] Deprecate Tools/scripts/serve.py in favour of python -m http.server -d

2019-03-18 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


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

___
Python tracker 

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



[issue36272] Recursive logging crashes Interpreter in Python 3

2019-03-18 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 6a7a9f1d83cef628d2bacd71ee568b93f53fd6b4 by Vinay Sajip (Miss 
Islington (bot)) in branch '3.7':
bpo-36272: Logging now propagates RecursionError (GH-12312) (GH-12391)
https://github.com/python/cpython/commit/6a7a9f1d83cef628d2bacd71ee568b93f53fd6b4


--

___
Python tracker 

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



[issue36346] Prepare for removing the legacy Unicode C API

2019-03-18 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The legacy Unicode C API was deprecated in 3.3. Its support consumes resources: 
more memory usage by Unicode objects, additional code for handling Unicode 
objects created with the legacy C API. Currently every Unicode object has a 
cache for the wchar_t representation.

The proposed PR adds two compile time options: HAVE_UNICODE_WCHAR_CACHE and 
USE_UNICODE_WCHAR_CACHE. Both are set to 1 by default.

If USE_UNICODE_WCHAR_CACHE is set to 0, CPython will not use the wchar_t cache 
internally. The new wchar_t based C API will be used instead of the Py_UNICODE 
based C API. This can add small performance penalty for creating a temporary 
buffer for the wchar_t representation. On other hand, this will decrease the 
long-term memory usage. This build is binary compatible with the standard build 
and third-party extensions can use the legacy Unicode C API.

If HAVE_UNICODE_WCHAR_CACHE is set to 0, the wchar_t cache will be completely 
removed. The legacy Unicode C API will be not available, and functions that 
need it (e.g. PyArg_ParseTuple() with the "u" format unit) will always fail. 
This build is binary incompatible with the standard build if you use the legacy 
or non-stable Unicode C API.

I hope that these options will help third-party projects to prepare for 
removing the legacy Unicode C API in future.

--
components: Interpreter Core, Unicode
messages: 338228
nosy: ezio.melotti, inada.naoki, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Prepare for removing the legacy Unicode C API
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



[issue36272] Recursive logging crashes Interpreter in Python 3

2019-03-18 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.6

___
Python tracker 

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



[issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set

2019-03-18 Thread Chih-Hsuan Yen


Chih-Hsuan Yen  added the comment:

STINNER Victor: Thank you very much for that much better fix! I've tested it on 
Arch Linux. With that patch, test_distutils passes as usual. The pull request 
looks good, too. Just a question: I think it should be backported to 3.7 and 
2.7 branches like https://github.com/python/cpython/pull/12236?

--

___
Python tracker 

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



[issue36346] Prepare for removing the legacy Unicode C API

2019-03-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue36211] show full url when execute "make -C Doc/ serve"

2019-03-18 Thread Julien Palard


Change by Julien Palard :


--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Deprecate Tools/scripts/serve.py in favour of python -m 
http.server -d

___
Python tracker 

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



[issue29515] socket module missing IPPROTO_IPV6, IPPROTO_IPV4 on Windows

2019-03-18 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

I'd like to move forward with this in order to fix issue17561. If there are no 
complaints I'm gonna merge this in ~ a week.

--

___
Python tracker 

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



[issue36318] Adding support for setting the "disabled" attribute of loggers from logging.config.dictConfig

2019-03-18 Thread Vinay Sajip


Vinay Sajip  added the comment:

> Actually people do this all the time, to deactivate the logging of some 
> third-party libraries (me included).

It would be better to set the level of those loggers to e.g. ERROR or CRITICAL 
rather than disabling them altogether - presumably if something bad happens in 
those packages, one would want to know!

> In addition, all public attributes ... can be set from 
> `logging.config.dictConfig`, except the `disabled` attribute, which is 
> inconsistent.

I don't especially want people to use `disabled` for this type of thing - the 
main reason for having it is that following an on-the-fly reconfiguration in a 
long-running process, some threads might still be active that contain 
references to now-unwanted loggers, and disabling makes those references 
inactive without the need to track them down. I would recommend using e.g. 
CRITICAL as a level for the use case you mention.

--

___
Python tracker 

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



[issue36347] Add the constant READWRITE for PyMemberDef

2019-03-18 Thread Stéphane Wirtel

New submission from Stéphane Wirtel :

When we define some members with PyMemberDef, we have to specify the flag for 
read-write or read-only. 

static PyMemberDef members[] = {
{"name", T_OBJECT, offsetof(MyObject, name), 0, "Name object"},
{NULL}  // Sentinel
};

For a newcomer, when you read the doc, you don't know the meaning of `0` and 
you want to know, of course you read the code and sometimes you can find 
READONLY or `0`.

I would like to add a new constant for `0` and name it `READWRITE`.

static PyMemberDef members[] = {
{"name", T_OBJECT, offsetof(MyObject, name), READWRITE, "Name object"},
{NULL}  // Sentinel
};

--
components: Interpreter Core
messages: 338232
nosy: matrixise
priority: normal
severity: normal
status: open
title: Add the constant READWRITE for PyMemberDef
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



[issue36347] Add the constant READWRITE for PyMemberDef

2019-03-18 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


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

___
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-03-18 Thread STINNER Victor


New submission from STINNER Victor :

https://buildbot.python.org/all/#/builders/21/builds/2512

==
FAIL: test_logout (test.test_imaplib.RemoteIMAP_STARTTLSTest)
--
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/test_imaplib.py",
 line 946, in test_logout
self.assertEqual(rs[0], 'BYE')
AssertionError: 'NO' != 'BYE'
- NO
+ BYE


The logout() returns 'NO' if *any* exception is raised:

try: typ, dat = self._simple_command('LOGOUT')
except: typ, dat = 'NO', ['%s: %s' % sys.exc_info()[:2]]

Attached PR proposes a fix.

--
components: Library (Lib)
messages: 338233
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_imaplib.RemoteIMAP_STARTTLSTest.test_logout() fails randomly
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



[issue36349] Including parentheses in a regular expression pattern enclosed by literal square bracket characters cause the square brackets not to be matched

2019-03-18 Thread Farbod Safe


New submission from Farbod Safe :

Below two print statements should give the same results but they don't:

import re

s = '[a]'

print(*re.findall(r'\[.*]',s))
[a]

print(*re.findall(r'\[(.*)]',s))
a

--
messages: 338234
nosy: Farbod Safe2
priority: normal
severity: normal
status: open
title: Including parentheses in a regular expression pattern enclosed by 
literal square bracket characters cause the square brackets not to be matched
type: behavior
versions: Python 3.6

___
Python tracker 

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



  1   2   3   >