[issue35257] Avoid leaking linker flags into distutils: add PY_LDFLAGS_NODIST

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

New changeset 92f90242994652d6b7afe0a2c8a61cf2bccc8c32 by Ned Deily (Miss 
Islington (bot)) in branch '3.7':
bpo-35257: fix broken BLDSHARED - needs LDFLAGS too (GH-11297)
https://github.com/python/cpython/commit/92f90242994652d6b7afe0a2c8a61cf2bccc8c32

Since Ned pushed a new fix, I ran again my tests on the 3.7 branch with 
./configure CC=clang --with-lto --prefix /opt/py37 --enable-shared:

(1) 4 => ok
(2) 0, False => ok
(3) 0 => ok

Good! It works (in my tests).

--

"make sharedmods" runs "LDSHARED=$BLDSHARED (...) ./python setup.py build"

"make libpython(...)" uses $(BLDSHARED) to link libpython.

Modules/makesetup uses BLDSHARED to build C extensions of the stdlib. Example 
from generated Makefile:

"Modules/posix$(EXT_SUFFIX): Modules/posixmodule.o; $(BLDSHARED) 
Modules/posixmodule.o -o Modules/posix$(EXT_SUFFIX) (...)"

distutils has a customize_compiler() function which uses LDSHARED from Makefile 
(can be overriden by environment variables): it doesn't use BLDSHARED.

It seems like BLDSHARED is only used to build Python itself and stdlib modules. 
So I agree that it's ok to add PY_LDFLAGS_NODIST flags to BLDSHARED.

--

___
Python tracker 

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



[issue35678] Issue with execute_child in startupinfo

2019-01-07 Thread MaximilianSP


New submission from MaximilianSP :

Whenever startupinfo is called, python crashes on my Computer. I have added the 
file showing the error traceback. I have seen a few bug Reports related to 
startupinfo on Windows. Not sure what the issue is and I hope you can help me. 

I am running the python code via spyder. My apologies if this is not the forum 
for these Kind of questions.

--
components: Windows
files: Win Error 87_ in execute child startupinfo.png
messages: 333147
nosy: MaximilianSP, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Issue with execute_child in startupinfo
type: crash
versions: Python 3.7
Added file: https://bugs.python.org/file48027/Win Error 87_ in execute child 
startupinfo.png

___
Python tracker 

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



[issue32592] Drop support of Windows Vista in Python 3.7

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

> I failed to fix failures on my PR. It's now too late for Python 3.7.

I will try to redo PR 5231 in small chunks to better control the risk. I 
extracted os.cpu_count() changed as a new PR: PR 11457.

I already updated time.monotonic() documentation in a previous change:

commit 3ab064e80a9be1e6e9c62437fffb92bde9c5e1fb
Author: Victor Stinner 
Date:   Mon Dec 17 12:12:34 2018 +0100

bpo-23451: Update time.monotonic() documentation (GH-11190)

bpo-23451, bpo-22117: Python 3.5 requires Windows Vista or newer,
time.monotonic() is now always system-wide.

--

___
Python tracker 

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



[issue32592] Drop support of Windows Vista in Python 3.7

2019-01-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10927
stage: resolved -> patch review

___
Python tracker 

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



[issue32592] Drop support of Windows Vista in Python 3.7

2019-01-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10927, 10928
stage: resolved -> patch review

___
Python tracker 

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



[issue32592] Drop support of Windows Vista in Python 3.7

2019-01-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10927, 10928, 10929
stage: resolved -> patch review

___
Python tracker 

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



[issue35676] unittest assert helper methods have incorrect signature in docs

2019-01-07 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. Looking at git history it seems there were some changes 
done in issue10573 to use (actual, expected) for consistency and later changed 
to use (first, second) in the same issue at msg126911. Discussion for the issue 
: https://mail.python.org/pipermail/python-dev/2010-December/106875.html

I think this is a bug as seen from typeshed 
https://github.com/python/typeshed/pull/2724/. But I will defer it to the 
maintainer to take a call on the same given there was a discussion in the past.

Removing versions that are on security fix only mode. I am changing the 
subject. Feel free to reword/revert.

--
nosy: +ezio.melotti, xtreak
title: class TestCase: docs are not correct -> unittest assert helper methods 
have incorrect signature in docs
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



[issue30170] "tests may fail, unable to create temporary directory" warning on buildbot: add a cleanup step to buildbots

2019-01-07 Thread Jorge Ramos


Jorge Ramos  added the comment:

I got this error trying to build Python 3.6.7, why is this closed?

Running PGInstrument|x64 interpreter...
E:\RepoGiT\3.6\lib\test\support\__init__.py:1029: RuntimeWarning: tests may 
fail, unable to create temp dir: 
D:\Users\yorch\AppData\Local\Temp\test_python_15660
  with temp_dir(path=name, quiet=quiet) as temp_path:
Run tests sequentially

--
nosy: +neyuru

___
Python tracker 

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



[issue35678] subprocess.check_output(): OSError: [WinError 87]

2019-01-07 Thread MaximilianSP


MaximilianSP  added the comment:

Thank you for the input Victor. I will need a little time to dig in the code 
and check the attributes. I am fairly new to python :)

You are right that the code doesn't crash. Just I cannot continue with the 
following steps. That is why I thought it crashed.

--

___
Python tracker 

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



[issue35633] test_eintr fails on AIX since fcntl functions were modified

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

Since you are getting indentation error, I'm not sure about your test. Can you 
please apply the patch below and run again test_eintr? Does it still fail with 
PermissionError?

diff --git a/Lib/test/eintrdata/eintr_tester.py 
b/Lib/test/eintrdata/eintr_tester.py
index 25c169bde5..4db5dc9045 100644
--- a/Lib/test/eintrdata/eintr_tester.py
+++ b/Lib/test/eintrdata/eintr_tester.py
@@ -492,13 +492,13 @@ class FNTLEINTRTest(EINTRBaseTest):
 self.addCleanup(support.unlink, support.TESTFN)
 code = '\n'.join((
 "import fcntl, time",
-"with open('%s', 'wb') as f:" % support.TESTFN,
+"with open('%s', 'w+b') as f:" % support.TESTFN,
 "   fcntl.%s(f, fcntl.LOCK_EX)" % lock_name,
 "   time.sleep(%s)" % self.sleep_time))
 start_time = time.monotonic()
 proc = self.subprocess(code)
 with kill_on_error(proc):
-with open(support.TESTFN, 'wb') as f:
+with open(support.TESTFN, 'w+b') as f:
 while True:  # synchronize the subprocess
 dt = time.monotonic() - start_time
 if dt > 60.0:

--

___
Python tracker 

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



[issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive"

2019-01-07 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +10931, 10932, 10933

___
Python tracker 

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



[issue35560] format(float(123), "00") causes segfault in debug builds

2019-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset 9a413faa8708e5c2df509e97d48f18685c198b24 by Miss Islington (bot) 
in branch '3.7':
bpo-35560: Remove assertion from format(float, "n") (GH-11288)
https://github.com/python/cpython/commit/9a413faa8708e5c2df509e97d48f18685c198b24


--
nosy: +miss-islington

___
Python tracker 

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



[issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive"

2019-01-07 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +10931, 10932

___
Python tracker 

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



[issue34522] PyTypeObject's tp_base initialization bug

2019-01-07 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



[issue35680] [2.7] Coverity scan: Passing freed pointer "name" as an argument to "Py_BuildValue" in _bsddb module.

2019-01-07 Thread Charalampos Stratakis


New submission from Charalampos Stratakis :

Results from a recent static analysis scan for python2:

Error: USE_AFTER_FREE (CWE-825):
Python-2.7.15/Modules/_bsddb.c:6697: freed_arg: "free" frees "name".
Python-2.7.15/Modules/_bsddb.c:6715: pass_freed_arg: Passing freed pointer 
"name" as an argument to "Py_BuildValue".

6713|   RETURN_IF_ERR();  /* Maybe the size is not the problem */
6714|   
6715|-> retval = Py_BuildValue("s", name);
6716|   free(name);
6717|   return retval;

Attaching a draft patch.

--
components: Extension Modules
files: bsddb_fix.patch
keywords: patch
messages: 333176
nosy: cstratak
priority: normal
severity: normal
status: open
title: [2.7] Coverity scan: Passing freed pointer "name" as an argument to 
"Py_BuildValue" in _bsddb module.
versions: Python 2.7
Added file: https://bugs.python.org/file48028/bsddb_fix.patch

___
Python tracker 

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



[issue35664] Optimize itemgetter()

2019-01-07 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 2d53bed79c1953390f85b191c72855e457e09305 by Raymond Hettinger in 
branch 'master':
bpo-35664: Optimize operator.itemgetter (GH-11435)
https://github.com/python/cpython/commit/2d53bed79c1953390f85b191c72855e457e09305


--

___
Python tracker 

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



[issue35664] Optimize itemgetter()

2019-01-07 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



[issue35678] subprocess.check_output(): OSError: [WinError 87]

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

"Issue with execute_child in startupinfo"

I don't think that the issue is related to startupinfo at all, since you don't 
specify this parameter in your check_output() call. Python shows you 
"startupinfo)" in the traceback because the function call takes multiple lines 
in the source code.

This issue is not a crash: it's possible to catch the exception and continue 
the execution.

--
title: Issue with execute_child in startupinfo -> subprocess.check_output(): 
OSError: [WinError 87]
type: crash -> 

___
Python tracker 

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



[issue35662] Windows #define _PY_EMULATED_WIN_CV 0 bug

2019-01-07 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



[issue32592] Drop support of Windows Vista in Python 3.7

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

Hello 2018, I reopen the issue and change the version to Python 3.8.

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



[issue35560] format(float(123), "00") causes segfault in debug builds

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Karthikeyan Singaravelan for the bug report and the fix!

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



[issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute

2019-01-07 Thread Christian Heimes


Christian Heimes  added the comment:

The certs are coming from Windows' trust store. Could you please dump the trust 
store for me and attach the result to the bug tracker. The following script is 
untested but should work. I don't have access to a Windows machine at the 
moment.

ctx = ssl.SSLContext(ssl.PROTOCOL_TLS)
certs = []
for storename in ("CA", "ROOT"):
certs.append(storename)
for cert, encoding, trust in ssl.enum_certificates(storename):
if encoding == "x509_asn":
if trust is True or ssl.Purpose.SERVER_AUTH.oid in trust:
try:
ctx.load_verify_locations(cadata=cert)
except Exception as e:
certs.append(str(e))
certs.append(ssl.DER_cert_to_PEM_cert(cert))

with open('cacerts.pem', 'w') as f:
f.write('\n'.join(certs))

--

___
Python tracker 

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



[issue35671] reserved identifier violation

2019-01-07 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

See: 


Basically all names starting with double underscores are reserved for the 
implementation in C++. Likewise for all names starting with an underscore when 
defining globals (such as function names).

IIRC C has similar rules for double underscores and for underscore followed by 
an uppercase letter, but I don't have a handy reference for those.

In general Python's use of these symbols should be safe enough, it is highly 
unlikely that a C/C++ implementation uses names starting with "_Py" even if 
those are reserved for the implementation.

@elfring: Do you run into actual problems due to Python's use of these 
identifiers?

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue35678] Issue with execute_child in startupinfo

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

The screenshot says "OSError: [WinError 87] Falscher Parameter" at 
Lib/subprocess.py:1178 which is this call:

hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
 # no special security
 None, None,
 int(not close_fds),
 creationflags,
 env,
 os.fspath(cwd) if cwd is not None else 
None,
 startupinfo)

According to the traceback, the call is:

subprocess.check_output([execStr,"-3",self.geofile,"-o",self.vtkFile])

Can you please dump these parameters? Are they all strings?

IMHO execStr, self.geofile or self.vtkFile is not a valid string and it's a bug 
in your code.

Context:

* bpo-34044
* commit 29be3bd3c9aed0190e60096a603120cacda82375
* Comments on the commit: 
https://github.com/python/cpython/commit/29be3bd3c9aed0190e60096a603120cacda82375#commitcomment-31855236

--
nosy: +vstinner

___
Python tracker 

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



[issue35624] Shelve sync issues while using Gevent

2019-01-07 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



[issue35381] posixmodule: convert statically allocated types (DirEntryType & ScandirIteratorType) to heap-allocated types

2019-01-07 Thread STINNER Victor


Change by STINNER Victor :


--
title: Heap-allocated posixmodule types -> posixmodule: convert statically 
allocated types (DirEntryType & ScandirIteratorType) to heap-allocated  types

___
Python tracker 

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



[issue35550] Some define guards for Solaris are wrong

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

Do you want to fix the 2.7 branch as well?

--
nosy: +vstinner

___
Python tracker 

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



[issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive"

2019-01-07 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +10931

___
Python tracker 

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



[issue30170] "tests may fail, unable to create temporary directory" warning on buildbot: add a cleanup step to buildbots

2019-01-07 Thread Jorge Ramos


Jorge Ramos  added the comment:

May I add that this directory exists, maybe before this run tried to create it 
and hence not being able to do it as the first post suggested?

--

___
Python tracker 

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



[issue35671] reserved identifier violation

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

__DYNAMIC_ANNOTATIONS_H__ can be replaced with PY_DYNAMIC_ANNOTATIONS_H.

I don't understand why _Py_memory_order and only _Py_memory_order is a problem. 
We have tons of symbols starting with _Py: functions, defines, variables, etc.

--

___
Python tracker 

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



[issue35677] Do not automount in stat() by default

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

What if someone relies on the current behavior of os.stat(filename, dir_fd=fd)? 
Would it make sense to add a new "automount=False" optional parameter to 
os.stat()? AT_NO_AUTOMOUNT would only be added if automount is false.

--
nosy: +vstinner

___
Python tracker 

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



[issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive"

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

I suggest to start with:

* Updating docstrings to recommend use is_alive() instead of isAlive(), and add 
a deprecation warning for Thread.isAlive

We may apply such changes to Python 3.7, maybe also emit a 
PendingDeprecationWarning.

--
nosy: +vstinner

___
Python tracker 

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



[issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

> self.load_verify_locations(cadata=certs)
> ...
> ssl.SSLError: nested asn1 error (_ssl.c:3926)

It seems like one of your certificate is invalid.

> In Python 3.6.4 same function call raises no error.

We frequently update OpenSSL in Python. You can get OpenSSL version using:

$ python3
Python 3.7.2 (default, Jan  3 2019, 09:14:01) 
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.1.1 FIPS  11 Sep 2018'
>>> ssl.OPENSSL_VERSION_INFO
(1, 1, 1, 0, 15)
>>> ssl.OPENSSL_VERSION_NUMBER
269488143
>>> hex(ssl.OPENSSL_VERSION_NUMBER)
'0x1010100f'

--
nosy: +vstinner

___
Python tracker 

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



[issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

Would it be possible to attach the certification to the issue so someone can 
try to reproduce the issue? (but don't attach any private key ;-))

--

___
Python tracker 

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



[issue35560] format(float(123), "00") causes segfault in debug builds

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3f7983a25a3d19779283c707fbdd5bc91b1587ef by Victor Stinner 
(Xtreak) in branch 'master':
bpo-35560: Remove assertion from format(float, "n") (GH-11288)
https://github.com/python/cpython/commit/3f7983a25a3d19779283c707fbdd5bc91b1587ef


--

___
Python tracker 

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



[issue35560] format(float(123), "00") causes segfault in debug builds

2019-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10930

___
Python tracker 

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



[issue35283] "threading._DummyThread" redefines "is_alive" but forgets "isAlive"

2019-01-07 Thread Dong-hee Na


Dong-hee Na  added the comment:

@vstinner
Thanks, I've submitted PR 11459 for 3.7 which emit PendingDeprecationWarning.

--

___
Python tracker 

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



[issue35218] decompressing and then re-compressing zipfiles with Python 3 zipfile loses flag_bits

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

Hi,

> I'm unable to fill in your contributor agreement form

Is there a specific reason why you cannot fill it?

If you cannot cannot fill it, can someone else convert your patch into a PR?

--
nosy: +vstinner

___
Python tracker 

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



[issue35680] [2.7] Coverity scan: Passing freed pointer "name" as an argument to "Py_BuildValue" in _bsddb module.

2019-01-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There is no bug here. "name" is freed only when err == EINVAL. And the 
RETURN_IF_ERR() macro will return from the function if err != 0. So that a 
freed pointer will never passed to Py_BuildValue().

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31450] Subprocess exceptions re-raised in parent process do not have child_traceback attribute

2019-01-07 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue33084] Computing median, median_high an median_low in statistics library

2019-01-07 Thread Jonathan Fine


Jonathan Fine  added the comment:

Based on a quick review of the python docs, the bug report, PEP 450
and this thread, I suggest

1. More carefully draw attention to the NaN feature, in the
documentation for existing Python versions.
2. Consider revising statistics.py so that it raises an exception,
when passed NaN data.

This implies dividing this issue into two parts: legacy and future.

For more information, see:
https://mail.python.org/pipermail/python-ideas/2019-January/054872.html

--
nosy: +jfine2358

___
Python tracker 

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



[issue4926] putenv() accepts names containing '=', return value of unsetenv() not checked

2019-01-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The original issues seem fixed.

As for leaks in posix_putenv_garbage on Windows, it is better to open a new 
issue for this.

--
status: open -> pending

___
Python tracker 

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



[issue17703] Trashcan mechanism segfault during interpreter finalization in Python 2.7.4

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

This issue is closed. Can you please open a new issue? Try to describe the bug 
that you have and what you attemped to fix it.

--

___
Python tracker 

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



[issue35679] pdb restart hooks

2019-01-07 Thread Hernot


New submission from Hernot :

I like the PDB debugger it is a quite powerfull tool, despite a few donws. One 
is that cleanup code eg registered by debugged script, module is not executed 
on restart. a crude hack is to check whether pdb is invoked via python -mpdb 
using inspect and decorate pdb._runscript and psb._runmodule methods with own 
versions calling registered cleanup methods before returning to main.

A cleaner approach would be if either pdb intercepts atexit calls recording any 
method which is registered by a call to atexit.register or provide it's own 
atexit method to register methods which pdb should call to revert to a clean 
enviroment expected by the script or module at startup.

open to any discussion, examples will follow as necessary.

--
components: Demos and Tools, Library (Lib)
messages: 333150
nosy: Hernot
priority: normal
severity: normal
status: open
title: pdb restart hooks
type: enhancement

___
Python tracker 

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



[issue34431] Docs does not eval allows code object as argument

2019-01-07 Thread Jonathan Fine


Jonathan Fine  added the comment:

This graceful reminder is most welcome. At present, it's not help I'm short of, 
but time. I've given myself a reminder, to spend time on this before the end of 
this month (January 2019).

Once again, thank you for this reminder. This is something I want to do. It 
would be my first Python contribution.

--

___
Python tracker 

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



[issue34173] [3.7] deadlock in /usr/lib/python3.7/concurrent/futures/thread.py

2019-01-07 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the info. I am closing it as third party.

--
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue34173] [3.7] deadlock in /usr/lib/python3.7/concurrent/futures/thread.py

2019-01-07 Thread Corey Bryant


Corey Bryant  added the comment:

I think we can close this issue. It was narrowed down to eventlet. Please
see: https://github.com/eventlet/eventlet/issues/508

On Tue, Jul 24, 2018 at 1:54 PM Karthikeyan Singaravelan <
rep...@bugs.python.org> wrote:

>
> Karthikeyan Singaravelan  added the comment:
>
> Sorry for the noise about the title change. It seems you have edited it
> while I was typing my comment. There was a form error while I tried submit
> but I ignored it to try again and it had set my title. I have reverted back
> to your edit.
>
> Thanks
>
> --
> title: [3.7] possible race condition in
> /usr/lib/python3.7/concurrent/futures/thread.py -> [3.7] deadlock in
> /usr/lib/python3.7/concurrent/futures/thread.py
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue35680] [2.7] Coverity scan: Passing freed pointer "name" as an argument to "Py_BuildValue" in _bsddb module.

2019-01-07 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

Indeed it's not a bug per se, more like code readability issue, if however it's 
not deemed as an issue, it can be closed.

--

___
Python tracker 

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



[issue2506] Add mechanism to disable optimizations

2019-01-07 Thread Arthur Goldberg


Arthur Goldberg  added the comment:

This issue is well into the 2nd decade of debate.

Who has the power to effect this change?

Happy New Year
Arthur

--

___
Python tracker 

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



[issue35672] Error on divide

2019-01-07 Thread Guido van Rossum


Guido van Rossum  added the comment:

For reference, the OP reported the issue initially at 
https://github.com/python/psf-infra-meta/issues/17 (but it was closed because 
that's not the right tracker).

The y1y2y3y4 etc. are multiplications (mangled by not quoting the code in 
GitHub and then copy/paste from the rendered code).

--
nosy: +gvanrossum

___
Python tracker 

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



[issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute

2019-01-07 Thread Christian Heimes


Christian Heimes  added the comment:

Your Windows cert store contains multiple invalid certificates. The first 
failing certificate is the custom "MUPCA Root", which looks like a certificate 
from http://ca.mup.gov.rs/sertifikati.html. The serial number seems to be badly 
formated or padded. There is nothing we can do about erroneous and bad 
certificates.

$ openssl x509 -in ca.pem 
unable to load certificate
140613019477824:error:0D0E20DD:asn1 encoding routines:c2i_ibuf:illegal 
padding:crypto/asn1/a_int.c:187:
140613019477824:error:0D08303A:asn1 encoding 
routines:asn1_template_noexp_d2i:nested asn1 
error:crypto/asn1/tasn_dec.c:627:Field=serialNumber, Type=X509_CINF
140613019477824:error:0D08303A:asn1 encoding 
routines:asn1_template_noexp_d2i:nested asn1 
error:crypto/asn1/tasn_dec.c:627:Field=cert_info, Type=X509
140613019477824:error:0906700D:PEM routines:PEM_ASN1_read_bio:ASN1 
lib:crypto/pem/pem_oth.c:33:

$ openssl asn1parse -in ca.pem  
0:d=0  hl=4 l=1300 cons: SEQUENCE  
4:d=1  hl=4 l= 764 cons: SEQUENCE  
8:d=2  hl=2 l=   3 cons: cont [ 0 ]
   10:d=3  hl=2 l=   1 prim: INTEGER   :02
   13:d=2  hl=2 l=   4 prim: INTEGER   :BAD INTEGER:[0066]
   19:d=2  hl=2 l=  13 cons: SEQUENCE  
   21:d=3  hl=2 l=   9 prim: OBJECT:sha1WithRSAEncryption
   32:d=3  hl=2 l=   0 prim: NULL  
   34:d=2  hl=2 l=  83 cons: SEQUENCE  
   36:d=3  hl=2 l=  19 cons: SET   
   38:d=4  hl=2 l=  17 cons: SEQUENCE  
   40:d=5  hl=2 l=   3 prim: OBJECT:commonName
   45:d=5  hl=2 l=  10 prim: UTF8STRING:MUPCA Root
   57:d=3  hl=2 l=  29 cons: SET   
   59:d=4  hl=2 l=  27 cons: SEQUENCE  
   61:d=5  hl=2 l=   3 prim: OBJECT:organizationName
   66:d=5  hl=2 l=  20 prim: UTF8STRING:MUP Republike Srbije
   88:d=3  hl=2 l=  16 cons: SET   
   90:d=4  hl=2 l=  14 cons: SEQUENCE  
   92:d=5  hl=2 l=   3 prim: OBJECT:localityName
   97:d=5  hl=2 l=   7 prim: UTF8STRING:Beograd
  106:d=3  hl=2 l=  11 cons: SET   
  108:d=4  hl=2 l=   9 cons: SEQUENCE  
  110:d=5  hl=2 l=   3 prim: OBJECT:countryName
  115:d=5  hl=2 l=   2 prim: PRINTABLESTRING   :RS
  119:d=2  hl=2 l=  30 cons: SEQUENCE  
  121:d=3  hl=2 l=  13 prim: UTCTIME   :100227161918Z
  136:d=3  hl=2 l=  13 prim: UTCTIME   :200227161918Z
  ...

$ wget http://ca.mup.gov.rs/MUPCARoot.crt
$ openssl x509 -in MUPCARoot.crt -inform DER
unable to load certificate
140699773712192:error:0D0E20DD:asn1 encoding routines:c2i_ibuf:illegal 
padding:crypto/asn1/a_int.c:187:
140699773712192:error:0D08303A:asn1 encoding 
routines:asn1_template_noexp_d2i:nested asn1 
error:crypto/asn1/tasn_dec.c:627:Field=serialNumber, Type=X509_CINF
140699773712192:error:0D08303A:asn1 encoding 
routines:asn1_template_noexp_d2i:nested asn1 
error:crypto/asn1/tasn_dec.c:627:Field=cert_info, Type=X509

--

___
Python tracker 

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



[issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute

2019-01-07 Thread Vladimir Perić

Vladimir Perić  added the comment:

Public Certificate file cert.pem is attached.

Version of ssl lib in pythons on my machine:
Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.1.0j  20 Nov 2018'

Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.2q  20 Nov 2018'

--
Added file: https://bugs.python.org/file48029/cacerts.pem

___
Python tracker 

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



[issue35671] reserved identifier violation

2019-01-07 Thread Markus Elfring


Markus Elfring  added the comment:

* How do you think about to reduce the tampering with the reserved name space 
in mentioned source code (and also in related components)?
* Would you like to avoid that this software depends on undefined behaviour?

--

___
Python tracker 

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



[issue32592] Drop support of Windows Vista in Python 3.7

2019-01-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

AFAIK, it was specifically Martin Loewis who did not want a specific list in 
PEP 11.  Since he is long inactive, I think you and Steve should feel free to 
change that.

--

___
Python tracker 

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



[issue35633] test_eintr fails on AIX since fcntl functions were modified

2019-01-07 Thread Michael Felt

Michael Felt  added the comment:

On 07/01/2019 15:46, STINNER Victor wrote:
> STINNER Victor  added the comment:
>
> Since you are getting indentation error, I'm not sure about your test. Can 
> you please apply the patch below and run again test_eintr? Does it still fail 
> with PermissionError?

I was clearly a bit blind.. Now with:

  +490  class FNTLEINTRTest(EINTRBaseTest):
  +491  def _lock(self, lock_func, lock_name):
  +492  self.addCleanup(support.unlink, support.TESTFN)
  +493  code = '\n'.join((
  +494  "import fcntl, time",
  +495  "with open('%s', 'w+b') as f:" % support.TESTFN,
  +496  "   fcntl.%s(f, fcntl.LOCK_EX)" % lock_name,
  +497  "   time.sleep(%s)" % self.sleep_time))
  +498  start_time = time.monotonic()
  +499  proc = self.subprocess(code)
  +500  with kill_on_error(proc):
  +501  with open(support.TESTFN, 'w+b') as f:
  +502  while True:  # synchronize the subprocess
  +503  dt = time.monotonic() - start_time
  +504  if dt > 60.0:
  +505  raise Exception("failed to sync child in
%.1f sec" % dt)
  +506  try:
  +507  lock_func(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
  +508  lock_func(f, fcntl.LOCK_UN)
  +509  time.sleep(0.01)
  +510  except BlockingIOError:
  +511  break

I get - PermissionError - as before.

root@x066:[/data/prj/python/python3-3.8]./python -m test -v test_eintr
== CPython 3.8.0a0 (heads/master-dirty:b4ea8bb080, Jan 1 2019, 18:24:36) [C]
== AIX-1-00C291F54C00-powerpc-32bit big-endian
== cwd: /data/prj/python/python3-3.8/build/test_python_3342514
== CPU count: 8
== encodings: locale=ISO8859-1, FS=iso8859-1
Run tests sequentially
0:00:00 [1/1] test_eintr
test_all (test.test_eintr.EINTRTests) ...
--- run eintr_tester.py ---
test_flock (__main__.FNTLEINTRTest) ... ok
test_lockf (__main__.FNTLEINTRTest) ... ERROR
test_read (__main__.OSEINTRTest) ... ok
test_wait (__main__.OSEINTRTest) ... ok
test_wait3 (__main__.OSEINTRTest) ... ok
test_wait4 (__main__.OSEINTRTest) ... ok
test_waitpid (__main__.OSEINTRTest) ... ok
test_write (__main__.OSEINTRTest) ... ok
test_devpoll (__main__.SelectEINTRTest) ... skipped 'need select.devpoll'
test_epoll (__main__.SelectEINTRTest) ... skipped 'need select.epoll'
test_kqueue (__main__.SelectEINTRTest) ... skipped 'need select.kqueue'
test_poll (__main__.SelectEINTRTest) ... ok
test_select (__main__.SelectEINTRTest) ... ok
test_sigtimedwait (__main__.SignalEINTRTest) ... ok
test_sigwaitinfo (__main__.SignalEINTRTest) ... ok
test_accept (__main__.SocketEINTRTest) ... ok
test_open (__main__.SocketEINTRTest) ... ok
test_os_open (__main__.SocketEINTRTest) ... ok
test_recv (__main__.SocketEINTRTest) ... ok
test_recvmsg (__main__.SocketEINTRTest) ... ok
test_send (__main__.SocketEINTRTest) ... ok
test_sendall (__main__.SocketEINTRTest) ... ok
test_sendmsg (__main__.SocketEINTRTest) ... ok
test_sleep (__main__.TimeEINTRTest) ... ok

==
ERROR: test_lockf (__main__.FNTLEINTRTest)
--
Traceback (most recent call last):
  File
"/data/prj/python/git/python3-3.8/Lib/test/eintrdata/eintr_tester.py",
line 522, in test_lockf
    self._lock(fcntl.lockf, "lockf")
  File
"/data/prj/python/git/python3-3.8/Lib/test/eintrdata/eintr_tester.py",
line 507, in _lock
    lock_func(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
PermissionError: [Errno 13] Permission denied

--
Ran 24 tests in 9.098s

FAILED (errors=1, skipped=3)
--- eintr_tester.py completed: exit code 1 ---
FAIL

==
FAIL: test_all (test.test_eintr.EINTRTests)
--
Traceback (most recent call last):
  File "/data/prj/python/git/python3-3.8/Lib/test/test_eintr.py", line
31, in test_all
    self.fail("eintr_tester.py failed")
AssertionError: eintr_tester.py failed

--

Ran 1 test in 9.674s

FAILED (failures=1)
test test_eintr failed
test_eintr failed

== Tests result: FAILURE ==

>
> diff --git a/Lib/test/eintrdata/eintr_tester.py 
> b/Lib/test/eintrdata/eintr_tester.py
> index 25c169bde5..4db5dc9045 100644
> --- a/Lib/test/eintrdata/eintr_tester.py
> +++ b/Lib/test/eintrdata/eintr_tester.py
> @@ -492,13 +492,13 @@ class FNTLEINTRTest(EINTRBaseTest):
>  self.addCleanup(support.unlink, support.TESTFN)
>  code = '\n'.join((
>  "import fcntl, time",
> -"with open('%s', 'wb') as f:" % support.TESTFN,
> +"with open('%s', 'w+b') as f:" % support.TESTFN,
>

[issue35665] Function ssl.create_default_context raises exception on Windows 10 when called with ssl.Purpose.SERVER_AUTH) attribute

2019-01-07 Thread Christian Heimes


Christian Heimes  added the comment:

OpenSSL 1.1.0 is more strict than OpenSSL 1.0.2. That's why you don't see the 
issue with Python 3.6 but with 3.7. The problem is explained in 
https://mta.openssl.org/pipermail/openssl-dev/2016-February/005100.html

The CA has encoded the integer 102 (0x66) as "02 04 00
00 00 66", which violates the DER standard. The correct encoding is "02 01  66".

>>> from asn1crypto.core import Integer
>>> import binascii
>>> binascii.hexlify(Integer(102).dump())
b'020166'

--

___
Python tracker 

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



[issue35635] asyncio.create_subprocess_exec() only works in main thread

2019-01-07 Thread Stefan Seefeld


Stefan Seefeld  added the comment:

OK, so while I have been able to work around the issues (by using `quamash` to 
bridge between `asyncio` and `Qt`), I'd still like to understand the rationale 
behind the limitation that any subprocess-managing event-loop has to run in the 
main thread. Is this really an architectural limitation or a limit of the 
current implementation ?

And to your question: As I wasn't really expecting such a limitation, I would 
have expected 
"To handle signals and to execute subprocesses, the event loop must be run 
in the main thread."

to be written much more prominently (as a warning admonition even, perhaps).

--

___
Python tracker 

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



[issue35682] asyncio: bug in _ProactorBasePipeTransport._force_close()

2019-01-07 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue35682] asyncio: bug in _ProactorBasePipeTransport._force_close()

2019-01-07 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch, patch
pull_requests: +10940, 10941
stage:  -> patch review

___
Python tracker 

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



[issue32710] test_asyncio: ProactorEventLoopTests sendfile tests leak references on Windows

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

Interesting commit. No idea if it's related.

commit 79790bc35fe722a49977b52647f9b5fe1deda2b7
Author: Victor Stinner 
Date:   Fri Jun 8 00:25:52 2018 +0200

bpo-33694: Fix race condition in asyncio proactor (GH-7498)

The cancellation of an overlapped WSARecv() has a race condition
which causes data loss because of the current implementation of
proactor in asyncio.

No longer cancel overlapped WSARecv() in _ProactorReadPipeTransport
to work around the race condition.

Remove the optimized recv_into() implementation to get simple
implementation of pause_reading() using the single _pending_data
attribute.

Move _feed_data_to_bufferred_proto() to protocols.py.

Remove set_protocol() method which became useless.

--

___
Python tracker 

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



[issue35635] asyncio.create_subprocess_exec() only works in main thread

2019-01-07 Thread Stefan Seefeld


Stefan Seefeld  added the comment:

> The limitation is a consequence of how Linux works.
> Unix has no cross-platform API for non-blocking waiting for child process 
> finish except handling SIGCHILD signal.

Why does the `wait()` have to be non-blocking ? We can call it once in 
response to the reception of a `SIGCHILD`, where we know the call 
wouldn't block. Then we can pass the `pid` to whatever event loop 
created the subprocess to do the cleanup there...

> On the other hand signal handlers in Python should work in the main thread.

That's fine.

> Your trick with a loop creation in the main thread and actual running in 
> another thread can work, but asyncio doesn't guarantee it.
> The behavior can be broken in next releases, sorry.

Yeah, I observed some strange issues that looked like they could be 
fixed by someone intimately familiar with `asyncio`. But given the 
documented limitation, it seemed wise not to descend into that rabbit 
hole, and so I (at least temporarily) abandoned the entire approach.

--

Stefan

   ...ich hab' noch einen Koffer in Berlin...

--

___
Python tracker 

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



[issue35682] asyncio: bug in _ProactorBasePipeTransport._force_close()

2019-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10945, 10946

___
Python tracker 

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



[issue35682] asyncio: bug in _ProactorBasePipeTransport._force_close()

2019-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10945

___
Python tracker 

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



[issue32710] test_asyncio: ProactorEventLoopTests sendfile tests leak references on Windows

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

Attached test_aiosend.py is a simplified version of test to trigger the 
reference leak. Copy it to Lib/test/ and run:

vstinner@WIN C:\vstinner\python\master>python -m test test_aiosend -R 3:3
Running Debug|x64 interpreter...
Run tests sequentially
0:00:00 [1/1] test_aiosend
beginning 6 repetitions
123456
..
test_aiosend leaked [1, 1, 1] references, sum=3
test_aiosend leaked [1, 2, 1] memory blocks, sum=4
test_aiosend failed

== Tests result: FAILURE ==

1 test failed:
test_aiosend

Total duration: 548 ms
Tests result: FAILURE

--
Added file: https://bugs.python.org/file48030/test_aiosend.py

___
Python tracker 

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



[issue32622] Implement loop.sendfile

2019-01-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10944

___
Python tracker 

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



[issue32710] test_asyncio: ProactorEventLoopTests sendfile tests leak references on Windows

2019-01-07 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_asyncio: 
ProactorEventLoopTests.test_sendfile_close_peer_in_middle_of_receiving() leaked 
[4, 4, 3] memory blocks on AMD64 Windows8.1 Refleaks 3.x -> test_asyncio: 
ProactorEventLoopTests sendfile tests leak references on Windows

___
Python tracker 

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



[issue35682] asyncio: bug in _ProactorBasePipeTransport._force_close()

2019-01-07 Thread STINNER Victor


New submission from STINNER Victor :

Running 
ProactorEventLoopTests.test_sendfile_close_peer_in_the_middle_of_receiving() 
logs a bug in _force_close(): see logs below. Extract of _force_close():

def _force_close(self, exc):
if self._empty_waiter is not None:
if exc is None:
self._empty_waiter.set_result(None)
else:
self._empty_waiter.set_exception(exc)
...

Problem: _empty_waiter can be already done. For example, it can be created 
directly as done:

def _make_empty_waiter(self):
...
self._empty_waiter = self._loop.create_future()
if self._write_fut is None:
self._empty_waiter.set_result(None)
return self._empty_waiter

Attached PR fixes _force_close(): do nothing if _empty_waiter is already done.

The regression comes from the following change:

commit a19fb3c6aaa7632410d1d9dcb395d7101d124da4
Author: Andrew Svetlov 
Date:   Sun Feb 25 19:32:14 2018 +0300

bpo-32622: Native sendfile on windows (#5565)

* Support sendfile on Windows Proactor event loop naively.


Logs:

vstinner@WIN C:\vstinner\python\master>python -X dev -m test test_asyncio -m 
test.test_asyncio.test_sendfile.ProactorEventLoopTests.test_sendfile_close_peer_in_the_middle_of_receiving
Running Debug|x64 interpreter...
Run tests sequentially 
0:00:00 [1/1] test_asyncio 
Exception in callback 
_ProactorReadPipeTransport._loop_reading(<_OverlappedF...events.py:452>) 
handle: ) 
created at C:\vstinner\python\master\lib\asyncio\windows_events.py:82>
source_traceback: Object created at (most recent call last):
  File "C:\vstinner\python\master\lib\test\test_asyncio\test_sendfile.py", line 
125, in run_loop
return self.loop.run_until_complete(coro)
  File "C:\vstinner\python\master\lib\asyncio\base_events.py", line 576, in 
run_until_complete
self.run_forever()
  File "C:\vstinner\python\master\lib\asyncio\windows_events.py", line 315, in 
run_forever
super().run_forever()
  File "C:\vstinner\python\master\lib\asyncio\base_events.py", line 544, in 
run_forever
self._run_once()
  File "C:\vstinner\python\master\lib\asyncio\base_events.py", line 1729, in 
_run_once
event_list = self._selector.select(timeout)
  File "C:\vstinner\python\master\lib\asyncio\windows_events.py", line 421, in 
select
self._poll(timeout)
  File "C:\vstinner\python\master\lib\asyncio\windows_events.py", line 750, in 
_poll
f.set_exception(e)
  File "C:\vstinner\python\master\lib\asyncio\windows_events.py", line 82, in 
set_exception
super().set_exception(exception)
Traceback (most recent call last):
  File "C:\vstinner\python\master\lib\asyncio\windows_events.py", line 444, in 
finish_recv
return ov.getresult()
OSError: [WinError 64] The specified network name is no longer available

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 256, in 
_loop_reading
data = fut.result()
  File "C:\vstinner\python\master\lib\asyncio\windows_events.py", line 748, in 
_poll
value = callback(transferred, key, ov)
  File "C:\vstinner\python\master\lib\asyncio\windows_events.py", line 448, in 
finish_recv
raise ConnectionResetError(*exc.args)
ConnectionResetError: [WinError 64] The specified network name is no longer 
available

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\vstinner\python\master\lib\asyncio\events.py", line 81, in _run
self._context.run(self._callback, *self._args)
  File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 283, in 
_loop_reading
self._force_close(exc)
  File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 118, in 
_force_close
self._empty_waiter.set_exception(exc)
asyncio.exceptions.InvalidStateError: invalid state

== Tests result: SUCCESS ==

1 test OK.

Total duration: 531 ms
Tests result: SUCCESS

--
components: Windows, asyncio
messages: 333192
nosy: asvetlov, paul.moore, steve.dower, tim.golden, vstinner, yselivanov, 
zach.ware
priority: normal
severity: normal
status: open
title: asyncio: bug in _ProactorBasePipeTransport._force_close()
versions: 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



[issue35642] _asynciomodule.c compiled in both pythoncore.vcxproj and _asyncio.vcxproj

2019-01-07 Thread Steve Dower


Steve Dower  added the comment:


New changeset fbf50683b3a2301097d5cd48bc68b530c1e1720f by Steve Dower (Gregory 
Szorc) in branch 'master':
bpo-35642: Remove asynciomodule.c from pythoncore.vcxproj (GH-11410)
https://github.com/python/cpython/commit/fbf50683b3a2301097d5cd48bc68b530c1e1720f


--
nosy: +steve.dower

___
Python tracker 

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



[issue32622] Implement loop.sendfile

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 80fda712c83f5dd9560d42bf2aa65a72b18b7759 by Victor Stinner in 
branch 'master':
bpo-35682: Fix _ProactorBasePipeTransport._force_close() (GH-11462)
https://github.com/python/cpython/commit/80fda712c83f5dd9560d42bf2aa65a72b18b7759


--

___
Python tracker 

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



[issue35682] asyncio: bug in _ProactorBasePipeTransport._force_close()

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 80fda712c83f5dd9560d42bf2aa65a72b18b7759 by Victor Stinner in 
branch 'master':
bpo-35682: Fix _ProactorBasePipeTransport._force_close() (GH-11462)
https://github.com/python/cpython/commit/80fda712c83f5dd9560d42bf2aa65a72b18b7759


--

___
Python tracker 

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



[issue35682] asyncio: bug in _ProactorBasePipeTransport._force_close()

2019-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10945, 10946, 10947, 10948

___
Python tracker 

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



[issue32622] Implement loop.sendfile

2019-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10949

___
Python tracker 

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



[issue35673] Loader for namespace packages

2019-01-07 Thread Barry A. Warsaw


Change by Barry A. Warsaw :


--
nosy: +eric.smith

___
Python tracker 

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



[issue35682] asyncio: bug in _ProactorBasePipeTransport._force_close()

2019-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10945, 10946, 10947

___
Python tracker 

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



[issue35596] Fatal Python error: initfsencoding: unable to load the file system codec zipimport.ZipImportError: can't find module 'encodings'

2019-01-07 Thread Steve Dower


Steve Dower  added the comment:

Looks like zipimport in 3.7 always rejected CHECKED_HASH pycs, while in 3.8 it 
always accepts them (or runs it through a validation process that passes them 
when the source file doesn't exist - I only confirmed by testing a build, not 
by walking through the new sources).

Rather than changing the old zipimport now, it's more correct to fix the 
embeddable ZIP build to specify UNCHECKED_HASH.

--
assignee:  -> steve.dower

___
Python tracker 

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



[issue35374] Windows doc build does not find autodetected hhc.exe

2019-01-07 Thread Steve Dower


Change by Steve Dower :


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



[issue26467] Add async magic method support to unittest.mock.Mock

2019-01-07 Thread Dima Tisnek


Dima Tisnek  added the comment:

Perhaps it's possible to vendor asynctest mock in the same vein as `mock` found 
it's way into unittest?

The real power of `asynctest` is in constructs like:

with asynctest.mock.patch("module.Class", autospec=True):
...

Where mock instances know what methods are async.

--
nosy: +Dima.Tisnek
versions: +Python 3.8 -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



[issue35682] asyncio: bug in _ProactorBasePipeTransport._force_close()

2019-01-07 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch, patch, patch
pull_requests: +10940, 10941, 10943
stage:  -> patch review

___
Python tracker 

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



[issue35682] asyncio: bug in _ProactorBasePipeTransport._force_close()

2019-01-07 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch, patch, patch, patch
pull_requests: +10940, 10941, 10942, 10943
stage:  -> patch review

___
Python tracker 

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



[issue35635] asyncio.create_subprocess_exec() only works in main thread

2019-01-07 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

The limitation is a consequence of how Linux works.
Unix has no cross-platform API for non-blocking waiting for child process 
finish except handling SIGCHILD signal.

On the other hand signal handlers in Python should work in the main thread.

Your trick with a loop creation in the main thread and actual running in 
another thread can work, but asyncio doesn't guarantee it.
The behavior can be broken in next releases, sorry.

IIRC we discussed this scenario recently, official support for transferring a 
loop between threads is a too strict limitation, not all third-party 
implementations are ready for that.

--

___
Python tracker 

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



[issue35673] Loader for namespace packages

2019-01-07 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Jan 7, 2019, at 03:16, Ronald Oussoren  wrote:
> 
> Do you know why the namespace package loader lies about the source and code? 
> Both .get_source() and .get_code() return a value that isn't None.

> And likewise: Why is the namespace package loader a private class, other 
> loaders are exposed in importlib.machinery?  This makes it hard to detect 
> PEP420 style namespace packages without relying on private APIs, esp. 
> combined with the behaviour of .get_source() and .get_code().

I don’t remember the history of this.  I wonder if Brett or Eric have any 
additional insights.

--

___
Python tracker 

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



[issue35596] Fatal Python error: initfsencoding: unable to load the file system codec zipimport.ZipImportError: can't find module 'encodings'

2019-01-07 Thread Steve Dower


Steve Dower  added the comment:

And I assume now that the reason it broke in 3.7.2 is because the pyc mode for 
the embeddable distro changed. Which means the right place for tests is in a 
separate build that uses properly laid out Python rather than testing in the 
source tree (like what I have in the windows-appx-tests.yml file and 
Tools/msi/testrelease.bat script, but apparently also for the embeddable 
distro).

--

___
Python tracker 

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



[issue35374] Windows doc build does not find autodetected hhc.exe

2019-01-07 Thread Steve Dower


Steve Dower  added the comment:


New changeset e61cc481e02b758c8d8289163102c236d0658a55 by Steve Dower 
(chrullrich) in branch 'master':
bpo-35374: Avoid trailing space in hhc file name if found on PATH. (GH-10849)
https://github.com/python/cpython/commit/e61cc481e02b758c8d8289163102c236d0658a55


--

___
Python tracker 

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



[issue35374] Windows doc build does not find autodetected hhc.exe

2019-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset 5d1e0124cf562153a681d1b5b362e7c8e23edea9 by Miss Islington (bot) 
in branch '3.7':
bpo-35374: Avoid trailing space in hhc file name if found on PATH. (GH-10849)
https://github.com/python/cpython/commit/5d1e0124cf562153a681d1b5b362e7c8e23edea9


--
nosy: +miss-islington

___
Python tracker 

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



[issue32710] test_asyncio: ProactorEventLoopTests sendfile tests leak references on Windows

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

Update:

* 
test.test_asyncio.test_sendfile.ProactorEventLoopTests.test_sendfile_close_peer_in_the_middle_of_receiving
 leaks 1 reference per run: this bug is caused by bpo-35682 and fixed by PR 
11462
* 
test.test_asyncio.test_sendfile.ProactorEventLoopTests.test_sendfile_fallback_close_peer_in_the_middle_of_receiving
 leaks 1 reference per run: I don't understand why.

I spent a lot of time to investigate 
test_sendfile_fallback_close_peer_in_the_middle_of_receiving() leak and I don't 
understand the issue. The main loop is BaseEventLoop._sendfile_fallback(). For 
the specific case of this test, the loop can be simplified to:

proto = _SendfileFallbackProtocol(transp)
try:
while True:
data = b'x' * (1024 * 64)
await proto.drain()
transp.write(data)
finally:
await proto.restore()

The server closes the connection after it gets 1024 bytes. The client socket 
gets a ConnectionAbortedError exception in 
_ProactorBaseWritePipeTransport._loop_writing() which calls _fatal_error():

except OSError as exc:
self._fatal_error(exc, 'Fatal write error on pipe transport')

_fatal_error() calls _force_close() which sets _closing to True and calls 
protocol.connection_lost(). In the meanwhile, drain() raises ConnectionError 
because is_closing() is true:

async def drain(self):
if self._transport.is_closing():
raise ConnectionError("Connection closed by peer")
...

--

___
Python tracker 

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



[issue32622] Implement loop.sendfile

2019-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset 88bd26a72eb4ab341cf19bea78a0039fbe4be3a2 by Miss Islington (bot) 
in branch '3.7':
bpo-35682: Fix _ProactorBasePipeTransport._force_close() (GH-11462)
https://github.com/python/cpython/commit/88bd26a72eb4ab341cf19bea78a0039fbe4be3a2


--

___
Python tracker 

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



[issue35682] asyncio: bug in _ProactorBasePipeTransport._force_close()

2019-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset 88bd26a72eb4ab341cf19bea78a0039fbe4be3a2 by Miss Islington (bot) 
in branch '3.7':
bpo-35682: Fix _ProactorBasePipeTransport._force_close() (GH-11462)
https://github.com/python/cpython/commit/88bd26a72eb4ab341cf19bea78a0039fbe4be3a2


--
nosy: +miss-islington

___
Python tracker 

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



[issue35682] asyncio: bug in _ProactorBasePipeTransport._force_close()

2019-01-07 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue35374] Windows doc build does not find autodetected hhc.exe

2019-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10950, 10951, 10952

___
Python tracker 

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



[issue35596] Fatal Python error: initfsencoding: unable to load the file system codec zipimport.ZipImportError: can't find module 'encodings'

2019-01-07 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +10953, 10954
stage: test needed -> patch review

___
Python tracker 

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



[issue35596] Fatal Python error: initfsencoding: unable to load the file system codec zipimport.ZipImportError: can't find module 'encodings'

2019-01-07 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +10953
stage: test needed -> patch review

___
Python tracker 

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



[issue35596] Fatal Python error: initfsencoding: unable to load the file system codec zipimport.ZipImportError: can't find module 'encodings'

2019-01-07 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +10953, 10954, 10955
stage: test needed -> patch review

___
Python tracker 

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



[issue35374] Windows doc build does not find autodetected hhc.exe

2019-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10950

___
Python tracker 

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



[issue35374] Windows doc build does not find autodetected hhc.exe

2019-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10950, 10951

___
Python tracker 

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



[issue35550] Some define guards for Solaris are wrong

2019-01-07 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee: gregory.p.smith -> 

___
Python tracker 

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



[issue35683] Enable manylinux1 builds on Pipelines

2019-01-07 Thread Steve Dower


New submission from Steve Dower :

Azure Pipelines can now support container jobs: 
https://docs.microsoft.com/en-us/azure/devops/pipelines/process/container-phases?view=vsts=yaml

I experimented with enabling a manylinux1 build a while back, which should now 
be able to use identical steps to the POSIX build. With the new syntax, we can 
enable CI (and perhaps PR?) builds using the snippet below:

- job: ManyLinux1_CI_Tests
  displayName: ManyLinux1 CI Tests
  dependsOn: Prebuild
  condition: |
and(
and(
succeeded(),
eq(variables['manylinux'], 'true')
),
eq(dependencies.Prebuild.outputs['tests.run'], 'true')
)

  resources:
containers:
- container: manylinux1
  image: dockcross:manylinux-x64

  pool:
vmImage: ubuntu-16.04

  container: manylinux1

  variables:
testRunTitle: '$(build.sourceBranchName)-manylinux1'
testRunPlatform: manylinux1

  steps:
  - template: ./posix-steps.yml


I don't have time right now to test this change, but someone else might. It's 
certainly going to be easier for someone to test it by adding this to the PR 
build first (or set up a build on your own Pipelines instance).

Maybe there are other more relevant containers we should be testing in?

--
components: Cross-Build
messages: 333209
nosy: Alex.Willmer, barry, steve.dower, zach.ware
priority: normal
severity: normal
status: open
title: Enable manylinux1 builds on Pipelines
versions: 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



[issue35681] urllib.request.HTTPPasswordMgr.add_password requires more information for HTTPPasswordMgrWithDefaultRealm

2019-01-07 Thread Tatz Sekine


New submission from Tatz Sekine :

TL;DR
  HTTPPasswordMgrWithDefaultRealm.add_password() doesn't have proper 
documentation.

All known version of urllib.request (or urllib2 in Python 2.x) documentaion 
have the same issue.

Details:

HTTPPasswordMgrWithDefaultRealm object doesn't have its own documentation. 
Instead of that, HTTPPasswordMgr's doc have information for those 2 objects:
https://docs.python.org/3.8/library/urllib.request.html?highlight=httppasswordmgr#http-password-mgr

Both objects have just 2 functions: add_password() and find_user_password(). 
The doc for find_user_password() has explanation how different between those 2 
objects, while the one for add_password() doesn't.

One of the missing explanation for 
HTTPPasswordMgrWithDefaultRealm.add_passowrd() is the value of realm. The 
document has now "realm, user and passwd must be strings.", but realm could be 
None for HTTPPasswordMgrWithDefaultRealm, to set default realm-less password.

That's typical use case of HTTPPasswordMgrWithDefaultRealm.add_password(), or, 
that's exactly urllib howto doc mentions in
 
https://docs.python.org/3.8/howto/urllib2.html?highlight=httppasswordmgrwithdefaultrealm

Conclusion:

So, documentation of HTTPPasswordMgr.add_passoword() should have additional 
explanation for realm which could be None for HTTPPasswordMgrWithDefaultRealm. 
Or, HTTPPasswordMgrWithDefaultRealm objects could have independent section from 
HTTPPasswordMgr, to clarify its usage.

Why is this matter?
  Typeshed (https://github.com/python/typeshed) depends on the doc. I (or 
somebody else in the company) will report it separately.

--
assignee: docs@python
components: Documentation
messages: 333189
nosy: docs@python, tsekine
priority: normal
severity: normal
status: open
title: urllib.request.HTTPPasswordMgr.add_password requires more information 
for HTTPPasswordMgrWithDefaultRealm
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue33717] Enhance test.pythoninfo: meta-ticket for multiple changes

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ddd7c422fd89a053700f9ed5272cf732ccb09088 by Victor Stinner in 
branch 'master':
bpo-33717: pythoninfo logs information of all clocks (GH-11460)
https://github.com/python/cpython/commit/ddd7c422fd89a053700f9ed5272cf732ccb09088


--

___
Python tracker 

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



[issue33717] Enhance test.pythoninfo: meta-ticket for multiple changes

2019-01-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10934, 10935

___
Python tracker 

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



[issue33717] Enhance test.pythoninfo: meta-ticket for multiple changes

2019-01-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10934, 10935, 10936

___
Python tracker 

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



  1   2   >