[issue34436] Overallocation is never disabled in _PyBytes_FormatEx()

2018-08-23 Thread STINNER Victor


STINNER Victor  added the comment:

bytes % args has been optimized using the _PyBytesWriter API in bpo-25349: 
commit fa7762ec066aa3632a25b6a52bb7597b8f17c2f3.

I converted my old benchmark from bpo-25349 to my new perf module:
https://github.com/vstinner/pymicrobench/blob/master/bench_bytes_format_int.py

See also my article on _PyBytesWriter API: 
https://vstinner.github.io/pybyteswriter.html

--

___
Python tracker 

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



[issue34436] Overallocation is never disabled in _PyBytes_FormatEx()

2018-08-23 Thread STINNER Victor


STINNER Victor  added the comment:

I ran a microbenchmark on PR 8826:

./python -m perf timeit -s 'fmt=b"%s%s"; args=(b"1", b"x"*(1024*1024))' 'fmt % 
args' -v -o patch.json

$ python3 -m perf compare_to ref.json patch.json
Mean +- std dev: [ref] 325 us +- 7 us -> [patch] 36.2 us +- 1.1 us: 8.98x 
faster (-89%)

Ooops, yeah, it's obvious that there was a missed optimization. It's now way 
faster ;-)

--

___
Python tracker 

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



[issue34436] Overallocation is never disabled in _PyBytes_FormatEx()

2018-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8339

___
Python tracker 

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



[issue34436] Overallocation is never disabled in _PyBytes_FormatEx()

2018-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8340

___
Python tracker 

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



[issue34436] Overallocation is never disabled in _PyBytes_FormatEx()

2018-08-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ccd99752675042bd5f67d332c5b0ed85ba1f2da3 by Victor Stinner 
(Alexey Izbyshev) in branch 'master':
bpo-34436: Fix check that disables overallocation for the last fmt specifier 
(GH-8826)
https://github.com/python/cpython/commit/ccd99752675042bd5f67d332c5b0ed85ba1f2da3


--

___
Python tracker 

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



[issue34436] Overallocation is never disabled in _PyBytes_FormatEx()

2018-08-23 Thread miss-islington


miss-islington  added the comment:


New changeset 042082692b7fab7361a8c9d0fb792532bb77e293 by Miss Islington (bot) 
in branch '3.7':
bpo-34436: Fix check that disables overallocation for the last fmt specifier 
(GH-8826)
https://github.com/python/cpython/commit/042082692b7fab7361a8c9d0fb792532bb77e293


--
nosy: +miss-islington

___
Python tracker 

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



[issue34436] Overallocation is never disabled in _PyBytes_FormatEx()

2018-08-23 Thread miss-islington


miss-islington  added the comment:


New changeset 945771b3c7a08f0b2b875905d517a1566477bfaf by Miss Islington (bot) 
in branch '3.6':
bpo-34436: Fix check that disables overallocation for the last fmt specifier 
(GH-8826)
https://github.com/python/cpython/commit/945771b3c7a08f0b2b875905d517a1566477bfaf


--

___
Python tracker 

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



[issue34423] Overflow when casting from double to time_t, and_PyTime_t.

2018-08-23 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like a regression introduced by:

commit a853a8ba7850381d49b284295dd6f0dc491dbe44
Author: Benjamin Peterson 
Date:   Thu Sep 7 11:13:59 2017 -0700

bpo-31373: fix undefined floating-point demotions (#3396)

--

___
Python tracker 

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



[issue6700] inspect.getsource() returns incorrect source lines at the module level

2018-08-23 Thread Tal Einat


Change by Tal Einat :


--
versions: +Python 3.8 -Python 3.5

___
Python tracker 

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



[issue34423] Overflow when casting from double to time_t, and_PyTime_t.

2018-08-23 Thread STINNER Victor


STINNER Victor  added the comment:

I'm not sure that the pytime.c change in commit 
a853a8ba7850381d49b284295dd6f0dc491dbe44 is correct:

diff --git a/Python/pytime.c b/Python/pytime.c
index 8979adc219..f3c913226c 100644
--- a/Python/pytime.c
+++ b/Python/pytime.c
@@ -276,7 +278,6 @@ static int
 _PyTime_FromFloatObject(_PyTime_t *t, double value, _PyTime_round_t round,
 long unit_to_ns)
 {
-double err;
 /* volatile avoids optimization changing how numbers are rounded */
 volatile double d;
 
@@ -285,12 +286,11 @@ _PyTime_FromFloatObject(_PyTime_t *t, double value, 
_PyTime_round_t round,
 d *= (double)unit_to_ns;
 d = _PyTime_Round(d, round);
 
-*t = (_PyTime_t)d;
-err = d - (double)*t;
-if (fabs(err) >= 1.0) {
+if (!_Py_InIntegralTypeRange(_PyTime_t, d)) {
 _PyTime_overflow();
 return -1;
 }
+*t = (_PyTime_t)d;
 return 0;
 }


I don't think that modifying _Py_InIntegralTypeRange() macro to replace "<=" 
with "<" is correct, since this bug is very specific to pytime.c, when 
_Py_InIntegralTypeRange() is used with a double. The PR proposes:

#define _Py_InIntegralTypeRange(type, v) (_Py_IntegralTypeMin(type) <= v && v < 
_Py_IntegralTypeMax(type))

--

___
Python tracker 

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



[issue34436] Overallocation is never disabled in _PyBytes_FormatEx()

2018-08-23 Thread Alexey Izbyshev


Alexey Izbyshev  added the comment:

Thank you for benchmarking and merging, 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



[issue6700] inspect.getsource() returns incorrect source lines at the module level

2018-08-23 Thread Tal Einat


Change by Tal Einat :


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



[issue34207] test_cmd_line test_utf8_mode test_warnings fail in all FreeBSD 3.x (3.8) buildbots

2018-08-23 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-08-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8342

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-08-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8344

___
Python tracker 

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



[issue34207] test_cmd_line test_utf8_mode test_warnings fail in all FreeBSD 3.x (3.8) buildbots

2018-08-23 Thread STINNER Victor


STINNER Victor  added the comment:

I confirm that "LC_ALL= LANG= LC_CTYPE= ./python -m test -v test_cmd_line -m 
test_non_ascii" fails on FreeBSD on the master branch, whereas it pass  before 
commit d19d8d5279f156bc8f6736b5f16f069879b9519b. This commit introduced the 
regression.

Thanks for the bisection Nick!

My change avoids modifying global configurable variables, whereas 
Py_DecodeLocale() and Py_EncodeLocale() depend on Py_UTF8Mode.

--

___
Python tracker 

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



[issue34207] test_cmd_line test_utf8_mode test_warnings fail in all FreeBSD 3.x (3.8) buildbots

2018-08-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8343

___
Python tracker 

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



[issue34466] socket.settimeout working incorrectly for connect() method of AF_UNIX socket

2018-08-23 Thread Fedor Korotkiy


Fedor Korotkiy  added the comment:

Hello Benjamin.

That would be appropriate workaround.

Maybe we should update docs to mention it?

--

___
Python tracker 

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



[issue34471] _datetime: Missing NULL check in tzinfo_from_isoformat_results()

2018-08-23 Thread Alexey Izbyshev


New submission from Alexey Izbyshev :

The return value of new_delta() is not checked for NULL at 
https://github.com/python/cpython/blob/ccd99752675042bd5f67d332c5b0ed85ba1f2da3/Modules/_datetimemodule.c#L1292
 and then dereferenced.

Reported by Svace static analyzer.

--
components: Extension Modules
messages: 323934
nosy: belopolsky, izbyshev, p-ganssle, serhiy.storchaka
priority: normal
severity: normal
status: open
title: _datetime: Missing NULL check in tzinfo_from_isoformat_results()
type: behavior
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



[issue34471] _datetime: Missing NULL check in tzinfo_from_isoformat_results()

2018-08-23 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


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

___
Python tracker 

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



[issue34207] test_cmd_line test_utf8_mode test_warnings fail in all FreeBSD 3.x (3.8) buildbots

2018-08-23 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 8867 but it doesn't fix all cases, so I abandonned it.

Then I wrote PR 8868 which sets Py_UTF8Mode in pymain_read_conf() and should 
fix the issue.

The root issue is that we have C functions which depend on the global 
configuration variables like Py_UTF8Mode :-(

--

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-08-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 89487f51b8d6ba8a55f5de0ed689e46fefe73cc9 by Victor Stinner in 
branch 'master':
bpo-34207: Fix pymain_read_conf() for UTF-8 Mode (GH-8868)
https://github.com/python/cpython/commit/89487f51b8d6ba8a55f5de0ed689e46fefe73cc9


--

___
Python tracker 

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



[issue34207] test_cmd_line test_utf8_mode test_warnings fail in all FreeBSD 3.x (3.8) buildbots

2018-08-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 89487f51b8d6ba8a55f5de0ed689e46fefe73cc9 by Victor Stinner in 
branch 'master':
bpo-34207: Fix pymain_read_conf() for UTF-8 Mode (GH-8868)
https://github.com/python/cpython/commit/89487f51b8d6ba8a55f5de0ed689e46fefe73cc9


--

___
Python tracker 

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



[issue34207] test_cmd_line test_utf8_mode test_warnings fail in all FreeBSD 3.x (3.8) buildbots

2018-08-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8346

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-08-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8347

___
Python tracker 

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



[issue34207] test_cmd_line test_utf8_mode test_warnings fail in all FreeBSD 3.x (3.8) buildbots

2018-08-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 80a0ebaa8385988b1d2d71ed1f548fc32ad7 by Victor Stinner in 
branch '3.7':
bpo-34207: Fix pymain_read_conf() for UTF-8 Mode (GH-8868) (GH-8870)
https://github.com/python/cpython/commit/80a0ebaa8385988b1d2d71ed1f548fc32ad7


--

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-08-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 80a0ebaa8385988b1d2d71ed1f548fc32ad7 by Victor Stinner in 
branch '3.7':
bpo-34207: Fix pymain_read_conf() for UTF-8 Mode (GH-8868) (GH-8870)
https://github.com/python/cpython/commit/80a0ebaa8385988b1d2d71ed1f548fc32ad7


--

___
Python tracker 

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



[issue34207] test_cmd_line test_utf8_mode test_warnings fail in all FreeBSD 3.x (3.8) buildbots

2018-08-23 Thread STINNER Victor


STINNER Victor  added the comment:

The regression should now be fixed in 3.7 and master branches.

--

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-08-23 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



[issue34347] AIX: test_utf8_mode.test_cmd_line fails

2018-08-23 Thread STINNER Victor


STINNER Victor  added the comment:

I fixed bpo-34207.

--
nosy: +vstinner

___
Python tracker 

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



[issue34347] AIX: test_utf8_mode.test_cmd_line fails

2018-08-23 Thread STINNER Victor


STINNER Victor  added the comment:

Your issue is about decoding command line argument which is done from main() 
function. It doesn't use Python codecs, but functions like Py_DecodeLocale().

> Question 1: why is windows excluded? Because it does not use UTF-8 as it's 
> default (it's default is CP1252)

Windows uses wmain() which gets command line arguments as wchar_t* strings: 
Unicode. No decoding is needed.

--

___
Python tracker 

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



[issue34472] zipfile: does not include optional descriptor signature

2018-08-23 Thread Silas Sewell


New submission from Silas Sewell :

When adding a fileobj that is not seekable to a zip using the zipfile module, 
the optional signature value 0x08074b50 is not included. This breaks certain 
zip implementations, including the builtin MacOS Archive Utility.

See https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT sections 
4.3.9.3 and 4.3.9.4

--
components: Library (Lib)
files: zip_stream_example.py
messages: 323943
nosy: silas
priority: normal
severity: normal
status: open
title: zipfile: does not include optional descriptor signature
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47760/zip_stream_example.py

___
Python tracker 

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



[issue34472] zipfile: does not include optional descriptor signature

2018-08-23 Thread Silas Sewell


Change by Silas Sewell :


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

___
Python tracker 

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



[issue34412] strsignal(3) does not exist on HP-UX

2018-08-23 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 48ce4897f8f8d91d948ecd1241ffab002df2be9e by Berker Peksag 
(Michael Osipov) in branch 'master':
bpo-34412: Make signal.strsignal() work on HP-UX (GH-8786)
https://github.com/python/cpython/commit/48ce4897f8f8d91d948ecd1241ffab002df2be9e


--
nosy: +berker.peksag

___
Python tracker 

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



[issue34412] strsignal(3) does not exist on HP-UX

2018-08-23 Thread Berker Peksag


Change by Berker Peksag :


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



[issue34473] pip is unusable on Windows 10 1803 - SHA-1 certificates are untrusted

2018-08-23 Thread Matt Tuttle


New submission from Matt Tuttle :

Running pip install ANYTHING results in an SSL failure on Windows 10 1803 
because SHA-1 certificates are untrusted.

--
components: Installation, Windows
messages: 323945
nosy: mtuttle, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: pip is unusable on Windows 10 1803 - SHA-1 certificates are untrusted
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



[issue34474] Python/bltinmodule.c: Missing NULL check in builtin_sum_impl()

2018-08-23 Thread Alexey Izbyshev


New submission from Alexey Izbyshev :

The return value of PyFloat_FromDouble() at 
https://github.com/python/cpython/blob/48ce4897f8f8d91d948ecd1241ffab002df2be9e/Python/bltinmodule.c#L2403
 is not checked for NULL and then dereferenced.

Reported by Svace static analyzer.

A similar issue in an 'if' statement above was fixed in #18560. Note that 2.7 
is affected by both issues, so I can fix both if needed.

--
components: Interpreter Core
messages: 323946
nosy: berker.peksag, izbyshev, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Python/bltinmodule.c: Missing NULL check in builtin_sum_impl()
type: behavior
versions: Python 2.7, 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



[issue34474] Python/bltinmodule.c: Missing NULL check in builtin_sum_impl()

2018-08-23 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


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

___
Python tracker 

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



[issue34475] functools.partial objects have no __qualname__ attribute

2018-08-23 Thread Chris Jerdonek


New submission from Chris Jerdonek :

functools.partial objects have no __qualname__ attribute. This means, for 
example, that code expecting a callable that logs the __qualname__ attribute 
can break when passed a functools.partial object.

Example:

>>> import functools
>>> int.__qualname__
'int'
>>> p = functools.partial(int)
>>> p.__qualname__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'functools.partial' object has no attribute '__qualname__'

--
components: Library (Lib)
messages: 323947
nosy: chris.jerdonek
priority: normal
severity: normal
status: open
title: functools.partial objects have no __qualname__ attribute
type: enhancement
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



[issue34474] Python/bltinmodule.c: Missing NULL check in builtin_sum_impl()

2018-08-23 Thread Berker Peksag


Berker Peksag  added the comment:

Personally I wouldn't bother fixing 2.7, but let's see what other core devs 
think.

--

___
Python tracker 

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



[issue34476] asyncio.sleep(0) not documented

2018-08-23 Thread Hrvoje Nikšić

New submission from Hrvoje Nikšić :

Looking at the implementation and at the old issue at 
https://github.com/python/asyncio/issues/284 shows that asyncio.sleep 
special-cases asyncio.sleep(0) to mean "yield control to the event loop" 
without incurring additional overhead of sleeping. However, this is not 
documented at https://docs.python.org/3/library/asyncio-task.html#asyncio.sleep 
.

I propose to add to the documentation a statement along the lines of:

"""
A delay of 0 will relinquish control to the event loop, allowing other tasks 
and callbacks to run. The control will be returned to the coroutine as soon as 
they have run, without an explicit delay.
"""

--
assignee: docs@python
components: Documentation, asyncio
messages: 323949
nosy: asvetlov, docs@python, hniksic, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.sleep(0) not documented
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



[issue34476] asyncio.sleep(0) not documented

2018-08-23 Thread Hrvoje Nikšić

Hrvoje Nikšić  added the comment:

Also, the "Create a coroutine ..." wording in the current documentation is a 
bit strange - sleep() is already marked as a coroutine, and documentation of 
other coroutines simply state their effect in imperative.

--

___
Python tracker 

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



[issue34477] Objects/typeobject.c: Missing NULL check in type_init()

2018-08-23 Thread Alexey Izbyshev


New submission from Alexey Izbyshev :

The return value of PyTuple_GetSlice() at 
https://github.com/python/cpython/blob/48ce4897f8f8d91d948ecd1241ffab002df2be9e/Objects/typeobject.c#L2297
 is not checked for NULL and then dereferenced.

Reported by Svace static analyzer.

Currently, PyTuple_GetSlice() for a zero-length slice can fail only if it's the 
first zero-length tuple ever created. If there is an invariant that at least 
one zero-length tuple exists on any type_init() call, the check may be replaced 
with an assert.

--
components: Interpreter Core
messages: 323951
nosy: berker.peksag, izbyshev, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Objects/typeobject.c: Missing NULL check in type_init()
type: behavior
versions: Python 2.7, 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



[issue34477] Objects/typeobject.c: Missing NULL check in type_init()

2018-08-23 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


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

___
Python tracker 

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



[issue34448] incomplete/missing message from configure.ac for usable wchar_t

2018-08-23 Thread Berker Peksag


Berker Peksag  added the comment:

The message is a bit more descriptive if wchar_t isn't usable:

> checking whether wchar_t is signed... yes
> no usable wchar_t found

I'm not sure if it's worth to backport to 3.6, but it's a nice improvement for 
3.7 and master branches. Also, it simplifies the checking for wchar_t a bit, 
which is good.

--
nosy: +berker.peksag
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



[issue11192] test_socket error on AIX

2018-08-23 Thread Michael Felt


Michael Felt  added the comment:

I nearly have a patch - to resolve all the remaining test_socket() issues with 
AIX. However, this (new?) issue remains:

f = lambda a: inet_pton(AF_INET6, a)
assertInvalid = lambda a: self.assertRaises(
(OSError, ValueError), f, a
)

>>> f('1:2:3:4:5:6:7:8')
b'\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08'
>>> f('1:2:3:4:5:6:7:8:')
b'\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08'
>>> f('1::')
b'\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
>>> f('1:2:3:4:5:6:7:8::')
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1, in 
OSError: illegal IP address string passed to inet_pton

>>> f('1:2:3:4:5:6:7')
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1, in 
OSError: illegal IP address string passed to inet_pton


Is, maybe, the last test meant to be '::' on the end, rather than ':'?

--

___
Python tracker 

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



[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8352

___
Python tracker 

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



[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-23 Thread Tal Einat


Tal Einat  added the comment:


New changeset 096329f0b2bf5e3f0a16363aa631d993ce078737 by Tal Einat (Paul 
Ganssle) in branch 'master':
bpo-34454: fix .fromisoformat() methods crashing on inputs with surrogate code 
points (GH-8862)
https://github.com/python/cpython/commit/096329f0b2bf5e3f0a16363aa631d993ce078737


--
nosy: +taleinat

___
Python tracker 

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



[issue34478] Possibly misleading/wrong documentation about PyModuleDef.m_free

2018-08-23 Thread Segev Finer


New submission from Segev Finer :

This section in the documentation 
https://docs.python.org/3.7/howto/cporting.html#module-initialization-and-state 
shows how to implement an extension module that works for both Python 2 and 3. 
It also shows how to use m_size to manage module state instead of using static 
globals. But it omits implementing m_free. This is also done in 
https://www.python.org/dev/peps/pep-3121/#example

To my understanding, m_clear is *only* called by the Python GC when the object 
is a part of a reference cycle. It won't be called for a normal free when the 
object wasn't a part of a reference cycle. This means that for such a case the 
objects referenced in the state structure will leak!

Looking around the standard library, it seems the extension modules there point 
m_free to calling the function used to implement m_clear.

The documentation of the structure is also quite unclear on the subject 
https://docs.python.org/3/c-api/module.html?highlight=pymoduledef#c.PyModuleDef.

P.S. There is also no freeing/DECREF-ing stuff in the state on error in the 
Python 2 case, but I think even the standard library is like this.

--
assignee: docs@python
components: Documentation
messages: 323955
nosy: Segev Finer, docs@python
priority: normal
severity: normal
status: open
title: Possibly misleading/wrong documentation about PyModuleDef.m_free
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



[issue34479] ArgumentParser subparser error display at the wrong level

2018-08-23 Thread Siming Yuan


New submission from Siming Yuan :

If you take the example from
https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_subparsers

# create the top-level parser
parser = argparse.ArgumentParser(prog='PROG')
parser.add_argument('--foo', action='store_true', help='foo help')
subparsers = parser.add_subparsers(help='sub-command help')
# create the parser for the "a" command
parser_a = subparsers.add_parser('a', help='a help')
parser_a.add_argument('-bar', type=int, help='bar help')
# create the parser for the "b" command
parser_b = subparsers.add_parser('b', help='b help')
parser_b.add_argument('--baz', choices='XYZ', help='baz help')


and run a subcommand but with an argument the subcommand doesn't understand

parser.parse_args(['a', '-x'])

the output doesn't help much - because the usage is coming from the main parser

usage: PROG [-h] [--foo] {a,b} ...
PROG: error: unrecognized arguments: -x


the reason for failure is because the error api being called in this case is
parser.error(msg)

not the subparser
parser_a.error(msg)

the proper error should've been

usage: PROG a [-h] [-bar BAR]
PROG a: error: unrecognized arguments: -x

--
components: Library (Lib)
messages: 323956
nosy: siming85
priority: normal
severity: normal
status: open
title: ArgumentParser subparser error display at the wrong level
type: behavior
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



[issue34473] pip is unusable on Windows 10 1803 - SHA-1 certificates are untrusted

2018-08-23 Thread Steve Dower


Steve Dower  added the comment:

Can you be more precise about which versions are affected and any other system 
configuration you have (firewalls, network security software, enterprise 
configs, etc.)?

I have been using pip quite happily on 1803, so it's certainly not widespread 
enough to justify this vague a report.

--

___
Python tracker 

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



[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-23 Thread miss-islington


miss-islington  added the comment:


New changeset 89b1654e0bc7bc69709dca86dd4c92eb7122ac7e by Miss Islington (bot) 
in branch '3.7':
bpo-34454: fix .fromisoformat() methods crashing on inputs with surrogate code 
points (GH-8862)
https://github.com/python/cpython/commit/89b1654e0bc7bc69709dca86dd4c92eb7122ac7e


--
nosy: +miss-islington

___
Python tracker 

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



[issue34423] Overflow when casting from double to time_t, and_PyTime_t.

2018-08-23 Thread Michał Radwański

Michał Radwański  added the comment:

Although you're right - this issue is specific to pytime.c, when 
_Py_InIntegralTypeRange() is used with a double, it is actually true that 
_Py_InIntegralTypeRange() is used with double, in pytime.c only (as a quick 
recursive grep discovers).

Perhaps the macro should be renamed not to cause confusion (include note about 
floating point, or define it as a function).

I don't have good idea on how this issue could be resolved otherwise.

--

___
Python tracker 

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



[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-23 Thread Tal Einat


Tal Einat  added the comment:

Thanks for the report and initial patch, Alexey!

Thanks for the followup and final PR, Paul!

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



[issue34347] AIX: test_utf8_mode.test_cmd_line fails

2018-08-23 Thread Michael Felt


Michael Felt  added the comment:

On 23/08/2018 12:51, STINNER Victor wrote:
> STINNER Victor  added the comment:
>
> Your issue is about decoding command line argument which is done from main() 
> function. It doesn't use Python codecs, but functions like Py_DecodeLocale().
This is beyond my understanding atm.
Early on I tried making the expected just be 'arg' and went from
situation A to situation B - which looked much closer, BUT, the 'types'
differed:

Situaltion A (original)
AssertionError: "['h\\xc3\\xa9\\xe2\\x82\\xac']" != 
"['h\\udcc3\\udca9\\udce2\\udc82\\udcac']"
- ['h\xc3\xa9\xe2\x82\xac']
+ ['h\udcc3\udca9\udce2\udc82\udcac']
 : ISO8859-1:['h\xc3\xa9\xe2\x82\xac']

I tried saying the "expected" is arg, but arg is still a byte object, the 
cmd_line result is not (printed as such).

Situation B
AssertionError: "['h\\xc3\\xa9\\xe2\\x82\\xac']" != 
"[b'h\\xc3\\xa9\\xe2\\x82\\xac']"
- ['h\xc3\xa9\xe2\x82\xac']
+ [b'h\xc3\xa9\xe2\x82\xac']
?  +
 : ISO8859-1:['h\xc3\xa9\xe2\x82\xac']

After further digging - to understand why it was coming as "\x encoding rather 
than \udc"

I looked at what was happening here:

out = self.get_output('-X', utf8_opt, '-c', code, arg, **kw)
becomes
out = self.get_output('-X', utf8_opt, '-c', code, 
'h\xe9\u20ac'.encode('utf-8'), **kw)
becomes
out = self.get_output('-X', utf8_opt, '-c', code, b'h\xc3\xa9\xe2\x82\xac', 
**kw)

And finally, at the CLI becomes:
['/data/prj/python/python3-3.8/python', '-X', 'faulthandler', '-X', 'utf8', 
'-c', 'import locale, sys; print("%s:%s" % (locale.getpreferredencoding(), 
ascii(sys.argv[1:])))', b'h\xc3\xa9\xe2\x82\xac']

/data/prj/python/python3-3.8/python '-X' 'faulthandler' '-X' 'utf8' '-c' 
'import locale, sys; print("%s:%s" % (locale.getpreferredencoding(), 
ascii(sys.ar
gv[1:])))', b'h\xc3\xa9\xe2\x82\xac'
UTF-8:['bh\\xc3\\xa9\\xe2\\x82\\xac']

/data/prj/python/python3-3.8/python '-X' 'faulthandler' '-X' 'utf8=0' '-c' 
'import locale, sys; print("%s:%s" % (locale.getpreferredencoding(), ascii(sys.
argv[1:])))', b'h\xc3\xa9\xe2\x82\xac'
ISO8859-1:['bh\\xc3\\xa9\\xe2\\x82\\xac']

Note:
/data/prj/python/python3-3.8/python '-X' 'faulthandler' '-X' 'utf8=0' '-c' 
'import locale, sys; print("%s:%s" % (locale.getpreferredencoding(), ascii(sys.
argv[1:])))', 'h\udcc3\udca9\udce2\udc82\udcac'
ISO8859-1:['h\\udcc3\\udca9\\udce2\\udc82\\udcac']

/data/prj/python/python3-3.8/python '-X' 'faulthandler' '-X' 'utf8=0' '-c' 
'import locale, sys; print("%s:%s" % (locale.getpreferredencoding(), ascii(sys.
argv[1:])))', b'h\udcc3\udca9\udce2\udc82\udcac'
ISO8859-1:['bh\\udcc3\\udca9\\udce2\\udc82\\udcac']

root@x066:[/data/prj/python/python3-3.8]/data/prj/python/python3-3.8/python 
'-X' 'faulthandler' '-X' 'utf8' '-c' 'import locale, sys; print("%s:%s" % (>
UTF-8:['bh\\udcc3\\udca9\\udce2\\udc82\\udcac']

Summary:
a) concerned about how b'h' becomes 'bh'
b) whatwever argv[1] is, is very close to what is returned - so whatever 
happens durinf the transformation from 
self.get_output('-X', utf8_opt, '-c', code, arg, **kw)
 determines the output and the (failed) comparison.

>> Question 1: why is windows excluded? Because it does not use UTF-8 as it's 
>> default (it's default is CP1252)
> Windows uses wmain() which gets command line arguments as wchar_t* strings: 
> Unicode. No decoding is needed.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue34482] datetime: Tests for potential crashes due to non-UTF-8-encodable strings

2018-08-23 Thread Alexey Izbyshev


New submission from Alexey Izbyshev :

This is a follow-up of #34454. 'datetime' extension module attempts to encode 
input strings into UTF-8 in several places, which requires special care because 
some valid Python strings can't be represented in UTF-8. It makes sense to add 
more tests for methods dealing with strings.

Note that my PR doesn't attempt to deal with #34481. In cases where behavior 
differs between C and Python datetime impls the tests check only for  absence 
of crashes.

--
components: Extension Modules
messages: 323964
nosy: belopolsky, izbyshev, p-ganssle, serhiy.storchaka, taleinat
priority: normal
severity: normal
status: open
title: datetime: Tests for potential crashes due to non-UTF-8-encodable strings
type: security
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



[issue34481] Different behavior of C and Python impls of datetime.strftime with non-UTF-8-encodable strings

2018-08-23 Thread Alexey Izbyshev


New submission from Alexey Izbyshev :

The C datetime implementation uses PyUnicode_AsUTF8AndSize() in wrap_strftime() 
and rejects strings containing surrogate code points (0xD800 - 0xDFFF) since 
they can't be encoded in UTF-8. On the other hand, the pure-Python datetime 
implementation doesn't have this restriction:

>>> import sys
>>> sys.modules['_datetime'] = None # block C implementation
>>> from datetime import time
>>> time().strftime('\ud800')
'\ud800'
>>> del sys.modules['datetime']
>>> del sys.modules['_datetime']
>>> from datetime import time
>>> time().strftime('\ud800')
Traceback (most recent call last):
  File "", line 1, in 
UnicodeEncodeError: 'utf-8' codec can't encode character '\ud800' in position 
0: surrogates not allowed

--
components: Extension Modules
messages: 323963
nosy: belopolsky, izbyshev, pitrou, serhiy.storchaka, taleinat
priority: normal
severity: normal
status: open
title: Different behavior of C and Python impls of datetime.strftime with 
non-UTF-8-encodable strings
type: behavior
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



[issue34483] eval() raises NameError: name '...' is not defined

2018-08-23 Thread Alex


New submission from Alex :

Builtin eval() function raises NameError on a valid expression:


--- example of bug on Python 3.4
Python 3.4.5 (default, May 29 2017, 15:17:55)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> x = [1,2,3]
>>> [x for i in x]
[[1, 2, 3], [1, 2, 3], [1, 2, 3]]
>>> eval('[x for i in x]', {}, dict(x=x))
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1, in 
  File "", line 1, in 
NameError: name 'x' is not defined


--- example on Python 2.7 (no bug)
Python 2.7.5 (default, May  3 2017, 07:55:04)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-14)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x = [1,2,3]
>>> [x for i in x]
[[1, 2, 3], [1, 2, 3], [1, 2, 3]]
>>> eval('[x for i in x]', {}, dict(x=x))
[[1, 2, 3], [1, 2, 3], [1, 2, 3]]


---

Bug reproduced on:
- Windows 7: Python 3.4, 3.7
- Red Hat Enterprise Linux Server: Python 3.4

Works without errors on:
- Windows 7: Python 2.7
- Red Hat Enterprise Linux Server: Python 2.7

--
components: Interpreter Core
messages: 323965
nosy: alexb
priority: normal
severity: normal
status: open
title: eval() raises NameError: name '...' is not defined
versions: Python 3.4, Python 3.7

___
Python tracker 

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



[issue34482] datetime: Tests for potential crashes due to non-UTF-8-encodable strings

2018-08-23 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


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

___
Python tracker 

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



[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-23 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


--
pull_requests: +8354

___
Python tracker 

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



[issue34482] datetime: Tests for potential crashes due to non-UTF-8-encodable strings

2018-08-23 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


--
pull_requests: +8355

___
Python tracker 

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



[issue34480] _markupbase.py fails with UnboundLocalError on invalid keyword in marked section

2018-08-23 Thread Berker Peksag


Change by Berker Peksag :


--
Removed message: https://bugs.python.org/msg323967

___
Python tracker 

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



[issue34480] _markupbase.py fails with UnboundLocalError on invalid keyword in marked section

2018-08-23 Thread Berker Peksag


Change by Berker Peksag :


--
status:  -> open

___
Python tracker 

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



[issue31844] HTMLParser: undocumented not implemented method

2018-08-23 Thread Berker Peksag


Berker Peksag  added the comment:

After triaging issue 34480, I realized that we can't simply remove the error() 
method because the _markupbase.ParserBase() class still uses it. I've just 
closed PR 8562.

--

___
Python tracker 

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



[issue31844] HTMLParser: undocumented not implemented method

2018-08-23 Thread Berker Peksag


Change by Berker Peksag :


--
stage: patch review -> test needed

___
Python tracker 

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



[issue34473] pip is unusable on Windows 10 1803 - SHA-1 certificates are untrusted

2018-08-23 Thread Matt Tuttle


Matt Tuttle  added the comment:

It was a firewall issue that affected pip and conda in the same way.

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



[issue34473] pip is unusable on Windows 10 1803 - SHA-1 certificates are untrusted

2018-08-23 Thread Matt Tuttle

Matt Tuttle  added the comment:

Thanks Steve, you were right it is a firewall issue that impacted both pip and 
conda simultaneously. ☹

--

___
Python tracker 

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



[issue32876] HTMLParser raises exception on some inputs

2018-08-23 Thread Berker Peksag


Berker Peksag  added the comment:

Issue 34480 is another relevant issue. The HTMLParse method doesn't have an 
error() method and it doesn't raise any exceptions, but its base class still 
does. I think there is a compatibility problem between html.parser.HTMLParser() 
and _markupbase.ParserBase() classes. See https://bugs.python.org/msg323966 for 
more details about this.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue34423] Overflow when casting from double to time_t, and_PyTime_t.

2018-08-23 Thread Paul Ganssle


Change by Paul Ganssle :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue34481] Different behavior of C and Python impls of datetime.strftime with non-UTF-8-encodable strings

2018-08-23 Thread Paul Ganssle


Change by Paul Ganssle :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue34473] pip is unusable on Windows 10 1803 - SHA-1 certificates are untrusted

2018-08-23 Thread Matt Tuttle


Matt Tuttle  added the comment:

Yep. You are right it is a firewall issue.

--

___
Python tracker 

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



[issue34468] An always-false condition in range_repr() from Objects/rangeobject.c

2018-08-23 Thread Brett Cannon


Brett Cannon  added the comment:

I think your second proposal sounds about right, Alexey.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue33187] Document ElementInclude (XInclude) support in ElementTree

2018-08-23 Thread Stefan Behnel


Change by Stefan Behnel :


--
versions: +Python 3.4, Python 3.5, 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



[issue27195] Crash when RawIOBase.write(b) evaluates b.format

2018-08-23 Thread Zackery Spytz


Zackery Spytz  added the comment:

Ping.

--

___
Python tracker 

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



[issue26901] Argument Clinic test is broken

2018-08-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8356

___
Python tracker 

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



[issue30717] Add unicode grapheme cluster break algorithm

2018-08-23 Thread Paul Ganssle


Change by Paul Ganssle :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue27195] Crash when RawIOBase.write(b) evaluates b.format

2018-08-23 Thread Stefan Krah


Stefan Krah  added the comment:

PyBUF_RECORDS pulls in PyBUF_STRIDES, which should IMO not be done in a stable 
release.

Maybe (PyBUF_CONTIG_RO|PyBUF_FORMAT), but I'm uneasy even about that. The 
potential for breakage is huge.

--

___
Python tracker 

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



[issue34484] Unicode HOWTO incorrectly refers to Private Use Area for surrogateescape

2018-08-23 Thread Mark Dickinson


New submission from Mark Dickinson :

The Unicode HOWTO currently has contains this text in the "Files in an Unknown 
Encoding" section [1]:

> The surrogateescape error handler will decode any non-ASCII bytes as code
> points in the Unicode Private Use Area ranging from U+DC80 to U+DCFF. These
> private code points will then be turned back into the same bytes when the
> surrogateescape error handler is used when encoding the data and writing it
> back out.

Unless I'm missing something, the subrange U+DC80 to U+DCFF of the low 
surrogates is *not* a Private Use Area. There *is* a kinda-sorta PUA in the 
high surrogates from U+DB80 to U+DBFF (because the only valid codepoints that 
use these surrogates in their UTF-16 encoding are the codepoints in planes 15 
and 16, which are almost entirely PUA codepoints), but that's not what the 
surrogateescape handler is using.


[1] https://docs.python.org/3/howto/unicode.html#files-in-an-unknown-encoding

--
assignee: docs@python
components: Documentation
messages: 323976
nosy: docs@python, mark.dickinson
priority: normal
severity: normal
status: open
title: Unicode HOWTO incorrectly refers to Private Use Area for surrogateescape
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue34484] Unicode HOWTO incorrectly refers to Private Use Area for surrogateescape

2018-08-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

For history, this text was introduced as a result of issue #4163.

--

___
Python tracker 

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



[issue34484] Unicode HOWTO incorrectly refers to Private Use Area for surrogateescape

2018-08-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

Whoops. Sorry, that should be #4153.

--

___
Python tracker 

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



[issue34468] An always-false condition in range_repr() from Objects/rangeobject.c

2018-08-23 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


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

___
Python tracker 

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



[issue34468] An always-false condition in range_repr() from Objects/rangeobject.c

2018-08-23 Thread Alexey Izbyshev


Alexey Izbyshev  added the comment:

Thank you, Brett, I've submitted a PR.

--

___
Python tracker 

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



[issue34485] _PyCoreConfig: add stdio_encoding and stdio_errors

2018-08-23 Thread STINNER Victor


New submission from STINNER Victor :

Currently, the code to select the encoding and error handler of sys.stdin, 
sys.stdout and sys.stderr is run later in Py_Initialize(). I propose to move 
most of this code into _PyCoreConfig_Read() and add stdio_encoding and 
stdio_errors to _PyCoreConfig to easily let Python embedders to select the 
encoding.

Attached PR implements this idea. During Py_Initialize(), the code still reads 
the LC_CTYPE locale to choose the error handler if stdio_errors is NULL. This 
check cannot be done earlier, since the LC_CTYPE locale is only set to the user 
locale in Py_Initialize(): after _PyCoreConfig_Read().

The Py_SetStandardStreamEncoding() function has been added by Nick Coghlan in 
bpo-16129.

This new pre-initialization API allows embedding
applications like Blender to force a particular
encoding and error handler for the standard IO streams.

--
messages: 323980
nosy: vstinner
priority: normal
severity: normal
status: open
title: _PyCoreConfig: add stdio_encoding and stdio_errors
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



[issue34485] _PyCoreConfig: add stdio_encoding and stdio_errors

2018-08-23 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue28206] signal.Signals not documented

2018-08-23 Thread Berker Peksag


Change by Berker Peksag :


--
nosy: +berker.peksag
type:  -> enhancement
versions: +Python 3.7, Python 3.8 -Python 3.5

___
Python tracker 

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



[issue28069] signalmodule.c does "is" comparisons for SIG_IGN and SIG_DFL

2018-08-23 Thread Berker Peksag


Change by Berker Peksag :


--
components: +Library (Lib)
nosy: +berker.peksag

___
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

2018-08-23 Thread Julian Mehnle


Change by Julian Mehnle :


--
nosy: +jmehnle

___
Python tracker 

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



[issue34483] eval() raises NameError: name '...' is not defined

2018-08-23 Thread Eric V. Smith


Eric V. Smith  added the comment:

I believe you're seeing this: 
https://docs.python.org/3/reference/executionmodel.html#naming-and-binding

See the paragraph that starts with "Class definition blocks and arguments to 
exec() and eval() are special in the context of name resolution", and the 
example that follows it.

Basically, you're running eval() as if it were at class scope. I think (but am 
not positive) that this statement, from the exec() documentation, also applies 
to eval(): "Remember that at module level, globals and locals are the same 
dictionary. If exec gets two separate objects as globals and locals, the code 
will be executed as if it were embedded in a class definition."

If so, then eval()'s docs should reference this, too.

--
nosy: +eric.smith

___
Python tracker 

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



[issue34483] eval() raises NameError: name '...' is not defined

2018-08-23 Thread Steven D'Aprano


Change by Steven D'Aprano :


--
nosy: +steven.daprano

___
Python tracker 

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



[issue34465] ipaddress should accept bytearray in addition to bytes

2018-08-23 Thread Prudvi RajKumar Maddala


Prudvi RajKumar Maddala  added the comment:

I think it should be supported too. How about a list of bytes? eg : 
[127,0,0,1].. Should that be supported as well?

--
nosy: +prudvinit

___
Python tracker 

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



[issue34477] Objects/typeobject.c: Missing NULL check in type_init()

2018-08-23 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset f6247aac08c1a79d0479145a405718bb76dba434 by Benjamin Peterson 
(Alexey Izbyshev) in branch 'master':
closes bpo-34477: Objects/typeobject.c: Add missing NULL check to type_init() 
(GH-8876)
https://github.com/python/cpython/commit/f6247aac08c1a79d0479145a405718bb76dba434


--
nosy: +benjamin.peterson
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



[issue34477] Objects/typeobject.c: Missing NULL check in type_init()

2018-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8359

___
Python tracker 

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



[issue34477] Objects/typeobject.c: Missing NULL check in type_init()

2018-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8361

___
Python tracker 

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



[issue34477] Objects/typeobject.c: Missing NULL check in type_init()

2018-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8360

___
Python tracker 

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



[issue34474] Python/bltinmodule.c: Missing NULL check in builtin_sum_impl()

2018-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8362

___
Python tracker 

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



[issue34474] Python/bltinmodule.c: Missing NULL check in builtin_sum_impl()

2018-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8364

___
Python tracker 

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



[issue34474] Python/bltinmodule.c: Missing NULL check in builtin_sum_impl()

2018-08-23 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 2b824b2538c4a5f9f520c5de8a1eae5a0c181a94 by Benjamin Peterson 
(Alexey Izbyshev) in branch 'master':
closes bpo-34474: Python/bltinmodule.c: Add missing NULL check in 
builtin_sum_impl() (GH-8872)
https://github.com/python/cpython/commit/2b824b2538c4a5f9f520c5de8a1eae5a0c181a94


--
nosy: +benjamin.peterson
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



[issue34474] Python/bltinmodule.c: Missing NULL check in builtin_sum_impl()

2018-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8363

___
Python tracker 

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



[issue18560] builtin_sum() doesn't check return value of PyLong_FromLong()

2018-08-23 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
pull_requests: +8365

___
Python tracker 

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



[issue34477] Objects/typeobject.c: Missing NULL check in type_init()

2018-08-23 Thread miss-islington


miss-islington  added the comment:


New changeset 609062a23f018f4ffc180a88435d61f871165518 by Miss Islington (bot) 
in branch '3.7':
closes bpo-34477: Objects/typeobject.c: Add missing NULL check to type_init() 
(GH-8876)
https://github.com/python/cpython/commit/609062a23f018f4ffc180a88435d61f871165518


--
nosy: +miss-islington

___
Python tracker 

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



  1   2   >