[issue31829] Portability issues with pickle

2019-02-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I have simplified the PR. Removed the complex code for detecting pickles 
written to files in text mode on Windows and for adding optional marks for 
correct detecting. Currently it does only two things:

* Escapes \r, \0 and \x1a (end-of-file on Windows) when pickle unicode. This 
allows pickles dumped to a file in binary mode (or on non-Windows, or in Python 
3) be correctly loaded from a file opened from a file in text mode on Windows.

Currently, dumping to a file in text mode works most time, except on Windows, 
when the unicode string ends with \r or contains \x1a (not sure about \0, it 
was added just for the case). Since the data is only corrupted in special 
cases, this likely is not tested, and the user code can open files in text 
(default) mode without noticing a bug, until once a malicious user will provide 
a bad Unicode string.

* Produces a deprecation warning or even a ValueError in cases when writing to 
a file in text mode can cause problems. This will help to notice the problem 
earlier.

--

___
Python tracker 

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



[issue31829] Portability issues with pickle

2019-02-15 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue34235] PyArg_ParseTupleAndKeywords: support required keyword arguments

2019-02-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I thought about this variant. The problem is that you need to scan the format 
string to the end to determine whether arguments following $ are optional or 
not. This adds performance penalty for all existing uses of 
PyArg_ParseTupleAndKeywords() with $. Your PR changes the current behavior, and 
this is unacceptable too, because it can lead to crashes and other errors in 
existing code.

It is possible to add this feature without breakage and performance loss. Just 
allow $ to be used twice, for required and optional arguments. Then

PyArg_ParseTupleAndKeywords(args, kwds, "O$O|O$O", kwlist, &a, &c, &b, &d)

will define four parameters in the following order: required 
positional-or-keyword, required keyword-only, optional positional-or-keyword, 
optional keyword-only.

My doubts are that this order is different from the order of parameters as 
defined in Python functions: required positional-or-keyword, optional 
positional-or-keyword, required keyword-only, optional keyword-only. I afraid 
this can cause confusions.

Although, the first order (all required parameters are first) is more efficient 
for processing. So perhaps for compatibility, performance, and the simplicity 
of the implementation we will accept it.

--

___
Python tracker 

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



[issue35996] Optional modulus argument for new math.prod() function

2019-02-15 Thread Berry Schoenmakers


Berry Schoenmakers  added the comment:

I had the same reservations but after rethinking it several times concluded 
that the modulus argument would fit really well.

Indeed, Mathematica doesn't support the Modulus option for the Product[] 
function. But they don't even support it for the Power[] function, one needs to 
use PowerMod[] for that. 

Python has the extra option for its built-in pow(), and sensibly restricts this 
to the case of integer arguments only. 

To do modular arithmetic, even with big numbers, in Python is really nice and 
easy using the % operator. And it's all pretty efficient as well. The only 
exception where efficiency becomes an issue is the pow() function.

To maintain that balance with the new prod() function around, the modulus 
argument would do the job. We can continue to do all modular arithmetic in a 
natural way, yielding programs that are perfectly readable and with very decent 
performance, now with prod() in the language as well.

Taking larger modular products is a common thing to do in modern crypto, and 
Python is a popular platform for this. Next to the example of prod_i g[i]**s[i] 
mod z, which is like a Pedersen multi-commitment, it also arises when computing 
Lagrange coefficients (used in Shamir secret sharing) and related determinants 
for Vandermonde matrices.

One would also be able to things like prod(range(1, n), n) == n - 1 for 
Wilson's primality test. (Extending the factorial() function with a modulus 
argument would be taking things too far, probably, but the modular version 
would now be available anyway via prod().)

So, my feeling is that there are sufficiently many use cases around. And, I'm 
kind of assuming that it's not too much effort to add a modulus argument to 
prod(), but maybe that's not really the case.

--

___
Python tracker 

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



[issue35808] Let's retire pgen

2019-02-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I didn't look at the PR yet, but this is a wonderful idea. I planned to do this 
just after rewriting generators of token-related data and code in Python 
(issue30455), but Pablo has overfoot me. Great!

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue35810] Object Initialization does not incref Heap-allocated Types

2019-02-15 Thread Christian Tismer


Christian Tismer  added the comment:

Thanks for including me here!

We have indeed converted everything to new style types
but saw no refcount problems, yet. This will probably
come after the patch. We will add an issue to the tracker
for Python 3.8.

--

___
Python tracker 

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



[issue34235] PyArg_ParseTupleAndKeywords: support required keyword arguments

2019-02-15 Thread Michael Sullivan


Michael Sullivan  added the comment:

The point about a performance penalty is fair---my PR does add a search for the 
'@' (which I spelled as '`' in my example above) sigil whenever it encounters a 
'|'. (Though I'm not sure how big the impact would be? Format strings are small 
so a quick scan through it should be pretty fast. Could be measured.)

I am missing how my PR changes the current behavior, though? As far as I can 
tell it should behave exactly the same unless there is a '@' in the format 
string.

--

___
Python tracker 

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



[issue28673] pyro4 with more than 15 threads often crashes 2.7.12

2019-02-15 Thread INADA Naoki


INADA Naoki  added the comment:

I think this issue is fixed by #21963.

--
resolution:  -> fixed
stage: test needed -> 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



[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-15 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi Brennan,

Normally, you wanted to work on this issue and you have waited for one week 
after the last message of Maxwell.

Do you want to work on this issue and submit your PR?

Have a nice day,

Stéphane

--

___
Python tracker 

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



[issue35998] ./python -m test test_asyncio fails

2019-02-15 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

here is the stderr.txt

--
Added file: https://bugs.python.org/file48144/stderr.txt

___
Python tracker 

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



[issue35998] ./python -m test test_asyncio fails

2019-02-15 Thread Stéphane Wirtel

New submission from Stéphane Wirtel :

==
ERROR: test_start_tls_server_1 
(test.test_asyncio.test_sslproto.SelectorStartTLSTests)
--
Traceback (most recent call last):
  File 
"/home/stephane/src/github.com/python/cpython-original/Lib/test/test_asyncio/test_sslproto.py",
 line 510, in test_start_tls_server_1
self.loop.run_until_complete(run_main())
  File 
"/home/stephane/src/github.com/python/cpython-original/Lib/asyncio/base_events.py",
 line 589, in run_until_complete
return future.result()
  File 
"/home/stephane/src/github.com/python/cpython-original/Lib/test/test_asyncio/test_sslproto.py",
 line 503, in run_main
await asyncio.wait_for(
  File 
"/home/stephane/src/github.com/python/cpython-original/Lib/asyncio/tasks.py", 
line 461, in wait_for
raise exceptions.TimeoutError()
asyncio.exceptions.TimeoutError

my current revision: 3e028b2d40370dc986b6f3146a7ae927bc119f97

system: fedora 29
compiled with gcc

gcc (GCC) 8.2.1 20181215 (Red Hat 8.2.1-6)

No issue on Travis, but this test fails on my computer and I cleaned my repo 
with git clean -dfqx

--
files: stdout.txt
messages: 335596
nosy: matrixise
priority: normal
severity: normal
status: open
title: ./python -m test test_asyncio fails
versions: Python 3.8
Added file: https://bugs.python.org/file48143/stdout.txt

___
Python tracker 

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



[issue29712] --enable-optimizations does not work with --enable-shared

2019-02-15 Thread Stefan Ring


Stefan Ring  added the comment:

I was having the same problem, and I just found out what it was: Because of 
-Wl,-rpath=..., this path gets baked into the binary, and LD_LIBRARY_PATH is 
ignored. So if you have a previous build lying around there, it will mess up 
the build.

--
nosy: +Ringding

___
Python tracker 

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



[issue35746] [ssl][CVE-2019-5010] TALOS-2018-0758 Denial of Service

2019-02-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +11896

___
Python tracker 

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



[issue35746] [ssl][CVE-2019-5010] TALOS-2018-0758 Denial of Service

2019-02-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +11898

___
Python tracker 

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



[issue35746] [ssl][CVE-2019-5010] TALOS-2018-0758 Denial of Service

2019-02-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +11897

___
Python tracker 

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



[issue35746] [ssl][CVE-2019-5010] TALOS-2018-0758 Denial of Service

2019-02-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +11899

___
Python tracker 

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



[issue35746] [ssl][CVE-2019-5010] TALOS-2018-0758 Denial of Service

2019-02-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 355f16fd4beb36d6a18f7d0982581c93de015c17 by Victor Stinner in 
branch 'master':
bpo-35746: Credit Colin Read and Nicolas Edet (GH-11863)
https://github.com/python/cpython/commit/355f16fd4beb36d6a18f7d0982581c93de015c17


--

___
Python tracker 

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



[issue35746] [ssl][CVE-2019-5010] TALOS-2018-0758 Denial of Service

2019-02-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +11900

___
Python tracker 

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



[issue35746] [ssl][CVE-2019-5010] TALOS-2018-0758 Denial of Service

2019-02-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 826a8b708165796151ad4135b0ddbd79da6d39f1 by Victor Stinner in 
branch '2.7':
bpo-35746: Credit Colin Read and Nicolas Edet (GH-11866)
https://github.com/python/cpython/commit/826a8b708165796151ad4135b0ddbd79da6d39f1


--

___
Python tracker 

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



[issue35746] [ssl][CVE-2019-5010] TALOS-2018-0758 Denial of Service

2019-02-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +11901

___
Python tracker 

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



[issue34656] [CVE-2018-20406] memory exhaustion in Modules/_pickle.c:1393

2019-02-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +11902
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



[issue34656] [CVE-2018-20406] memory exhaustion in Modules/_pickle.c:1393

2019-02-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +11903

___
Python tracker 

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



[issue35999] multpirocessing.Process alive after SIGTERM on parent

2019-02-15 Thread Defert


New submission from Defert :

Hello,

Using the multiprocessing.Process class on Python 3.5 (untested with other 
versions), child processes are not killed when the main process is killed.

The doc mentions a "daemon" flag 
(https://python.readthedocs.io/en/latest/library/multiprocessing.html#multiprocessing.Process.daemon),
 which says "When a process exits, it attempts to terminate all of its daemonic 
child processes."

However this does not seem to be the case, when the parent process is killed, 
all children remain alive whatever the value of the daemon flag is.

Test code:

from multiprocessing import Process
from time import sleep
from os import getpid
 
def log(daemon_mode):
while True:
print('worker %i %s' % (getpid(), daemon_mode))
sleep(3)
  
print('parent pid %i' % getpid())
a = Process(target=log, args=(0,), daemon=False)
a.start()
   
b = Process(target=log, args=(1,), daemon=True)
b.start()
   
while True:
sleep(60)

##

To be run with:

user@host~# python3 test.py &
[1] 14749
parent pid 14749
worker 14751 1
worker 14750 0
user@host:~# 
user@host:~# kill 14749
[1]+  Terminated  python3 test.py
user@host:~#
worker 14751 1
worker 14750 0

--
components: Library (Lib)
messages: 335601
nosy: lids
priority: normal
severity: normal
status: open
title: multpirocessing.Process alive after SIGTERM on parent
versions: Python 3.5

___
Python tracker 

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



[issue35986] print() documentation typo?

2019-02-15 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

This was fixed with https://github.com/python/python-docs-theme/pull/25
by @matrixise.

--
nosy: +cheryl.sabella
resolution: remind -> third party
stage:  -> resolved
status: open -> closed
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



[issue34791] xml package does not obey sys.flags.ignore_environment

2019-02-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +11904

___
Python tracker 

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



[issue34791] xml package does not obey sys.flags.ignore_environment

2019-02-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +11905

___
Python tracker 

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



[issue35986] print() documentation typo?

2019-02-15 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Thanks @cheryl

but we need to have a new package of python-docs-theme.

--

___
Python tracker 

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



[issue35746] [ssl][CVE-2019-5010] TALOS-2018-0758 Denial of Service

2019-02-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fe42122d41834746e841b5927154be041fb7afbb by Victor Stinner in 
branch '3.7':
bpo-35746: Credit Colin Read and Nicolas Edet (GH-11864)
https://github.com/python/cpython/commit/fe42122d41834746e841b5927154be041fb7afbb


--

___
Python tracker 

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



[issue35411] FTP tests of test_urllib2net fail on Travis CI: 425 Security: Bad IP connecting.

2019-02-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +11906

___
Python tracker 

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



[issue36000] __debug__ is a keyword but not a keyword

2019-02-15 Thread Dan Snider


New submission from Dan Snider :

keyword.py is used by stuff like the idle colorizer to help determine if an 
identifier is considered a keyword but it doesn't identify __debug__ despite 
the fact that the parser treats it exactly the same as None, True, and False. I 
could not find a more recent issue to bring this back up than #34464 and there 
it was suggested a issue be made so here it is. 

As mentioned on that previous issue, currently keyword.py builds the list 
automatically by scanning "Python/graminit.c" but since there is no "__debug__" 
token to be found in that file it doesn't get added to kwlist.

There is a file that groups the keywords True, False, None, and __debug__: 
ast.c. But there's no reason for it to be that complicated when nothing would 
break by for example adding on line 54 of keyword.py the statement "kwlist += 
['__debug__']?

Actually, I'm interested in knowing why __debug__ is a keyword in the first 
place. I'm terrible at searching apparently so there might be more but from 
what I can tell, the only thing the docs have to say about __debug__ really is 
the following tautology: "The value for the built-in variable [__debug__] is 
determined when the interpreter starts."

--
components: Library (Lib)
messages: 335605
nosy: bup
priority: normal
severity: normal
status: open
title: __debug__ is a keyword but not a keyword
type: enhancement
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



[issue36000] __debug__ is a keyword but not a keyword

2019-02-15 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I'm not sure that __debug__ is a proper keyword. Unlike None, if you 
monkey-patch builtins, you can modify it:

py> builtins.__dict__['__debug__'] = 'Surprise!'
py> __debug__
'Surprise!'

py> builtins.__dict__['None'] = 'Surprise!'
py> None
py>


And it is not listed here:

https://docs.python.org/3.7/reference/lexical_analysis.html#keywords

So __debug__ appears to me to be in a strange grey area, part regular name and 
part keyword, but not quite either.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue36001] LIBFFI_INCLUDEDIR is not detected when set into a profile nor in ./configure LIBFFI_INCLUDEDIR="path/to/libffi/include"

2019-02-15 Thread neil pop

New submission from neil pop :

Hello,
I tried making python 3.7.2 on linux mint without libffi set into my 
LIBFFI_INCLUDEDIR (usr/local/include) but set into my bashsrc which is 
basically a profile with export LIBFFI_INCLUDEDIR="-Ipath/to/libff/include" 
however when i try making python after configuring it (i tried also passing 
that LIBFFI_INCLUDEDIR as an argument for the config part) then i get cannot 
build ctypes as there is no ffi.h header detected.
So what i did is that i modified the python setup at line 1989: ffi_inc = 
[sysconfig.get_config_var("LIBFFI_INCLUDEDIR")] to ffi_inc = 
["path/to/libffi/include"] and ran the configure then the make and voilà, 
ctypes are now compiled. So i was wondering is there a way to setup 
LIBFFI_INCLUDEDIR so it get returned by 
sysconfig.get_config_var("LIBFFI_INCLUDEDIR") (since it clearly doesn't) ?
Cheers,
Elisa

--
components: ctypes
messages: 335607
nosy: neil pop
priority: normal
severity: normal
status: open
title: LIBFFI_INCLUDEDIR is not detected when set into a profile nor in 
./configure LIBFFI_INCLUDEDIR="path/to/libffi/include"
type: compile error
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



[issue36000] __debug__ is a keyword but not a keyword

2019-02-15 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
nosy: +matrixise

___
Python tracker 

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



[issue33376] [pysqlite] Duplicate rows can be returned after rolling back a transaction

2019-02-15 Thread Ma Lin


Change by Ma Lin :


--
nosy: +Ma Lin

___
Python tracker 

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



[issue35411] FTP tests of test_urllib2net fail on Travis CI: 425 Security: Bad IP connecting.

2019-02-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +11907

___
Python tracker 

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



[issue35688] "pip install --user numpy" fails on Python from the Windows Store

2019-02-15 Thread mattip


mattip  added the comment:

Closing. It seems the days of modifying os.environ['PATH'] on windows are over, 
and packages need to adopt to calling AddDllDirectory. As long as python is 
built with ctypes, this is easy enough to adopt, even though there are some 
caveats. See the issue from anaconda 
https://github.com/ContinuumIO/anaconda-issues/issues/10628

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue33570] OpenSSL 1.1.1 / TLS 1.3 cipher suite changes

2019-02-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c49f63c1761ce03df7850b9e0b31a18c432dac64 by Victor Stinner 
(stratakis) in branch '2.7':
[2.7] bpo-33570: TLS 1.3 ciphers for OpenSSL 1.1.1 (GH-6976) (GH-8760) 
(GH-10607)
https://github.com/python/cpython/commit/c49f63c1761ce03df7850b9e0b31a18c432dac64


--
nosy: +vstinner

___
Python tracker 

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



[issue36002] configure --enable-optimizations with clang fails to detect llvm-profdata

2019-02-15 Thread Martijn Pieters


New submission from Martijn Pieters :

This is probably a automake bug.

When running CC=clang CXX=clang++ ./configure --enable-optimizations, configure 
tests for a non-existing -llvm-profdata binary:

checking for --enable-optimizations... yes
checking for --with-lto... no
checking for -llvm-profdata... no
configure: error: llvm-profdata is required for a --enable-optimizations build 
but could not be found.

The generated configure script looks for "$target_alias-llvm-profdata", and 
$target_alias is an empty string.

This problem is not visible on Macs, where additional checks for 
"/usr/bin/xcrun -find llvm-profdata" locate the binary.

The work-around would be to specify a target when configuring.

--
components: Build
messages: 335610
nosy: mjpieters
priority: normal
severity: normal
status: open
title: configure --enable-optimizations with clang fails to detect llvm-profdata
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



[issue35986] print() documentation typo?

2019-02-15 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Yes, but I thought that would be up to @theacodes to release a new version of 
python-docs-theme to PyPI?  Since the last release was 6 months ago and the 
previous one to that was February 2018, I was hoping the new release would come 
soon.

In any event, I didn't think there was anything else that could be done on this 
issue, which is why I closed it.  Is there something that needs to be updated 
in the CPython repository?

--

___
Python tracker 

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



[issue36003] set better defaults for TCPServer options

2019-02-15 Thread Giampaolo Rodola'


New submission from Giampaolo Rodola' :

socketserver.TCPServer provides the following defaults:

allow_reuse_address = False
request_queue_size = 5

Proposal is to:
* have "allow_reuse_address = True" on POSIX in order to immediately reuse 
previous sockets which were bound on the same address and remained in TIME_WAIT 
state
* have "request_queue_size = None" so that it's up to socket.listen() to choose 
a default reasonable value (usually 128)

--
components: Library (Lib)
keywords: easy
messages: 335612
nosy: asvetlov, giampaolo.rodola, neologix, yselivanov
priority: normal
severity: normal
status: open
title: set better defaults for TCPServer options
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue35986] print() documentation typo?

2019-02-15 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

not in the CPython repo, just ask to regenerate the PyPI package. thanks

--

___
Python tracker 

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



[issue36003] set better defaults for TCPServer options

2019-02-15 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

Update: because "request_queue_size" is passed to server_activate() method 
which can be subclassed, a better default for not breaking backward 
compatibility is 0 (not None).

--

___
Python tracker 

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



[issue28043] Sane defaults for SSLContext options and ciphers

2019-02-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b8eaec697a2b5d9d2def2950a0aa50e8ffcf1059 by Victor Stinner 
(stratakis) in branch '2.7':
[2.7] bpo-28043: improved default settings for SSLContext (GH-10608)
https://github.com/python/cpython/commit/b8eaec697a2b5d9d2def2950a0aa50e8ffcf1059


--
nosy: +vstinner

___
Python tracker 

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



[issue36004] Add datetime.fromisocalendar

2019-02-15 Thread Paul Ganssle


New submission from Paul Ganssle :

Datetime has many methods that "serializes" an instance to some other format - 
toordinal, timestamp, isoformat, etc. Most methods that "serialize" a datetime 
have a corresponding method that "deserializes" that method, or another way to 
reverse the operation:

- strftime / strptime
- timestamp / fromtimestamp
- isoformat / fromisoformat
- toordinal / fromordinal
- timetuple / datetime(*thetuple[0:6])

However, as I found out when implementing `dateutil.parser.isoparse`, there is 
no simple way to invert `isocalendar()`.

I have an implementation as part of dateutil.parser.isoparse:

https://github.com/dateutil/dateutil/blob/master/dateutil/parser/isoparser.py#L297

If there are no objections, I'd like to add an implementation in CPython 
itself. Thinking the name should be `fromisocalendar`.

--
components: Library (Lib)
messages: 335616
nosy: belopolsky, lemburg, p-ganssle
priority: low
severity: normal
status: open
title: Add datetime.fromisocalendar
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue36004] Add datetime.fromisocalendar

2019-02-15 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

+1

--
nosy: +matrixise

___
Python tracker 

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



[issue36003] set better defaults for TCPServer options

2019-02-15 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


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

___
Python tracker 

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



[issue32947] Support OpenSSL 1.1.1

2019-02-15 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
pull_requests: +11910

___
Python tracker 

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



[issue35132] python-gdb error: Python Exception Type does not have a target

2019-02-15 Thread Dylan Cali


Dylan Cali  added the comment:

> Hum, Dylan: what is your gdb version?

$ gdb --version
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1

> On Fedora 29 with gdb 8.2-6.fc29, it seems like .target() is useless

I can confirm removing the .target() call in libpython.py resolved the issue 
for me with no ill effects

> You can try faulthandler has a workaround.

I'll give this a try, thank you

--

___
Python tracker 

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



[issue29136] Add OP_NO_TLSv1_3

2019-02-15 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
pull_requests: +11911

___
Python tracker 

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



[issue36005] [2.7] test_ssl failures on ARMv7 Ubuntu 2.7 with OpenSSL 1.1.1a

2019-02-15 Thread STINNER Victor


New submission from STINNER Victor :

Extract of pythoninfo:

ssl.HAS_SNI: True
ssl.OPENSSL_VERSION: OpenSSL 1.1.1a  20 Nov 2018
ssl.OPENSSL_VERSION_INFO: (1, 1, 1, 1, 15)
ssl.OP_ALL: -0x7fac
ssl.OP_NO_TLSv1_1: 0x1000

https://buildbot.python.org/all/#/builders/92/builds/325

Many tests with TLS errors. A few examples:

ERROR: test_connect (test.test_ssl.NetworkedTests)
...
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed 
(_ssl.c:727)

ERROR: test_protocol_sslv23 (test.test_ssl.ThreadedTests)
Connecting to an SSLv23 server with various client options
--
...
self._sslobj.do_handshake()
SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version 
(_ssl.c:727)

ERROR: test_networked_good_cert (test.test_httplib.HTTPSTest)
...
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed 
(_ssl.c:727)

ERROR: test_context_argument (test.test_urllibnet.urlopen_HttpsTests)
...
IOError: [Errno socket error] [SSL: CERTIFICATE_VERIFY_FAILED] certificate 
verify failed (_ssl.c:727)

--

There are other failures which may be unrelated:

ERROR: test_fileno (test.test_urllib2net.OtherNetworkTests)
...
HTTPError: HTTP Error 404: Not Found



This buildbot build contains 5 changes:

[2.7] bpo-33570: TLS 1.3 ciphers for OpenSSL 1.1.1 (GH-6976) (GH-8760) 
(GH-10607)(3 hours ago)
bpo-35746: Credit Colin Read and Nicolas Edet (GH-11866)(5 hours ago)
Doc sidebar: 3.6 has moved to security-fix mode. (GH-11810)(5 days ago)
[2.7] Fix url to core-mentorship mailing list (GH-11775). (GH-11778)(9 days 
ago)
bpo-25592: Improve documentation of distutils data_files (GH-9767) 
(GH-11734)(13 days ago)

I bet that it's a regression caused by:

https://github.com/python/cpython/commit/c49f63c1761ce03df7850b9e0b31a18c432dac64

--
components: Tests
messages: 335619
nosy: vstinner
priority: normal
severity: normal
status: open
title: [2.7] test_ssl failures on ARMv7 Ubuntu 2.7 with OpenSSL 1.1.1a
type: security
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



[issue35928] socket makefile read-write discards received data

2019-02-15 Thread nr


Change by nr :


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



[issue35996] Optional modulus argument for new math.prod() function

2019-02-15 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue35880] math.sin has no backward error; this isn't documented

2019-02-15 Thread Mark Dickinson


Mark Dickinson  added the comment:

@jneb: Please could you clarify what sort of addition to the documentation 
you're proposing? Again, it's not clear what you mean by "backward error" here, 
or what sort of addition would be useful given the divergence of math function 
behaviours across platforms. Any documentation addition should cover more than 
just sin here; sin isn't at all special.

Setting to pending.

--
status: open -> pending

___
Python tracker 

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



[issue36005] [2.7] test_ssl failures on ARMv7 Ubuntu 2.7 with OpenSSL 1.1.1a

2019-02-15 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like this worker was offline for 1 month: build 324 was 1 month ago, 
whereas build 325 was 3 hours ago.

--

___
Python tracker 

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



[issue36005] [2.7] test_ssl failures on ARMv7 Ubuntu 2.7 with OpenSSL 1.1.1a

2019-02-15 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +cstratak, gregory.p.smith

___
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-02-15 Thread Davin Potts


Davin Potts  added the comment:

These questions (originally asked in comments on GH-11816) seemed more 
appropriate to discuss here:
Why should the user want to use `SharedMemory` directly?
Why not just go through the manager?  Also, perhaps a
naive question: don't you _always_ need a `start()`ed
manager in order for the processes to communicate?
Doesn't `SharedMemoryServer` has to be involved?

I think it helps to discuss the last question first.  A SharedMemoryManager is 
*not* needed for two processes to share information across a shared memory 
block, nor is a SharedMemoryServer required.  The docs have examples 
demonstrating this but here is another meant to showcase exactly this:

Start up a Python shell and do the following:
>>> from multiprocessing import shared_memory
>>> shm = shared_memory.SharedMemory(name=None, size=10)
>>> shm.buf[:5] = b'Feb15'
>>> shm.name  # Note this name and use it in the next steps
'psm_26792_26631'

Start up a second Python shell in a new window and do the following:
>>> from multiprocessing import shared_memory
>>> also_shm = shared_memory.SharedMemory(name='psm_26792_26631')  # 
Use that same name
>>> bytes(also_shm.buf[:5])
b'Feb15'

If also_shm.buf is further modified in the second shell, those
changes will be visible on shm.buf in the first shell.  The same
is true of the reverse.

The key point is that there is no sending of messages between the processes at 
all.  In stark contrast, SyncManager offers and supports objects held in 
"distributed shared memory" where messages must be sent from one process to 
another to access or manipulate data; those objects held in "distributed shared 
memory" *must* have a SyncManager+Server to enable their use.  That is not 
needed at all for SharedMemory because access to and manipulation of the data 
is performed directly without the cost-delay of messaging.

This begs a new question, "so what is the SharedMemoryManager used for then?"  
The docs answer:
To assist with the life-cycle management of shared memory
especially across distinct processes, a BaseManager subclass,
SharedMemoryManager, is also provided.
Because shared memory blocks are not "owned" by a single process, they are not 
destroyed/freed when a process exits.  A SharedMemoryManager is used to ensure 
the free-ing of a shared memory block when it is no longer needed.

New SharedMemory instances may be created via a SharedMemoryManager (in which 
case their birth-to-death life-cycle is being managed) or they may be created 
directly as seen in the above example.  Returning to the first question, "Why 
should the user want to use `SharedMemory` directly?", there are more use cases 
than these two:
1. In process 1, a shared memory block is created by calling 
SharedMemoryManager.SharedMemory().  In process 2, we need to attach to that 
existing shared memory block and can do so by referring to its name.  This is 
accomplished as in the above example by simply calling 
SharedMemory(name='uniquename').  We do not want to attach to it via a second 
SharedMemoryManager because only one manager should oversee the life-cycle of a 
single shared memory block.
2. Sometimes direct management of the life-cycle of a shared memory block is 
desirable.  For example, on systems supporting POSIX shared memory, it is a 
feature that shared memory blocks outlive processes.  Some services choose to 
speed a service restart by preserving state data in shared memory, saving the 
newly restarted service from rebuilding it.  The SharedMemoryManager provides 
one life-cycle strategy but can not cover all scenarios so the option to 
directly manage it is important.

--

___
Python tracker 

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



[issue33570] OpenSSL 1.1.1 / TLS 1.3 cipher suite changes

2019-02-15 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
pull_requests: +11913

___
Python tracker 

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



[issue35998] ./python -m test test_asyncio fails

2019-02-15 Thread STINNER Victor


Change by STINNER Victor :


--
components: +Tests, asyncio
nosy: +asvetlov, yselivanov

___
Python tracker 

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



[issue5038] urrlib2/httplib doesn't reset file position between requests

2019-02-15 Thread nr


nr  added the comment:

PR 11843 should fix the issue in master, I didn't check python 2.6 or prior 
versions. The problem is that in the first request sent to HTTP service the 
POST data is sent correctly. After that the HTTP server responds with 401 and 
the request is resent but the mmap file pointer is pointing now to the end of 
the file because it has been fully read in the requests before. The PR just 
seeks to the beginning of the file after the file has been read and sends the 
request with auth credentials including POST body.

--
nosy: +nr

___
Python tracker 

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



[issue35998] ./python -m test test_asyncio fails

2019-02-15 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue32947] Support OpenSSL 1.1.1

2019-02-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2149a9ad7a9d39d7d680ec0fb602042c91057484 by Victor Stinner 
(stratakis) in branch '2.7':
[2.7] bpo-32947: Fixes for TLS 1.3 and OpenSSL 1.1.1 (GH-8761) (GH-11876)
https://github.com/python/cpython/commit/2149a9ad7a9d39d7d680ec0fb602042c91057484


--

___
Python tracker 

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



[issue35997] ImportError: dlopen failed: cannot locate symbol "PyBool_Type"

2019-02-15 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

It is not yet possible to cross-compile python extensions. The reason is that 
_init_posix() in  Lib/sysconfig.py still reads the sysconfigdata module of the 
native compiler instead of the sysconfigdata of the cross-built one. See the 
patch in issue #28833.

--

___
Python tracker 

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



[issue35998] ./python -m test test_asyncio fails

2019-02-15 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Not sure if it's related but there was a similar report on failure in freebsd 
bots with tls1.3 : issue35031 . Can you please add SSL info with ./python -m 
test.pythoninfo | grep ssl ?

Test runs fine on my ubuntu 16.04 machine with below info

$ ./python -m test.pythoninfo | grep ssl
ssl.HAS_SNI: True
ssl.OPENSSL_VERSION: OpenSSL 1.0.2g  1 Mar 2016
ssl.OPENSSL_VERSION_INFO: (1, 0, 2, 7, 15)
ssl.OP_ALL: 0x83ff
ssl.OP_NO_TLSv1_1: 0x1000

--
nosy: +xtreak

___
Python tracker 

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



[issue36005] [2.7] test_ssl failures on ARMv7 Ubuntu 2.7 with OpenSSL 1.1.1a

2019-02-15 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
superseder:  -> test_httplib test_nntplib test_ssl fail on ARMv7 Debian buster 
buildbot

___
Python tracker 

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



[issue36005] [2.7] test_ssl failures on ARMv7 Ubuntu 2.7 with OpenSSL 1.1.1a

2019-02-15 Thread Gregory P. Smith


Change by Gregory P. Smith :


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



[issue36005] [2.7] test_ssl failures on ARMv7 Ubuntu 2.7 with OpenSSL 1.1.1a

2019-02-15 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

The buildbot was only offline for a few days while I upgraded the OS.  do not 
look at the _delta_ between builds in the buildbot to determine a failure 
across that change as it went from ubuntu 14.04 to debian buster.

2.7 doesn't change often.

--

___
Python tracker 

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



[issue36005] [2.7] test_ssl failures on ARMv7 Ubuntu 2.7 with OpenSSL 1.1.1a

2019-02-15 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

i duped this to the existing issue that was filed after the OS upgrade under 
the assumption it is the same thing.

--

___
Python tracker 

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



[issue35998] test_asyncio: test_start_tls_server_1() TimeoutError on Fedora 29

2019-02-15 Thread STINNER Victor


Change by STINNER Victor :


--
title: ./python -m test test_asyncio fails -> test_asyncio: 
test_start_tls_server_1() TimeoutError on Fedora 29

___
Python tracker 

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



[issue35998] test_asyncio: test_start_tls_server_1() TimeoutError on Fedora 29

2019-02-15 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

Fedora 29 has openssl 1.1.1 which seems to be related.

--
nosy: +cstratak

___
Python tracker 

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



[issue35925] test_httplib test_nntplib test_ssl fail on ARMv7 Debian buster buildbot

2019-02-15 Thread STINNER Victor


STINNER Victor  added the comment:

Does test_ssl pass on the master branch?

--
nosy: +vstinner

___
Python tracker 

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



[issue35928] socket makefile read-write discards received data

2019-02-15 Thread nr


nr  added the comment:

Added PR 11878, this will pass both this bug report and PR 3918 regression, the 
commit Ammar noted, it is an addition to this change.

--
nosy: +nr

___
Python tracker 

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



[issue33570] OpenSSL 1.1.1 / TLS 1.3 cipher suite changes

2019-02-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c3c49ec56890d9d591f8fd1609c8436019f28f96 by Victor Stinner 
(stratakis) in branch '2.7':
[2.7] bpo-33570: Enable OpenSSL 1.1.1 testing within the multissltests 
(GH-11879)
https://github.com/python/cpython/commit/c3c49ec56890d9d591f8fd1609c8436019f28f96


--

___
Python tracker 

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



[issue36006] [good first issue] Align version changed for truncate in io module

2019-02-15 Thread Cheryl Sabella


New submission from Cheryl Sabella :

In the documentation page for the io module, under the truncate method, there 
is a version changed directive which is not properly aligned.

https://docs.python.org/3/library/io.html#io.IOBase.truncate

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 335633
nosy: cheryl.sabella, docs@python
priority: normal
severity: normal
stage: needs patch
status: open
title: [good first issue] Align version changed for truncate in io module
type: enhancement
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



[issue32947] Support OpenSSL 1.1.1

2019-02-15 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
nosy:  -yan12125

___
Python tracker 

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



[issue36006] [good first issue] Align version changed for truncate in io module

2019-02-15 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

I take it

--
nosy: +eamanu

___
Python tracker 

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



[issue35998] test_asyncio: test_start_tls_server_1() TimeoutError on Fedora 29

2019-02-15 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I can confirm that this fails on a fresh fedora 29 VM as of commit 355f16f. The 
changes in PR 10011 make this test pass.

SSL version and OS details

$ cat /etc/fedora-release
Fedora release 29 (Twenty Nine)
$ uname -a
Linux fedora-s-1vcpu-1gb-blr1-01 4.20.7-200.fc29.x86_64 #1 SMP Wed Feb 6 
19:16:42 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ ./python -m test.pythoninfo | grep ssl
ssl.HAS_SNI: True
ssl.OPENSSL_VERSION: OpenSSL 1.1.1a FIPS  20 Nov 2018
ssl.OPENSSL_VERSION_INFO: (1, 1, 1, 1, 15)
ssl.OP_ALL: 0x8054
ssl.OP_NO_TLSv1_1: 0x1000

# Test failure with tracemalloc

$ ./python -X tracemalloc -m unittest -v 
test.test_asyncio.test_sslproto.SelectorStartTLSTests
test_buf_feed_data (test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... 
ok
test_create_connection_ssl_failed_certificate 
(test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... ok
test_create_connection_ssl_slow_handshake 
(test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... ok
test_handshake_timeout (test.test_asyncio.test_sslproto.SelectorStartTLSTests) 
... ok
test_start_tls_client_buf_proto_1 
(test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... ok
test_start_tls_client_corrupted_ssl 
(test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... ok
test_start_tls_client_reg_proto_1 
(test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... ok
test_start_tls_server_1 (test.test_asyncio.test_sslproto.SelectorStartTLSTests) 
... /root/cpython/Lib/asyncio/sslproto.py:321: ResourceWarning: unclosed 
transport 
  _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
Object allocated at (most recent call last):
  File "/root/cpython/Lib/asyncio/sslproto.py", lineno 446
self._app_transport = _SSLProtocolTransport(self._loop, self)
ERROR
test_start_tls_slow_client_cancel 
(test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... Unhandled error in 
exception handler
context: {'message': 'Future exception was never retrieved', 'exception': 
ConnectionResetError(104, 'Connection reset by peer'), 'future': }
Traceback (most recent call last):
  File "/root/cpython/Lib/asyncio/base_events.py", line 1653, in 
call_exception_handler
self._exception_handler(self, context)
  File "/root/cpython/Lib/test/test_asyncio/functional.py", line 22, in 
loop_exception_handler
self.loop.default_exception_handler(context)
AttributeError: 'NoneType' object has no attribute 'default_exception_handler'
/root/cpython/Lib/asyncio/base_events.py:675: ResourceWarning: unclosed 

  timer = events.TimerHandle(when, callback, args, self, context)
Object allocated at (most recent call last):
  File "/root/cpython/Lib/asyncio/base_events.py", lineno 1360
sock = socket.socket(af, socktype, proto)
ok
test_start_tls_wrong_args 
(test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... ok

==
ERROR: test_start_tls_server_1 
(test.test_asyncio.test_sslproto.SelectorStartTLSTests)
--
Traceback (most recent call last):
  File "/root/cpython/Lib/test/test_asyncio/test_sslproto.py", line 510, in 
test_start_tls_server_1
self.loop.run_until_complete(run_main())
  File "/root/cpython/Lib/asyncio/base_events.py", line 589, in 
run_until_complete
return future.result()
  File "/root/cpython/Lib/test/test_asyncio/test_sslproto.py", line 503, in 
run_main
await asyncio.wait_for(
  File "/root/cpython/Lib/asyncio/tasks.py", line 461, in wait_for
raise exceptions.TimeoutError()
asyncio.exceptions.TimeoutError

--
Ran 10 tests in 63.797s

FAILED (errors=1)

# With PR 10011 applied to Fedora

$ ./python -X tracemalloc -m unittest -v 
test.test_asyncio.test_sslproto.SelectorStartTLSTests
test_buf_feed_data (test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... 
ok
test_create_connection_ssl_failed_certificate 
(test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... ok
test_create_connection_ssl_slow_handshake 
(test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... ok
test_handshake_timeout (test.test_asyncio.test_sslproto.SelectorStartTLSTests) 
... ok
test_start_tls_client_buf_proto_1 
(test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... ok
test_start_tls_client_corrupted_ssl 
(test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... ok
test_start_tls_client_reg_proto_1 
(test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... ok
test_start_tls_server_1 (test.test_asyncio.test_sslproto.SelectorStartTLSTests) 
... ok
test_start_tls_slow_client_cancel 
(test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... ok
test_start_tls_wrong_args 
(test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... ok

--
Ran 10 tests in 3.734s

OK

--
nosy: +pablogsal


[issue36006] [good first issue] Align version changed for truncate in io module

2019-02-15 Thread Mariatta Wijaya


Mariatta Wijaya  added the comment:

Thanks!

--
nosy: +Mariatta
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



[issue36006] [good first issue] Align version changed for truncate in io module

2019-02-15 Thread miss-islington


miss-islington  added the comment:


New changeset 522630a7462f606300f1e6e6818de191d9dc3fdf by Miss Islington (bot) 
(Emmanuel Arias) in branch 'master':
bpo-36006: Fix versionchanged directive alignment in io module documentation 
(GH-11881)
https://github.com/python/cpython/commit/522630a7462f606300f1e6e6818de191d9dc3fdf


--
nosy: +miss-islington

___
Python tracker 

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



[issue36006] [good first issue] Align version changed for truncate in io module

2019-02-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11915

___
Python tracker 

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



[issue35925] test_httplib test_nntplib test_ssl fail on ARMv7 Debian buster buildbot

2019-02-15 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Not on this debian buster bot.  look back a couple comments, there is a 
workaround.  it seems to be an OpenSSL configuration issue / test expectations 
issue.

I think we should ultimately get our test suite so that it passes in default OS 
distro OpenSSL configs.

That could mean any of an altered environment for some tests, or skipping some 
tests in such an environment, or changing some tests to fit within modern 
OpenSSL desired ciphersuite/protocol setting constrains constraints - or a mix 
of all three.

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



[issue35925] test_httplib test_nntplib test_ssl fail on ARMv7 Debian buster buildbot

2019-02-15 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
nosy: +benjamin.peterson, ned.deily
priority: normal -> release blocker
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue35925] test_httplib test_nntplib test_ssl fail on ARMv7 Debian buster bot (OpenSSL 1.1.1a)

2019-02-15 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
title: test_httplib test_nntplib test_ssl fail on ARMv7 Debian buster buildbot 
-> test_httplib test_nntplib test_ssl fail on ARMv7 Debian buster bot (OpenSSL 
1.1.1a)

___
Python tracker 

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



[issue35925] test_httplib test_nntplib test_ssl fail on ARMv7 Debian buster bot (OpenSSL 1.1.1a)

2019-02-15 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

release managers are free to defer this blocker.  i'm just marking it as such 
for the purposes of making sure it is a conscious decision.

The problem is more likely with our test suite vs the environment than it is 
with CPython itself.

--

___
Python tracker 

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



[issue36004] Add datetime.fromisocalendar

2019-02-15 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

+1

--
nosy: +eamanu

___
Python tracker 

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



[issue35925] test_httplib test_nntplib test_ssl fail on ARMv7 Debian buster bot (OpenSSL 1.1.1a)

2019-02-15 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

FWIW I've just manually confirmed that running Python 2.7's test_ssl with 
OPENSSL_CONF=/invalid-path set passes on the debian buster buildbot host.

--

___
Python tracker 

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



[issue35931] pdb: "debug print(" crashes with SyntaxError

2019-02-15 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

ping reviewer :-)

I test this PR and work fine on Ubuntu 18.04

--
nosy: +eamanu

___
Python tracker 

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



[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-15 Thread Brennan D Baraban


Brennan D Baraban <3...@holbertonschool.com> added the comment:

Yes, I will submit a new PR today.

--

___
Python tracker 

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



[issue35931] pdb: "debug print(" crashes with SyntaxError

2019-02-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11916

___
Python tracker 

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



[issue35931] pdb: "debug print(" crashes with SyntaxError

2019-02-15 Thread miss-islington


miss-islington  added the comment:


New changeset 4327705cfab3eb09073ec828570bbd8f789e1611 by Miss Islington (bot) 
(Daniel Hahler) in branch 'master':
bpo-35931: Gracefully handle SyntaxError in pdb debug command (GH-11782)
https://github.com/python/cpython/commit/4327705cfab3eb09073ec828570bbd8f789e1611


--
nosy: +miss-islington

___
Python tracker 

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



[issue35931] pdb: "debug print(" crashes with SyntaxError

2019-02-15 Thread miss-islington


miss-islington  added the comment:


New changeset 6f352199e4447764bc472e34352d0dff4db8a52d by Miss Islington (bot) 
in branch '3.7':
bpo-35931: Gracefully handle SyntaxError in pdb debug command (GH-11782)
https://github.com/python/cpython/commit/6f352199e4447764bc472e34352d0dff4db8a52d


--

___
Python tracker 

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



[issue35931] pdb: "debug print(" crashes with SyntaxError

2019-02-15 Thread Zachary Ware


Zachary Ware  added the comment:

Thanks for the patch!

--
nosy: +zach.ware
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



[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-15 Thread Eric Snow


Eric Snow  added the comment:

On Wed, Feb 13, 2019 at 10:56 AM Steve Dower  wrote:
> Nick, Victor, Eric, (others?) - are you interested in having a virtual 
> whiteboard session to brainstorm how the "perfect" initialization looks? And 
> probably a follow-up to brainstorm how to get there without breaking the 
> world? I don't think we're going to get to be in the same room anytime before 
> the language summit, and it would be awesome to have something concrete to 
> discuss there.

Count me in.  This is a pretty important topic and doing this would
help accelerate our efforts by giving us a clearer common
understanding and objective.  FWIW, I plan on spending at least 5
minutes of my 25 minute PyCon talk on our efforts to fix up the C-API,
and this runtime initialization stuff is an important piece.

--

___
Python tracker 

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



[issue35996] Optional modulus argument for new math.prod() function

2019-02-15 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +tim.peters

___
Python tracker 

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



[issue36006] [good first issue] Align version changed for truncate in io module

2019-02-15 Thread Emmanuel Arias


Change by Emmanuel Arias :


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



[issue35931] pdb: "debug print(" crashes with SyntaxError

2019-02-15 Thread daniel hahler


daniel hahler  added the comment:

Thanks for the review and backport!

--

___
Python tracker 

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



[issue36006] [good first issue] Align version changed for truncate in io module

2019-02-15 Thread miss-islington


miss-islington  added the comment:


New changeset 05f41363d4876a63acd8016cbf56b4f4e809e41f by Miss Islington (bot) 
in branch '3.7':
bpo-36006: Fix versionchanged directive alignment in io module documentation 
(GH-11881)
https://github.com/python/cpython/commit/05f41363d4876a63acd8016cbf56b4f4e809e41f


--

___
Python tracker 

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



[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-15 Thread Eric Snow


Eric Snow  added the comment:

On Wed, Feb 13, 2019 at 5:09 PM Steve Dower  wrote:
> This is why I'm keen to design the ideal *user* API first (that is, write the 
> examples of how you would use it) and then figure out how we can make it fit.
> It's kind of the opposite approach from what you've been doing to adapt the 
> existing code to suit particular needs.

That makes sense. :)

> For example, imagine instead of all the PySet*() functions followed by 
> Py_Initialize() you could do this:
>
> PyObject *runtime = PyRuntime_Create();

FYI, we already have a _PyRuntimeState struct (see
Include/internal/pycore_pystate.h) which is where I pulled in a lot of
the static globals last year.  Now there is one process-global
_PyRuntime (created in Python/pylifecycle.c) in place of all those
globals.  Note that _PyRuntimeState is in parallel with
PyInterpreterState, so not a PyObject.

> /* optional calls */
> PyRuntime_SetAllocators(runtime, &my_malloc, &my_realloc, &my_free);
> PyRuntime_SetHashSeed(runtime, 12345);

Note that one motivation behind PEP 432 (and its config structs) is to
keep all the config together.  Having the one struct means you always
clearly see what your options are.  Another motivation is to keep the
config (dense with public fields) separate from the actual run state
(opaque).  Having a bunch of config functions (and global variables in
the status quo) means a lot more surface area to deal with when
embedding, as opposed to 2 config structs + a few initialization
functions (and a couple of helpers) like in PEP 432.

I don't know that you consciously intended to move away from the dense
config struct route, so I figured I'd be clear. :)

> /* sets this as the current runtime via a thread local */
> auto old_runtime = PyRuntime_Activate(runtime);
> assert(old_runtime == NULL)

Hmm, there are two ways we could go with this: keep using TLS (or
static global in the case of _PyRuntime) or update the C-API to
require explicitly passing the context (e.g. runtime, interp, tstate,
or some wrapper) into all the functions that need it.  Of course,
changing that would definitely need some kind of compatibility shim to
avoid requiring massive changes to every extension out there, which
would mean effectively 2 C-APIs mirroring each other.  So sticking
with TLS is simpler.  Personally, I'd prefer going the explicit
argument route.

>
> /* pretend triple quoting works in C for a minute ;) */
> const char *init_code = """
> [snip]
> """;
>
> PyObject *globals = PyDict_New();
> /* only UTF-8 support at this stage */
> PyDict_SetItemString(globals, "argv0", PyUnicode_FromString(argv[0]));
> PyRuntime_Initialize(runtime, init_code, globals);

Nice.  I like that this keeps the init code right by where it's used,
while also making it much more concise and easier to follow (since
it's Python code).

> PyEval_EvalString("open('file.txt', 'w', encoding='gb18030').close()");

I definitely like the approach of directly embedding the Python code
like this. :)  Are there any downsides?

> Maybe it's a terrible idea?

Nah, we definitely want to maximize simplicity and your example offers
a good shift in that direction. :)

> Honestly I'd be inclined to do other big changes at the same time (make 
> PyObject opaque and interface driven, for example).

Definitely!  Those aren't big blockers on cleaning up initialization
though, are they?

> My point is that if the goal is to "move the existing internals around" then 
> that's all we'll ever achieve. If we can say "the goal is to make this 
> example work" then we'll be able to do much more.

Yep.  I suppose part of the problem is that the embedding use cases
aren't understood (or even recognized) well enough.

--

___
Python tracker 

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



[issue35459] Use PyDict_GetItemWithError() instead of PyDict_GetItem()

2019-02-15 Thread Eric Snow


Eric Snow  added the comment:

Thanks, Serhiy.  While the benchmark suite is our best tool available for 
measuring performance, I'm not sure what slowdown is significant in those 
results.

@Victor, any thoughts?

--

___
Python tracker 

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



[issue35984] test__xxsubinterpreters leaked [3, 4, 3] memory blocks, sum=1

2019-02-15 Thread miss-islington


miss-islington  added the comment:


New changeset 36433221f06d649dbd7e13f5fec948be8ffb90af by Miss Islington (bot) 
(Alexey Izbyshev) in branch 'master':
bpo-35984: _xxsubinterpreters: Fix memory leak in _channel_send() (GH-11845)
https://github.com/python/cpython/commit/36433221f06d649dbd7e13f5fec948be8ffb90af


--
nosy: +miss-islington

___
Python tracker 

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



[issue35984] test__xxsubinterpreters leaked [3, 4, 3] memory blocks, sum=1

2019-02-15 Thread Eric Snow


Eric Snow  added the comment:

Thanks, Alexey.  I've merged the PR.

As to finding and fixing leaks, I'd welcome any help you have to offer. :)  
Feel free to open an separate issue.  One issue covering all the ones you find 
should be enough.  If you find any non-trivial leaks or other issues then they 
should probably get separate issues.  Thanks again!

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

___
Python tracker 

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



  1   2   >