[issue2651] Strings passed to KeyError do not round trip

2017-10-23 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

A new Stackoverflow question gives a better illustration of how special-casing 
KeyError can be a nuisance.
https://stackoverflow.com/questions/46892261/new-line-on-error-message-in-idle-python-3-3/46899120#46899120
>From a current repository build instead of 3.3:

>>> s = 'line\nbreak'
>>> raise Exception(s)
Traceback (most recent call last):
  File "", line 1, in 
Exception: line
break
>>> raise KeyError(s)
Traceback (most recent call last):
  File "", line 1, in 
KeyError: 'line\nbreak'
>

The OP wanted to get the line break to break without fudging the code to catch 
Exception rather than KeyError.  I proposed catching KeyError and then 
'print(err.args[0]' instead of 'print(err)'.

Why this makes a difference, and why KeyError is unique in needing this, is 
obvious after I found this issue and read the code comment quoted by Amaury.  
But it sure wasn't before.

The rational for applying repr only applies when there is exactly one arg of 
value ''.  So I think the fix should be to only apply it when args *is* ('',).  
There is no reason to quote a non-blank message -- and suppress any formatting 
a user supplies.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-23 Thread Guido van Rossum

Guido van Rossum  added the comment:

Am I needed here?

--
nosy:  -Jeremy.Hylton

___
Python tracker 

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



[issue31856] Unexpected behavior of re module when VERBOSE flag is set

2017-10-23 Thread Bob Kline

New submission from Bob Kline :

According to the documentation of the re module, "When this flag [re.VERBOSE] 
has been specified, whitespace within the RE string is ignored, except when the 
whitespace is in a character class or preceded by an unescaped backslash; this 
lets you organize and indent the RE more clearly. This flag also lets you put 
comments within a RE that will be ignored by the engine; comments are marked by 
a '#' that’s neither in a character class [n]or preceded by an unescaped 
backslash." (I'm quoting from the 3.6.3 documentation, but I've tested with 
several versions of Python, as indicated in the issue's `Versions` field, all 
with the same results.)

Given this description, I would have expected the output for each of the pairs 
of calls to findall() in the attached repro code to be the same, but that is 
not what's happening. In the case of the first pair of calls, for example, the 
non-verbose version finds two more matches than the verbose version, even 
though the regular expression is identical for the two calls, ignoring 
whitespace and comments in the expression string. Similar problems appear with 
the other two pairs of calls.

Here's the output from the attached code:

['&', '(', '/Term/SemanticType/@cdr:ref', '==']
['/Term/SemanticType/@cdr:ref', '==']
[' XXX ']
[]
[' XXX ']
[]

It would seem that at least one of the following is true:

 1. the module is not behaving as it should
 2. the documentation is wrong
 3. I have not understood the documentation correctly

I'm happy for it to be #3, as long as someone can explain what I have not 
understood.

--
components: Library (Lib), Regular Expressions
files: regex-repro.py
messages: 304849
nosy: bkline, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: Unexpected behavior of re module when VERBOSE flag is set
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6
Added file: https://bugs.python.org/file47232/regex-repro.py

___
Python tracker 

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



[issue31856] Unexpected behavior of re module when VERBOSE flag is set

2017-10-23 Thread Matthew Barnett

Matthew Barnett  added the comment:

Your verbose examples put the pattern into raw triple-quoted strings, which is 
OK, but their first character is a backslash, which makes the next character (a 
newline) an escaped literal whitespace character. Escaped whitespace is 
significant in a verbose pattern.

--
resolution:  -> not a bug
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



[issue31856] Unexpected behavior of re module when VERBOSE flag is set

2017-10-23 Thread Bob Kline

Bob Kline  added the comment:

I had been under the impression that "escaped" in this context meant that an 
escape character (the backslash) was part of the string value for the regular 
expression (there's a little bit of overloading going on with that word). 
Thanks for setting me straight.

--

___
Python tracker 

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



[issue31857] Make the behavior of USE_STACKCHECK deterministic

2017-10-23 Thread pdox

New submission from pdox :

USE_STACKCHECK is a Windows-only feature which provides additional safety 
against C stack overflow by periodically calling PyOS_CheckStack to determine 
whether the current thread is too close to the end of the stack.

The way USE_STACKCHECK ensures that PyOS_CheckStack is called frequently is 
surprising. It does this by artificially decrementing _Py_CheckRecursionLimit 
with every call to Py_EnterRecursiveCall:

#ifdef USE_STACKCHECK
/* With USE_STACKCHECK, we artificially decrement the recursion limit in 
order
   to trigger regular stack checks in _Py_CheckRecursiveCall(), except if
   the "overflowed" flag is set, in which case we need the true value
   of _Py_CheckRecursionLimit for _Py_MakeEndRecCheck() to function 
properly.
*/
#  define _Py_MakeRecCheck(x)  \
(++(x) > (_Py_CheckRecursionLimit += PyThreadState_GET()->overflowed - 
1))
#else
#  define _Py_MakeRecCheck(x)  (++(x) > _Py_CheckRecursionLimit)
#endif

_Py_CheckRecursionLimit defaults to 1000, and is constant when USE_STACKCHECK 
is off. (except when changed by Py_SetRecursionLimit)

With a single thread, each call to Py_EnterRecursiveCall causes 
_Py_CheckRecursionLimit to decrement by 1 until it equals the current recursion 
depth, at which point _Py_CheckRecursiveCall is triggered, resetting 
_Py_CheckRecursionLimit back to the default. This could be anywhere from 500 to 
1000 calls depending on the recursion depth. With multiple threads, the 
behavior may be more chaotic, as each thread will be decrementing 
_Py_CheckRecursionLimit independently.

I propose that instead, the call to PyOS_CheckStack is triggered in a 
predictable fashion, using a separate counter for each thread, so that it 
occurs every N'th call to Py_EnterRecursiveCall. (N = 64 seems reasonable, as 
PyOS_CheckStack guarantees 2048 * sizeof(void*) bytes remaining on the C stack).

--
components: Windows
messages: 304854
nosy: paul.moore, pdox, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Make the behavior of USE_STACKCHECK deterministic
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue31857] Make the behavior of USE_STACKCHECK deterministic

2017-10-23 Thread pdox

Change by pdox :


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

___
Python tracker 

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



[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-23 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Note that #5288 relaxed the whole number of minutes restriction on UTC offsets. 
 Since the goal is to be able to parse the output of .isoformat(), I think %z 
should accept sub-minute offsets.

--
nosy: +belopolsky

___
Python tracker 

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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-23 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

There's also aligned calloc, which no native APIs support but is still quite 
useful.

--

___
Python tracker 

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



[issue31854] Add mmap.ACCESS_DEFAULT to namespace

2017-10-23 Thread Justus Schwabedal

New submission from Justus Schwabedal :

I propose to add mmap.ACCESS_DEFAULT into the namespace.  Accessing the default 
value might be necessary, if one needs to overwrite an `ACCESS` keyword 
argument.

--
components: Extension Modules
messages: 304839
nosy: Justus Schwabedal
priority: normal
severity: normal
status: open
title: Add mmap.ACCESS_DEFAULT to namespace
type: enhancement
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



[issue31853] Use super().method instead of socket.method in SSLSocket

2017-10-23 Thread Erik Aronesty

New submission from Erik Aronesty :

I asked on #python-dev and was told that it's most likely due to legacy reasons 
that the class has things like `socket.__init__` instead of `super().__init__`

--
assignee: christian.heimes
components: SSL
messages: 304838
nosy: christian.heimes, earonesty
priority: normal
pull_requests: 4063
severity: normal
status: open
title: Use super().method instead of socket.method in SSLSocket
type: enhancement
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



[issue27141] Fix collections.UserList shallow copy

2017-10-23 Thread Roundup Robot

Change by Roundup Robot :


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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-23 Thread Stefan Krah

Stefan Krah  added the comment:

On Mon, Oct 23, 2017 at 09:16:08PM +, Antoine Pitrou wrote:
> > The Arrow memory format for example recommends 64 bit alignment.
> 
> I presume you mean 64 bytes?

Yes, I was typing too fast.

--

___
Python tracker 

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



[issue31653] Don't release the GIL if we can acquire a multiprocessing semaphore immediately

2017-10-23 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 828ca59208af0b1b52a328676c5cc0c5e2e999b0 by Victor Stinner in 
branch 'master':
bpo-31653: Remove deadcode in semlock_acquire() (#4091)
https://github.com/python/cpython/commit/828ca59208af0b1b52a328676c5cc0c5e2e999b0


--
nosy: +haypo

___
Python tracker 

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



[issue27141] Fix collections.UserList shallow copy

2017-10-23 Thread Bar Harel

Bar Harel  added the comment:

Done :-)
Seems like I forgot to edit the news though, I'll try to edit it.

--

___
Python tracker 

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



[issue28253] calendar.prcal(9999) output has a problem

2017-10-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests:  -982

___
Python tracker 

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



[issue31847] Fix commented out tests in test_syntax

2017-10-23 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4066

___
Python tracker 

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



[issue31854] Add mmap.ACCESS_DEFAULT to namespace

2017-10-23 Thread Roundup Robot

Change by Roundup Robot :


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

___
Python tracker 

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



[issue31855] mock_open is not compatible with read(n) (and pickle.load)

2017-10-23 Thread Ron Rothman

New submission from Ron Rothman :

mock.mock_open works as expected when reading the entire file (read()) or when 
reading a single line (readline()), but it seems to not support reading a 
number of bytes (read(n)).

These work as expected:

from mock import mock_open, patch

# works: consume entire "file"
with patch('__main__.open', mock_open(read_data='bibble')) as m:
with open('foo') as h:
result = h.read()

assert result == 'bibble'  # ok

# works: consume one line
with patch('__main__.open', mock_open(read_data='bibble\nbobble')) as m:
with open('foo') as h:
result = h.readline()

assert result == 'bibble\n'  # ok

But trying to read only a few bytes fails--mock_open returns the entire 
read_data instead:

# consume first 3 bytes of the "file"
with patch('__main__.open', mock_open(read_data='bibble')) as m:
with open('foo') as h:
result = h.read(3)

assert result == 'bib', 'result of read: {}'.format(result)  # fails

Output:

Traceback (most recent call last):
  File "/tmp/t.py", line 25, in 
assert result == 'bib', 'result of read: {}'.format(result)
AssertionError: result of read: bibble

The unfortunate effect of this is that mock_open cannot be used with 
pickle.load.

with open('/path/to/file.pkl', 'rb') as f:
x = pickle.load(f)  # this requires f.read(1) to work

--
components: Library (Lib)
messages: 304841
nosy: ron.rothman
priority: normal
severity: normal
status: open
title: mock_open is not compatible with read(n) (and pickle.load)
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

By the way:

> The Arrow memory format for example recommends 64 bit alignment.

I presume you mean 64 bytes?

--

___
Python tracker 

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



[issue31853] Use super().method instead of socket.method in SSLSocket

2017-10-23 Thread Mads Jensen

Change by Mads Jensen :


--
nosy: +madsjensen -earonesty

___
Python tracker 

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



[issue31847] Fix commented out tests in test_syntax

2017-10-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 3b66ebe7727dba68c2c6ccf0cd85a4c31255b9b4 by Serhiy Storchaka in 
branch 'master':
bpo-31847: Fix commented out tests in test_syntax. (#4084)
https://github.com/python/cpython/commit/3b66ebe7727dba68c2c6ccf0cd85a4c31255b9b4


--

___
Python tracker 

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



[issue31855] mock_open is not compatible with read(n) (and pickle.load)

2017-10-23 Thread Ron Rothman

Ron Rothman  added the comment:

Confirmed that the behavior exists in Python 3.6 as well.

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



[issue31828] Support Py_tss_NEEDS_INIT outside of static initialisation

2017-10-23 Thread Masayuki Yamamoto

Change by Masayuki Yamamoto :


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

___
Python tracker 

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



[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-23 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


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

___
Python tracker 

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



[issue31847] Fix commented out tests in test_syntax

2017-10-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset d7604f5d0621c23d037455acd682d0d489455d54 by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
bpo-31847: Fix commented out tests in test_syntax. (GH-4084) (#4095)
https://github.com/python/cpython/commit/d7604f5d0621c23d037455acd682d0d489455d54


--

___
Python tracker 

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



[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-23 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

OK, I made a PR with the fix and a test that checks the line number for syntax 
error (so that the original purpose test_global_err_then_warn is preserved).

--

___
Python tracker 

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



[issue29202] Improve dict iteration

2017-10-23 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

This doesn't meet our criteria for backports.

--
assignee: rhettinger -> serhiy.storchaka
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



[issue31856] Unexpected behavior of re module when VERBOSE flag is set

2017-10-23 Thread Bob Kline

Bob Kline  added the comment:

The light finally comes on. I actually *was* putting a backslash into the 
string value, with the raw flag (which is, of course, what you were trying to 
tell me). Thanks for your patience. :-)

--

___
Python tracker 

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



[issue28143] ASDL compatibility with Python 3 system interpreter

2017-10-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Do you mind to create a pull request on GitHub Malthe?

--
stage:  -> needs patch

___
Python tracker 

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



[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Is it all with this issue?

--
status: open -> pending

___
Python tracker 

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



[issue28509] dict.update allocates too much

2017-10-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests:  -839

___
Python tracker 

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



[issue27141] Fix collections.UserList shallow copy

2017-10-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I prefer issue27141_patch_rev1_opt1.patch. But now we use GitHub. Do you mind 
to create a pull request Bar?

--
stage:  -> needs patch
versions:  -Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue28143] ASDL compatibility with Python 3 system interpreter

2017-10-23 Thread Malthe Borch

Change by Malthe Borch :


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



[issue28506] Multiprocessing Pool starmap - struct.error: 'i' format requires -2e10<=n<=2e10

2017-10-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Closed as a duplicate of issue17560.

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



[issue31845] Envvar PYTHONDONTWRITEBYTECODE is not respected

2017-10-23 Thread Sviatoslav Abakumov

New submission from Sviatoslav Abakumov :

Setting PYTHONDONTWRITEBYTECODE doesn't seem to have an effect in Python 
3.7.0a2:

$ python -V
Python 3.7.0a2
$ env PYTHONDONTWRITEBYTECODE=1 python -c 'import sys; 
print(sys.dont_write_bytecode)'
False

--
components: Interpreter Core
messages: 304794
nosy: Perlence
priority: normal
severity: normal
status: open
title: Envvar PYTHONDONTWRITEBYTECODE is not respected
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



[issue31572] Avoid suppressing all exceptions in PyObject_HasAttr()

2017-10-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

hasattr() can return True, False, or raise an exception. But PyObject_HasAttr() 
just returns an integer: 0 for False, not 0 for True. There is no way to return 
an error, and existing code doesn't expect that PyObject_HasAttr() returns an 
error. Leaking an exception from PyObject_HasAttr() will break existing code.

--

___
Python tracker 

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



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2017-10-23 Thread Lam Yuen Hei

Lam Yuen Hei  added the comment:

As the fix seems simple, any chance this bug can be fixed in next python 3.6 
maintenance release? It is the major roadblock for my application to upgrade to 
python 3.6. Thanks

--

___
Python tracker 

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



[issue28416] defining persistent_id in _pickle.Pickler subclass causes reference cycle

2017-10-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue31817] Compilation Error with Python 3.6.1/3.6.3 with Tkinter

2017-10-23 Thread Josh Cullum

Josh Cullum  added the comment:

Hi Ned,

Please see the make logs for _tkinter below:

building '_tkinter' extension
gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 
-Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result 
-Wno-unused-parameter -Wno-missing-field-initializers -fprofile-generate 
-DWITH_APPINIT=1 -I./Include -I. -I/usr/include/x86_64-linux-gnu 
-I/usr/local/include -I/tools/src/Python-3.6.3/Include 
-I/tools/src/Python-3.6.3 -c /tools/src/Python-3.6.3/Modules/_tkinter.c -o 
build/temp.linux-x86_64-3.6/tools/src/Python-3.6.3/Modules/_tkinter.o 
-I/tools/apps/tcl/8.6.7/include -I/tools/apps/tk/8.6.7/include
gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 
-Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result 
-Wno-unused-parameter -Wno-missing-field-initializers -fprofile-generate 
-DWITH_APPINIT=1 -I./Include -I. -I/usr/include/x86_64-linux-gnu 
-I/usr/local/include -I/tools/src/Python-3.6.3/Include 
-I/tools/src/Python-3.6.3 -c /tools/src/Python-3.6.3/Modules/tkappinit.c -o 
build/temp.linux-x86_64-3.6/tools/src/Python-3.6.3/Modules/tkappinit.o 
-I/tools/apps/tcl/8.6.7/include -I/tools/apps/tk/8.6.7/include
gcc -pthread -shared -fprofile-generate -fprofile-generate 
build/temp.linux-x86_64-3.6/tools/src/Python-3.6.3/Modules/_tkinter.o 
build/temp.linux-x86_64-3.6/tools/src/Python-3.6.3/Modules/tkappinit.o -L. 
-L/usr/lib/x86_64-linux-gnu -L/usr/local/lib -lpython3.6m -o 
build/lib.linux-x86_64-3.6/_tkinter.cpython-36m-x86_64-linux-gnu.so 
-L/tools/apps/tcl/8.6.7/lib -L/tools/apps/tk/8.6.7/lib

--

___
Python tracker 

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



[issue27645] Supporting native backup facility of SQLite

2017-10-23 Thread Cédric Krier

Cédric Krier  added the comment:

I'm using sqlitebck which provides similar functionality but instead of using a 
file name to store the backup it uses connection instances.
I find it very useful. Here is my use case: to run tests of an application that 
requires a database filled, I do a 'copy' of an existing sqlite backup in a 
':memory:' database.
But with the proposed API, it is not possible to use the resulted ':memory:' 
database because it will be delete when the connection is closed.
So I propose to add the option to pass a connection instead of a filename.

--

___
Python tracker 

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



[issue26123] http.client status code constants incompatible with Python 3.4

2017-10-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thank you Sebastian.

--

___
Python tracker 

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



[issue28416] defining persistent_id in _pickle.Pickler subclass causes reference cycle

2017-10-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PR 4080 converts bound methods into unbound methods if possible.

--

___
Python tracker 

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



[issue31572] Avoid suppressing all exceptions in PyObject_HasAttr()

2017-10-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4051

___
Python tracker 

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



[issue31847] Fix commented out tests in test_syntax

2017-10-23 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

Two doctest tests in test_syntax are commented out because SyntaxWarning was 
expected, but doctests couldn't be used for testing them.

But now SyntaxError is raised in these cases instead of SyntaxWarning.

The proposed PR restores and fixes tests.

--
assignee: serhiy.storchaka
components: Tests
messages: 304800
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Fix commented out tests in test_syntax
type: enhancement
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



[issue31847] Fix commented out tests in test_syntax

2017-10-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +4054

___
Python tracker 

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



[issue28028] Convert warnings to SyntaxWarning in parser

2017-10-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Closed because I don't see ways to do this.

--
resolution:  -> wont fix
stage: needs patch -> 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



[issue30695] add a nomemory_allocator to the _testcapi module

2017-10-23 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset aaf6a3dbbdb9754f98d480b468adfcae0f66e3a2 by xdegaye (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-30695: Add set_nomemory(start, stop) to _testcapi (GH-2406) (#4083)
https://github.com/python/cpython/commit/aaf6a3dbbdb9754f98d480b468adfcae0f66e3a2


--

___
Python tracker 

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



[issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect

2017-10-23 Thread Sviatoslav Abakumov

Sviatoslav Abakumov  added the comment:

Looks like PYTHONOPTIMIZE has no effect either:

$ python -V
Python 3.7.0a2
$ env PYTHONOPTIMIZE=1 python -c 'import sys; print(sys.flags.optimize)'
0

--
title: Envvar PYTHONDONTWRITEBYTECODE is not respected -> 
PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect

___
Python tracker 

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



[issue30695] add a nomemory_allocator to the _testcapi module

2017-10-23 Thread Roundup Robot

Change by Roundup Robot :


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

___
Python tracker 

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



[issue31846] Error in 3.6.3 epub docs

2017-10-23 Thread Nathan Henrie

New submission from Nathan Henrie :

I routinely download the epub version of the docs to my computer and mobile 
devices as an offline copy. The 3.6.3 version reports a big error on the first 
(and many other pages):

> This page contains the following errors:
error on line 5176 at column 11: Entity 'copy' not defined
Below is a rendering of the page up to the first error.

Numerous similar errors reporting `Entity 'copy' not defined` scattered 
throughout the epub.

Wonder if this was introduced by the change to `conf.py` that fixed the recent 
problem of the 404s with the HTML docs.

--
messages: 304799
nosy: n8henrie
priority: normal
severity: normal
status: open
title: Error in 3.6.3 epub docs
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



[issue31572] Avoid suppressing all exceptions in PyObject_HasAttr()

2017-10-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 77af0a3bcab666a356eea2927a8031a7578d60d2 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-31572: Get rid of using _PyObject_HasAttrId() in pickle. (GH-3729). 
(#4081)
https://github.com/python/cpython/commit/77af0a3bcab666a356eea2927a8031a7578d60d2


--

___
Python tracker 

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



[issue30695] add a nomemory_allocator to the _testcapi module

2017-10-23 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Test cases in issues #30697 and #30817, back ported to 3.6, need 
_testcapi.set_nomemory().

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



[issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect

2017-10-23 Thread Sviatoslav Abakumov

Sviatoslav Abakumov  added the comment:

It seems 1abcf67[1] is the first bad commit.

[1]https://github.com/python/cpython/commit/1abcf6700b4da6207fe859de40c6c1bada6b4fec

--

___
Python tracker 

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



[issue30695] add a nomemory_allocator to the _testcapi module

2017-10-23 Thread Xavier de Gaye

Change by Xavier de Gaye :


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



[issue30817] Abort in PyErr_PrintEx() when no memory

2017-10-23 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
stage:  -> patch review
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



[issue28564] shutil.rmtree is inefficient due to listdir() instead of scandir()

2017-10-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4055

___
Python tracker 

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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-23 Thread Stefan Krah

Stefan Krah  added the comment:

I need this too. I would like to set this

https://github.com/plures/ndtypes/commit/c260fdbae707da0dfefef499621a0a9f37a3e509#diff-2402fff6223084b74d97237c0d620b29R50

to something line PyMem_AlignedAlloc(), because the Python allocator is faster.


I think many people would welcome this in scientific computing: The Arrow 
memory format for example recommends 64 bit alignment.

--
nosy: +skrah
resolution: rejected -> 
status: closed -> open

___
Python tracker 

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



[issue31848] "aifc" module does not always initialize "Aifc_read._ssnd_chunk"

2017-10-23 Thread Stephen Paul Chappell

New submission from Stephen Paul Chappell :

When Aifc_read runs initfp, it conditionally sets self._ssnd_chunk and is not 
guaranteed to do so. At the bottom of the method, a check is made to see if the 
attribute has a false value; and if so, an error is supposed to be raised. If a 
SSND chunk is never found, checking self._ssnd_chunk causes an attribute error 
to be raised similar to this:

AttributeError: 'Aifc_read' object has no attribute '_ssnd_chunk'

The error was found on the following distribution:

Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:57:36) [MSC v.1900 64 bit 
(AMD64)] on win32

--
components: Library (Lib), Tests
messages: 304804
nosy: Zero
priority: normal
severity: normal
status: open
title: "aifc" module does not always initialize "Aifc_read._ssnd_chunk"
type: crash
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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Do you need aligned allocation even on small objects?  The Python allocator 
doesn't handle allocations > 512 bytes.

--

___
Python tracker 

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



[issue28660] TextWrapper break_long_words=True, break_on_hyphens=True on long words

2017-10-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This is because the current algorithm of breaking on hyphens allows to break 
only between letters. This prevents breaking dates and times. Perhaps it should 
be made more lenient in the case of too long word.

--

___
Python tracker 

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



[issue27142] Default int value with xmlrpclib / xmlrpc.client

2017-10-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-23 Thread Stefan Krah

Stefan Krah  added the comment:

Yes, I think it is partly convenience. I want to set ...

   ndt_mallocfunc = PyMem_Malloc;
   ndt_alignedallocfunc = PyMem_AlignedAlloc;
   ndt_callocfunc = PyMem_Calloc;
   ndt_reallocfunc = PyMem_Realloc;
   ndt_freefunc = PyMem_Free;

... so I can always just call ndt_free(), because there's only one memory
allocator.


But the other part is that datashape allows to specify alignment regardless
of the size of the type.  Example:

>>> from ndtypes import *
>>> from xnd import *
>>> t = ndt("{a: int64, b: uint64, align=16}")
>>> xnd(t, {'a': 111, 'b': 222})



The xnd object essentially wraps a typed data pointer. In the above case, the
'align' keyword has the same purpose as gcc's __attribute__((aligned(16))).


There are several other cases in datashape where alignment can specified
explicitly.


For the convenience case it would already help if PyMem_AlignedAlloc() did
*not* use the fast allocator, but just delegated to _aligned_malloc() (MSVC)
or aligned_alloc() (C11), ...

--

___
Python tracker 

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



[issue31752] Assertion failure in timedelta() in case of bad __divmod__

2017-10-23 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4056

___
Python tracker 

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



[issue31752] Assertion failure in timedelta() in case of bad __divmod__

2017-10-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 4ffd4653a7ec9c97775472276cf5e159e2366bb2 by Serhiy Storchaka in 
branch 'master':
bpo-31752: Fix possible crash in timedelta constructor called with custom 
integers. (#3947)
https://github.com/python/cpython/commit/4ffd4653a7ec9c97775472276cf5e159e2366bb2


--

___
Python tracker 

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



[issue31841] Several methods of collections.UserString do not return instances of UserString or its subclasses

2017-10-23 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I would support changing format() and format_map().

The join() method has been around for a long time, so changing it might do more 
harm than good.

--
assignee:  -> lisroach
nosy: +lisroach, rhettinger
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



[issue31855] mock_open is not compatible with read(n) (and pickle.load)

2017-10-23 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
assignee:  -> michael.foord
nosy: +michael.foord

___
Python tracker 

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



[issue31847] Fix commented out tests in test_syntax

2017-10-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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



[issue27141] Fix collections.UserList shallow copy

2017-10-23 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Either of the patches looks fine.  I lean a bit towards the opt1 patch.

--
assignee: rhettinger -> serhiy.storchaka

___
Python tracker 

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



[issue31858] IDLE: cleanup use of sys.ps1 and never set it.

2017-10-23 Thread Terry J. Reedy

New submission from Terry J. Reedy :

This issue is about cleaning up IDLE's use of sys.ps1 for its prompt (sys.ps2 
is not used).  A. This will make for cleaner code and fix some bugs.  B. This 
will be better for testing.  (Some possible changes to pyshell might make 
sys.ps1 irrelevant, but that is for the future.)

Part1. editor.EditorWindow.__init__ sets sys.ps1 to '>>> ' if not set.
try:
sys.ps1
except AttributeError:
sys.ps1 = '>>> '
IDLE initially respects a user setting of sys.ps1 in a startup file.

pyshell.PyShell.open_debugger hasand .close_debugger has these lines
sys.ps1 = "[DEBUG ON]\n>>> "
sys.ps1 = ">>> "
These overwrite any user setting of sys.ps1.  As long as IDLE pays attention to 
the initial value of sys.ps1, I consider this a bug.

pyshell.PyShell.show_prompt starts with
try:
s = str(sys.ps1)
except:
s = ""
self.console.write(s)

I suspect that this is a holdover from when IDLE executed user code in its own 
process, as it still does with the deprecated '-n' option.  However, if a -n 
user deletes sys.ps1, the replacement should be '>>> ', not '' (bug 2).

In the current default subprocess mode, users cannot change the IDLE process 
sys module (see #13657), so rereading sys.ps1 for every editor window and 
prompt is nonsensical.

Patch 1: replace the EditorWindow.__init__ code with module level code
sys_ps1 = sys.ps1 if hasattr(sys, 'ps1') else '>>> '
prompt = sys_ps1

Fix pyshell to import editor rather than two of its objects.  In its debugger 
methods, set editor.prompt, using editor.sys_ps1, thus preserving any user 
setting.  In print_prompt, print the current editor.prompt.  (This will disable 
users resetting ps1 in deprecated -n mode, but I consider that okay as it 
matches the normal mode.)

Part 2. The reason the prompt is set in EditorWindow, instead of where is it 
obviously needed, the PyShell subclass of the OutputWindow subclass of 
EditorWindow, is that it is currently used in 
EditorWindow.smart_backspace_event and .newline_and_indent_event, while   
pyshell imports editor (and must), and not the other way around.

Treating the prompt text as special in an editor lead to a bug in 
smart_backspace that was fixed in #13039 by guarding it use with 
self.context_use_ps1.  There is still a nearly inconsequential bug in the 
newline method where the prompt use is not guarded.  (Hitting newline with the 
cursor before the 't' in '>>> test' leaves the preceding space instead of 
deleting it.)

Patch 2: Only the last line of the prompt is relevant in either method.  I 
believe that replacing self.context_use_ps1 = False in an editor, = True in 
Shell with self.last_prompt_line = '' in an editor, = whatever it is in Shell, 
will allow moving sys_ps1 and prompt to pyshell.  This would simplify patch 1.

--
assignee: terry.reedy
components: IDLE
messages: 304860
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: cleanup use of sys.ps1 and never set it.
type: behavior
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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-23 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Having the ability to allocated aligned memory could help avoid some undefined 
behavior. See #27987 (though, we only need 16-byte alignment there)

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue31653] Don't release the GIL if we can acquire a multiprocessing semaphore immediately

2017-10-23 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4061

___
Python tracker 

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



[issue30722] Tools/demo/redemo.py broken

2017-10-23 Thread Berker Peksag

Berker Peksag  added the comment:


New changeset a5f9d24c171c7e3a3715161fd16b747c7dcaf76f by Berker Peksag (Miss 
Islington (bot)) in branch '3.6':
bpo-30722: Make redemo work with Python 3.6+ (GH-2311)
https://github.com/python/cpython/commit/a5f9d24c171c7e3a3715161fd16b747c7dcaf76f


--

___
Python tracker 

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



[issue31850] test_nntplib failed with "nntplib.NNTPDataError: line too long"

2017-10-23 Thread STINNER Victor

STINNER Victor  added the comment:

It also failed on Travis CI:

https://mail.python.org/pipermail/python-committers/2017-October/004910.html

Other buildbot failures:

http://buildbot.python.org/all/#builders/80/builds/17
http://buildbot.python.org/all/#/builders/3/builds/48
http://buildbot.python.org/all/#/builders/47/builds/51
http://buildbot.python.org/all/#/builders/99/builds/50
http://buildbot.python.org/all/#/builders/103/builds/50
http://buildbot.python.org/all/#/builders/88/builds/51
http://buildbot.python.org/all/#builders/85/builds/51
http://buildbot.python.org/all/#/builders/53/builds/52
http://buildbot.python.org/all/#/builders/12/builds/49
http://buildbot.python.org/all/#/builders/106/builds/51
http://buildbot.python.org/all/#/builders/13/builds/51
http://buildbot.python.org/all/#/builders/27/builds/50
http://buildbot.python.org/all/#/builders/16/builds/51
http://buildbot.python.org/all/#/builders/87/builds/50
http://buildbot.python.org/all/#/builders/90/builds/28
http://buildbot.python.org/all/#/builders/30/builds/47
http://buildbot.python.org/all/#/builders/32/builds/47

--

___
Python tracker 

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



[issue31822] Document that urllib.parse.{Defrag, Split, Parse}Result are namedtuples

2017-10-23 Thread Éric Araujo

Éric Araujo  added the comment:

I suggest using :term:`named tuple` for the link (+ an example of using 
_replace as Mike said)

--

___
Python tracker 

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



[issue31852] Crashes with lines of the form "async \"

2017-10-23 Thread Alexandre Hamelin

New submission from Alexandre Hamelin :

Hi.

Python 3.6.2 crashes when interpreting lines with the text "async \" (future 
keyword 'async' and ending with a backslash).

Tested in a docker environment (debian jessie). (see 
github.com/0xquad/docker-python36 if needed)

Examples:

$ docker run -ti --rm python36
root@4c09392f83c8:/# python3.6
Python 3.6.2 (default, Aug  4 2017, 14:35:04)
[GCC 6.4.0 20170724] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> async \
...
  File "", line 1
\ufffd\ufffdF\ufffd\ufffd
 ^
SyntaxError: invalid syntax
>>> async \
Segmentation fault
root@4c09392f83c8:/#



Also,

- file: test.py
#/usr/bin/python3.6
async \

-

$ ./test.py
Segmentation fault
$


Haven't taken the time to produce a backtrace or investigate with latest the 
dev versions or any further.

Let me know if I can assist in any way.

--
components: Interpreter Core
messages: 304835
nosy: Alexandre Hamelin
priority: normal
severity: normal
status: open
title: Crashes with lines of the form "async \"
type: crash
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



[issue30722] Tools/demo/redemo.py broken

2017-10-23 Thread Berker Peksag

Berker Peksag  added the comment:

Thank you, Christoph. I wasn't aware of Tools/demo/redemo.py and I must say it 
was fun to play with while reviewing PR 2311.

--
components: +Demos and Tools -Regular Expressions
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



[issue29438] use after free in key sharing dict

2017-10-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests:  -960

___
Python tracker 

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



[issue31851] test_subprocess hangs randomly on x86 Windows7 3.x

2017-10-23 Thread STINNER Victor

New submission from STINNER Victor :

test_subprocess hanged on the build 46 of x86 Windows7 3.x:

http://buildbot.python.org/all/#/builders/58/builds/46

(...)
1:29:55 [405/407] test_cmath passed -- running: test_subprocess (1249 sec)
1:29:58 [406/407] test_pstats passed -- running: test_subprocess (1252 sec)

The buildbot is slow which might have caused a timing issue.

--
components: Tests
keywords: buildbot
messages: 304831
nosy: haypo
priority: normal
severity: normal
status: open
title: test_subprocess hangs randomly on x86 Windows7 3.x
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



[issue31850] test_nntplib failed with "nntplib.NNTPDataError: line too long"

2017-10-23 Thread STINNER Victor

New submission from STINNER Victor :

test_nntplib failed on many buildbots yesterday with the "line too long" error. 
It may be related to bpo-28971.

Example:

http://buildbot.python.org/all/#/builders/12/builds/52

(...)
test_with_statement (test.test_nntplib.NetworkedNNTP_SSLTests) ... ok
test_xhdr (test.test_nntplib.NetworkedNNTP_SSLTests) ... ok
test_xover (test.test_nntplib.NetworkedNNTP_SSLTests) ... ERROR
test_zlogin (test.test_nntplib.NetworkedNNTP_SSLTests) ... ok
test_zzquit (test.test_nntplib.NetworkedNNTP_SSLTests) ... ok
test_module_all_attribute (test.test_nntplib.PublicAPITests) ... ok
test test_nntplib failed
test_we_are_in_reader_mode_after_connect 
(test.test_nntplib.SendReaderNNTPv2Tests) ... ok

==
ERROR: test_xover (test.test_nntplib.NetworkedNNTP_SSLTests)
--
Traceback (most recent call last):
  File "D:\buildarea\3.x.ware-win81-release\build\lib\test\test_nntplib.py", 
line 241, in wrapped
meth(self)
  File "D:\buildarea\3.x.ware-win81-release\build\lib\test\test_nntplib.py", 
line 125, in test_xover
resp, lines = self.server.xover(last - 5, last)
  File "D:\buildarea\3.x.ware-win81-release\build\lib\nntplib.py", line 804, in 
xover
file)
  File "D:\buildarea\3.x.ware-win81-release\build\lib\nntplib.py", line 525, in 
_longcmdstring
resp, list = self._getlongresp(file)
  File "D:\buildarea\3.x.ware-win81-release\build\lib\nntplib.py", line 494, in 
_getlongresp
line = self._getline()
  File "D:\buildarea\3.x.ware-win81-release\build\lib\nntplib.py", line 434, in 
_getline
raise NNTPDataError('line too long')
nntplib.NNTPDataError: line too long

--
components: Tests
keywords: buildbot
messages: 304829
nosy: haypo
priority: normal
severity: normal
status: open
title: test_nntplib failed with "nntplib.NNTPDataError: line too long"
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



[issue25041] document AF_PACKET socket address format

2017-10-23 Thread Cheryl Sabella

Change by Cheryl Sabella :


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



[issue31822] Document that urllib.parse.{Defrag, Split, Parse}Result are namedtuples

2017-10-23 Thread Éric Araujo

Change by Éric Araujo :


--
keywords: +easy
nosy: +eric.araujo
stage:  -> needs patch
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



[issue31822] Document that urllib.parse.{Defrag, Split, Parse}Result are namedtuples

2017-10-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

collections.namedtuples is not a class.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-23 Thread Stefan Krah

Stefan Krah  added the comment:

On Mon, Oct 23, 2017 at 05:16:53PM +, STINNER Victor wrote:
> Memory allocated by PyMem_AlignedAlloc() must be freed with 
> PyMem_AlignedFree().
> 
> We cannot reuse PyMem_Free(). On Windows, PyMem_AlignedAlloc() is implemented 
> with _aligned_malloc() which requires to release the memory with 
> _aligned_free().

Ah, too bad. Of course Windows does something different again. This weakens
my use case somewhat, but I guess it would still be nice to have the functions
(if you think it's maintainable).

--

___
Python tracker 

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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-23 Thread Antoine Pitrou

Change by Antoine Pitrou :


--
versions: +Python 3.7 -Python 3.5

___
Python tracker 

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



[issue30817] Abort in PyErr_PrintEx() when no memory

2017-10-23 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Removing 2.7 as the problem cannot be reproduced here. 
PyEval_CallObjectWithKeywords() does not assert on PyErr_Occurred().

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



[issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect

2017-10-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue23699] Add a macro to ease writing rich comparisons

2017-10-23 Thread Charalampos Stratakis

Charalampos Stratakis  added the comment:

PR has been rebased on top of master and also blurbified.

--

___
Python tracker 

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



[issue31752] Assertion failure in timedelta() in case of bad __divmod__

2017-10-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 5ef883b096895a84123760859f0f34ad37bf2277 by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-31752: Fix possible crash in timedelta constructor called with custom 
integers. (GH-3947) (#4088)
https://github.com/python/cpython/commit/5ef883b096895a84123760859f0f34ad37bf2277


--

___
Python tracker 

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



[issue31752] Assertion failure in timedelta() in case of bad __divmod__

2017-10-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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



[issue30549] ProcessPoolExecutor hangs forever if the object raises on __getstate__

2017-10-23 Thread Berker Peksag

Change by Berker Peksag :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Deadlocks in `concurrent.futures.ProcessPoolExecutor`

___
Python tracker 

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



[issue31826] Misleading __version__ attribute of modules in standard library

2017-10-23 Thread Éric Araujo

Éric Araujo  added the comment:

The version in distutils is derived from sys.version and should be left as is 
too.  Thanks!

--
nosy: +eric.araujo

___
Python tracker 

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



[issue29202] Improve dict iteration

2017-10-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Do you mind to create a pull request Raymond?

--

___
Python tracker 

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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-23 Thread STINNER Victor

Change by STINNER Victor :


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



[issue30722] Tools/demo/redemo.py broken

2017-10-23 Thread Roundup Robot

Change by Roundup Robot :


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

___
Python tracker 

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



[issue30722] Tools/demo/redemo.py broken

2017-10-23 Thread Berker Peksag

Berker Peksag  added the comment:


New changeset 62adc55aff0b78447568f73bd1abc610d2784bf8 by Berker Peksag 
(Christoph Sarnowski) in branch 'master':
bpo-30722: Make redemo work with Python 3.6+ (GH-2311)
https://github.com/python/cpython/commit/62adc55aff0b78447568f73bd1abc610d2784bf8


--
nosy: +berker.peksag

___
Python tracker 

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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-23 Thread STINNER Victor

STINNER Victor  added the comment:

I added _PyTraceMalloc_Track() and _PyTraceMalloc_Untrack() private functions 
to the C API in Python 3.6. These functions were made public in Python 3.7: 
renamed to PyTraceMalloc_Track() and PyTraceMalloc_Untrack(). I made this 
change to allow numpy to trace memory allocations, to debug memory leaks.

numpy cannot use Python memory allocators because numpy requires aligned memory 
blocks which are required to use CPU SIMD instructions.


Stefan Krah:
> I think many people would welcome this in scientific computing: The Arrow 
> memory format for example recommends 64 bit alignment.

Ah, that's an interesting use case.

I created attached PR 4089 to implement PyMem_AlignedAlloc():

   void* PyMem_AlignedAlloc(size_t alignment, size_t size);
   void PyMem_AlignedFree(void *ptr);

Memory allocated by PyMem_AlignedAlloc() must be freed with PyMem_AlignedFree().

We cannot reuse PyMem_Free(). On Windows, PyMem_AlignedAlloc() is implemented 
with _aligned_malloc() which requires to release the memory with 
_aligned_free().


Raymond Hettinger:
>> Adding yet another API to allocate memory has a cost
> Please don't FUD this one to death.

Statistics (size) on my PR:

 Doc/c-api/memory.rst  |  43 +-
 Doc/whatsnew/3.7.rst  |   4 +
 Include/internal/mem.h|   6 +-
 Include/objimpl.h |   2 +
 Include/pymem.h   |  16 +-
 .../2017-10-23-19-03-38.bpo-18835.8XEjtG.rst  |   9 +
 Modules/_testcapimodule.c |  83 ++-
 Modules/_tracemalloc.c| 131 +++-
 Objects/obmalloc.c| 616 +--
 9 files changed, 655 insertions(+), 255 deletions(-)

That's quite a big change "just to add PyMem_AlignedAlloc()" :-)

--

___
Python tracker 

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



[issue26123] http.client status code constants incompatible with Python 3.4

2017-10-23 Thread Sebastian Rittau

Sebastian Rittau  added the comment:

I take the liberty of closing this "wont fix". Changing the behaviour would 
most likely do more harm than good. If one of the maintainers disagrees, please 
reopen. :)

--
resolution:  -> wont fix
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



[issue31826] Misleading __version__ attribute of modules in standard library

2017-10-23 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Please do leave version in the decimal module where it has a precise meaning, 
tracking a particular version of the spec that was implemented and tested.

--

___
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

2017-10-23 Thread Sebastian Rittau

New submission from Sebastian Rittau :

HTMLParser derives from _markupbase.ParserBase, which has the following method:

class HTMLParser:

...

def error(self, message):
raise NotImplementedError(
"subclasses of ParserBase must override error()")

HTMLParser does not implement this method and the documentation for HTMLParser 
(https://docs.python.org/3.6/library/html.parser.html) does not mention that 
its sub-classes need to override it.

I am not sure whether this is a documentation omission, whether HTMLParser 
should provide an (empty?) implementation, or whether ParserBase should not 
raise a NotImplementedError (to make linters happy).

--
messages: 304782
nosy: srittau
priority: normal
severity: normal
status: open
title: HTMLParser: undocumented not implemented method
versions: Python 3.6

___
Python tracker 

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



  1   2   >