[issue33409] Clarify the interaction between locale coercion & UTF-8 mode

2018-06-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7189

___
Python tracker 

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



[issue33375] warnings: get filename from frame.f_code.co_filename

2018-06-09 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +7190

___
Python tracker 

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



[issue33409] Clarify the interaction between locale coercion & UTF-8 mode

2018-06-09 Thread miss-islington


miss-islington  added the comment:


New changeset dd613cf335d7556e20ef3dd01c3abc081b958449 by Miss Islington (bot) 
in branch '3.7':
bpo-33409: Clarify PEP 538/540 relationship (GH-7534)
https://github.com/python/cpython/commit/dd613cf335d7556e20ef3dd01c3abc081b958449


--
nosy: +miss-islington

___
Python tracker 

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



[issue33409] Clarify the interaction between locale coercion & UTF-8 mode

2018-06-09 Thread Nick Coghlan


Change by Nick Coghlan :


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



[issue11874] argparse assertion failure with brackets in metavars

2018-06-09 Thread Nick Coghlan


Change by Nick Coghlan :


--
stage: backport needed -> resolved
status: open -> closed

___
Python tracker 

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



[issue22555] Tracking issue for adjustments to binary/text boundary handling

2018-06-09 Thread Nick Coghlan


Nick Coghlan  added the comment:

With PEPs 538 and 540 merged for Python 3.7 (so we'll almost always use UTF-8 
instead of ASCII when the platform nominates the C or POSIX locale as the 
currently active one), and Windows previously switching to assuming UTF-8 
instead of mbcs for binary interfaces in Python 3.6, I think this tracking 
issue has served its purpose.

Of the issues previously mentioned here, the following are still open:

* Improved Unicode handling in the Windows console: issue 17620
* Utilities for clearing out surrogates from strings: issue 18814
* Treating "wsgistr" as a serialisation format: issue 22264
* Defining a formatting mini-language for hex output: issue 22385

I don't think any of those share enough characteristics to be worth continuing 
to track as a group, so I'm closing this meta-issue as out of date :)

--
dependencies:  -Add utilities to "clean" surrogate code points from strings, 
Add wsgiref.util.dump_wsgistr & load_wsgistr, Define a binary output formatting 
mini-language for *.hex(), Python interactive console doesn't use sys.stdin for 
input
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue22264] Add wsgiref.util.dump_wsgistr & load_wsgistr

2018-06-09 Thread Nick Coghlan


Nick Coghlan  added the comment:

We don't have anyone clamouring for this, and the third party module 
https://ftfy.readthedocs.io/en/latest/ has a lot more utilities for working 
with messy binary inputs and incorrectly decoded text than we'd ever add to the 
standard library, so I'm going to reject this as only being theoretically 
useful, and not actually solving a practical problem for users.

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

___
Python tracker 

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



[issue22555] Tracking issue for adjustments to binary/text boundary handling

2018-06-09 Thread Nick Coghlan


Nick Coghlan  added the comment:

Correction: I just rejected my proposed wsgiref in issue 22264 as failing to 
make a sufficient case for their practical utility, so that one is closed as 
well :)

--

___
Python tracker 

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



[issue22555] Tracking issue for adjustments to binary/text boundary handling

2018-06-09 Thread Nick Coghlan


Nick Coghlan  added the comment:

Adding a link to the first post in a series of articles from Victor Stinner 
regarding the evolution over time of the text encoding assumptions in Python 
3's operating system interfaces:

https://vstinner.github.io/python30-listdir-undecodable-filenames.html

That way if anyone does stumble across this meta-issue, they'll have an easier 
time discovering that more readable version of the history involved :)

--

___
Python tracker 

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



[issue33757] Failed separate test_pdb_next_command_in_generator_for_loop in test_pdb

2018-06-09 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

This is fixed with:

diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
index 4f9d28afd3..7b3624fb99 100644
--- a/Lib/test/test_pdb.py
+++ b/Lib/test/test_pdb.py
@@ -1045,7 +1045,7 @@ def test_pdb_next_command_in_generator_for_loop():
 ... print('value', i)
 ... x = 123
 
->>> with PdbTestInput(['break test_gen',
+>>> with PdbTestInput(['break test_gen', # doctest: +ELLIPSIS
 ...'continue',
 ...'next',
 ...'next',
@@ -1055,7 +1055,7 @@ def test_pdb_next_command_in_generator_for_loop():
 > (3)test_function()
 -> for i in test_gen():
 (Pdb) break test_gen
-Breakpoint 6 at :1
+Breakpoint ... at :1
 (Pdb) continue
 > (2)test_gen()
 -> yield 0

I will submit a PR shortly.

--
nosy: +xdegaye

___
Python tracker 

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



[issue26175] Fully implement IOBase abstract on SpooledTemporaryFile

2018-06-09 Thread Martin Panter

Martin Panter  added the comment:

I was making suggestions, not demanding anything. Except for the quirk with 
__del__, Gary’s changes (revision fb28362) look okay to add on their own as a 
bug fix.

I wouldn’t claim that IOBase is “fully implemented” however, until the return 
values for “seek” and “truncate” are fixed.

The underlying problem is the original SpooledTemporaryFile imitated Python 2’s 
file class/type, and wasn’t completely adapted for Python 3’s file classes.

--

___
Python tracker 

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



[issue33462] reversible dict

2018-06-09 Thread INADA Naoki


INADA Naoki  added the comment:

Would you try python_startup and python_startup_nosite benchmark with:

* master branch
* All reverse iteraters
* All reverse iteraters + register them in _collections_abc module
-- 
INADA Naoki  

--

___
Python tracker 

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



[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2018-06-09 Thread Jesús Cea Avión

Change by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue31711] ssl.SSLSocket.send(b"") fails

2018-06-09 Thread Roundup Robot


Change by Roundup Robot :


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



[issue26698] Tk DPI awareness

2018-06-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Elisha Paine, who prompted #33656 by posting the SetProcessDpiAwareness(1) fix 
to the idledev list, wrote to me that pyglet and probably pygame have similar 
issues.

I wonder if Python should be installed with the 'application' setting, or if 
DPI adjustment should be discussed in the Windows section of the Using manual. 
https://docs.python.org/3/using/windows.html

--

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-09 Thread Eric Fahlgren


Eric Fahlgren  added the comment:

https://msdn.microsoft.com/en-us/library/windows/desktop/mt748620(v=vs.85).aspx 
gives the syntax for adding dpiAwareness to the Windows manifest.

--
nosy: +eric.fahlgren

___
Python tracker 

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



[issue33718] Enhance regrtest: meta-ticket for multiple changes

2018-06-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7192

___
Python tracker 

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



[issue33718] Enhance regrtest: meta-ticket for multiple changes

2018-06-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7193

___
Python tracker 

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



[issue22555] Tracking issue for adjustments to binary/text boundary handling

2018-06-09 Thread STINNER Victor


STINNER Victor  added the comment:

> https://vstinner.github.io/python30-listdir-undecodable-filenames.html

Oh, thanks for mentioning my series of articles.

It's also nice to see that we are now able to close this 4 years old issue!

--

___
Python tracker 

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



[issue33718] Enhance regrtest: meta-ticket for multiple changes

2018-06-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7194

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

As reported on #26698, which was originally opened as an IDLE issue, but which 
I turned into a tkinter issue, one can also sharpen text buy opening 
python(w).exe properties, Compatibility tab, clicking [Change high DPI 
settings], and then checking [] Override high DPI scaling behavior while 
leaving the default 'Application'.  The effect is the same as 
'SetProcessDpiAwareness (1)' -- or (2) if monitor is not changed.

--

___
Python tracker 

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



[issue31007] ERROR: test_pipe_handle (test.test_asyncio.test_windows_utils.PipeTests) expected ERROR_INVALID_HANDLE on x86 Windows7 3.x

2018-06-09 Thread STINNER Victor


STINNER Victor  added the comment:

Test just failed on x86 Windows7 3.6 when test_asyncio was re-run 
(sequentially):

http://buildbot.python.org/all/#/builders/90/builds/387

==
ERROR: test_pipe_handle (test.test_asyncio.test_windows_utils.PipeTests)
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.6.bolen-windows7\build\lib\test\test_asyncio\test_windows_utils.py",
 line 128, in test_pipe_handle
raise RuntimeError('expected ERROR_INVALID_HANDLE')
RuntimeError: expected ERROR_INVALID_HANDLE

--

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Eric, thanks for the additional reference.  From Window's viewpoint, Python, 
not IDLE, is the application.  IDLE is just input data.  I should not touch 
Python's manifest, and changing it would have to consider other possible gui 
module input data.

This page says it applies only to Win10 desktop.  The page for 
SetProcessDpiAwareness says it applies to 8.1+.  That still excludes Vista and 
Win7, but is better than just Win10.

--

___
Python tracker 

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



[issue33757] Failed separate test_pdb_next_command_in_generator_for_loop in test_pdb

2018-06-09 Thread Xavier de Gaye


Change by Xavier de Gaye :


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

___
Python tracker 

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



[issue33718] Enhance regrtest: meta-ticket for multiple changes

2018-06-09 Thread miss-islington


miss-islington  added the comment:


New changeset 463d1890bb29b66aed431734bb76e366301a0fa5 by Miss Islington (bot) 
in branch '3.7':
bpo-33718: regrtest: use "xxx then yyy" result if re-run (GH-7521)
https://github.com/python/cpython/commit/463d1890bb29b66aed431734bb76e366301a0fa5


--
nosy: +miss-islington

___
Python tracker 

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



[issue33718] Enhance regrtest: meta-ticket for multiple changes

2018-06-09 Thread miss-islington


miss-islington  added the comment:


New changeset 07aea160ca2dd8814a28afe73e6a72c2b3cbf38a by Miss Islington (bot) 
in branch '3.6':
bpo-33718: regrtest: use "xxx then yyy" result if re-run (GH-7521)
https://github.com/python/cpython/commit/07aea160ca2dd8814a28afe73e6a72c2b3cbf38a


--

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2018-06-09 Thread STINNER Victor


STINNER Victor  added the comment:

I ran attached race.py on the 3.6 branch:

* 2000 packets of 16 KiB: ok
* 50 packets of 16 MiB: ok

It seems like Python 3.6 (at least the 3.6 development branch) doesn't have 
this bug.

It didn't see the bug recently, so I close the issue.

Python 3.6 has a different issue: pause_reading() cannot be called twice, same 
issue with resume_reading(). But I'm not sure that it can be called a bug. 
Python 3.7 allows to call these methods twice and to call these methods while 
closing: they just do nothing in that case.

I close the issue.

--
priority: release blocker -> 
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



[issue33813] Update overdue 'Deprecated ... removed in 3.x' messages

2018-06-09 Thread Terry J. Reedy


New submission from Terry J. Reedy :

Reported on python-list by Vincent Vande Vivre.
"""
In Python-3.7.0b5 we can find at the end of html/parser.py:
def unescape(self, s):
warnings.warn('The unescape method is deprecated and will be removed '
  'in 3.5, use html.unescape() instead.',
  DeprecationWarning, stacklevel=2)
return unescape(s)
"""
At minimum, /3.5/3.8 or after/  Since we often do not remove when we say we 
will, perhaps 'or after' should be routine.

--
messages: 319156
nosy: ezio.melotti, terry.reedy
priority: normal
severity: normal
status: open
title: Update overdue 'Deprecated ... removed in 3.x' messages

___
Python tracker 

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



[issue33814] exec() maybe has a memory leak

2018-06-09 Thread Dan Snider


New submission from Dan Snider :

Sort of because I'm really not sure if it's working as intended or not. When I 
found this out today, I noticed that the documentation of `exec` has been 
updated since the last time I saw it, which is good, but it still leaves much 
to be desired. Specifically, I don't feel it does enough to explain the 
supposed justification for `exec`'s ability to very easily trigger a 
catastrophic memory leak someone unfamiliar with the code they're working on 
may never have the patience (if not time) to track down.. 

An illustration:

import itertools
import sys
import weakref

def noleak():

def outer():
from itertools import repeat as re
def f():
return re(1, 1)
return f

f = outer()
c = sys.getrefcount(f)
return c, weakref.ref(f), sys.getrefcount(itertools.repeat)

def leaks():
ns = {}
co =  ('from itertools import repeat as re\n'
   'def f(): return re(1, 1)')
pre = sys.getrefcount(ns)
exec(co, ns)
pos = sys.getrefcount(ns)
return (pre, pos), weakref.ref(ns['f']), 
sys.getrefcount(itertools.repeat)

for i in range(10):
leaks()
for i in range(10):
noleak()

Perhaps I'm wrong in thinking that this is behaving as intended and it actually 
is a bug. Starting from builtin_exec_impl I got as far as _PyFrame_New_NoTrack 
before I threw up my hands and decided this is something for someone else. 

If `exec` with only a `globals` argument is indeed working as intended, I still 
think it's ridiculous that every item added to that dict has an "extra", 
non-obvious reference count that is impossible to vanquish of from within 
Python. I intuited leaving `locals` blank will do what usually happens when 
functions take optional arguments, and *usually* that is *not* the triggering 
of a "hidden" memory leak.


Perhaps the only solution here is to deprecate `exec` accepting `globals` and 
`locals` as optional arguments.

--
assignee: docs@python
components: Documentation, Interpreter Core
messages: 319157
nosy: bup, docs@python
priority: normal
severity: normal
status: open
title: exec() maybe has a memory leak
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



[issue31731] [2.7] test_io hangs on x86 Gentoo Refleaks 2.7

2018-06-09 Thread STINNER Victor


STINNER Victor  added the comment:

AMD64 FreeBSD 10.x Shared 3.7 issue:

http://buildbot.python.org/all/#/builders/124/builds/380

0:15:14 load avg: 0.18 [415/415/1] test_io crashed (Exit code 1)
Timeout (0:15:00)!
Thread 0x000806943c00 (most recent call first):
  File 
"/usr/home/buildbot/python/3.7.koobs-freebsd10/build/Lib/test/test_io.py", line 
4090 in _read
  File "/usr/home/buildbot/python/3.7.koobs-freebsd10/build/Lib/threading.py", 
line 865 in run
  File "/usr/home/buildbot/python/3.7.koobs-freebsd10/build/Lib/threading.py", 
line 917 in _bootstrap_inner
  File "/usr/home/buildbot/python/3.7.koobs-freebsd10/build/Lib/threading.py", 
line 885 in _bootstrap

Thread 0x000802006400 (most recent call first):
  File "/usr/home/buildbot/python/3.7.koobs-freebsd10/build/Lib/threading.py", 
line 1048 in _wait_for_tstate_lock
  File "/usr/home/buildbot/python/3.7.koobs-freebsd10/build/Lib/threading.py", 
line 1032 in join
  File 
"/usr/home/buildbot/python/3.7.koobs-freebsd10/build/Lib/test/test_io.py", line 
4111 in check_interrupted_write
  File 
"/usr/home/buildbot/python/3.7.koobs-freebsd10/build/Lib/test/test_io.py", line 
4135 in test_interrupted_write_text

--

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-09 Thread Eric Fahlgren


Eric Fahlgren  added the comment:

So maybe add the dpiAware and dpiAwareness settings to the manifest for just 
Windows' pythonw.exe and leave the python.exe console interpreter alone?  I'm 
going to guess that the pythonw.exe manifest already has some settings related 
to its unique status that align with this.

--

___
Python tracker 

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



[issue33718] Enhance regrtest: meta-ticket for multiple changes

2018-06-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b4f8bc56c1f19561b936be7347fa594ccd70d025 by Victor Stinner in 
branch '2.7':
bpo-33718: regrtest: use "xxx then yyy" result if re-run (GH-7521) (GH-7562)
https://github.com/python/cpython/commit/b4f8bc56c1f19561b936be7347fa594ccd70d025


--

___
Python tracker 

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



[issue33375] warnings: get filename from frame.f_code.co_filename

2018-06-09 Thread Brett Cannon


Brett Cannon  added the comment:

Thanks everyone for making this happen!

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



[issue33375] warnings: get filename from frame.f_code.co_filename

2018-06-09 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset 3f45f5da8eb052f1b54d37086c67b7094f35b67b by Brett Cannon (Zackery 
Spytz) in branch 'master':
bpo-33375: Fix GCC warning in Python/_warnings.c (GH-7556)
https://github.com/python/cpython/commit/3f45f5da8eb052f1b54d37086c67b7094f35b67b


--

___
Python tracker 

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



[issue33815] List a = []*19 doesn't create a list with index length of 19

2018-06-09 Thread Varada


New submission from Varada :

Hi,
As per my understanding, 
a = [0]*19 -> creates a list of length 19 with all zeros,

>>> a = [0]*19
>>> print (len(a))
19
>>> a [18] = 2
>>> print (a)
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2]
>>>

In the similar way, 
>>> a = []*19 --> Must create a blank list with length 19. 
That is eventhough the contents of the list would be blank or null, I would at 
least expect the length of the list must 19 and the index must have got memory 
allocated so I can access it later ?

Otherwise, if a = []*19 is going to return length as 0, and it's index cannot 
be accessed then what difference does it have with a = []. Aren't they the same 
? There should be some significance of using a = []*19 compared to a = []. They 
cant the the same, can they ?

>>> a = []*19
>>> a [18] = 2
Traceback (most recent call last):
  File "", line 1, in 
IndexError: list assignment index out of range
>>> print (len(a))
0
>>>
>>> b = []
>>> print (len(b))
0
>>> b [18] = 2
Traceback (most recent call last):
  File "", line 1, in 
IndexError: list assignment index out of range
>>>

-
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

--
components: Windows
messages: 319163
nosy: paul.moore, steve.dower, tim.golden, varada86, zach.ware
priority: normal
severity: normal
status: open
title: List a = []*19 doesn't create a list with index length of 19
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue33814] exec() maybe has a memory leak

2018-06-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

It would be helpful if you could show what output you see, and how it differs 
from what you expect.

I think you're just seeing reference cycles or some other delayed garbage 
collection. If you put in a gc.collect() in your loops to force a collection, 
you'll see the reference numbers drop back.

There's no way we would deprecate globals and locals params to exec().

--
nosy: +eric.smith

___
Python tracker 

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



[issue33815] List a = []*19 doesn't create a list with index length of 19

2018-06-09 Thread Zachary Ware


Change by Zachary Ware :


--
components:  -Windows

___
Python tracker 

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



[issue33815] List a = []*19 doesn't create a list with index length of 19

2018-06-09 Thread Zachary Ware


Zachary Ware  added the comment:

Nothing (or 0, or an empty list, string or tuple, etc.) multiplied by any 
positive whole number is still nothing.

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



[issue33816] New metaclass example for Data Model topic

2018-06-09 Thread Andrés Delfino

New submission from Andrés Delfino :

Since Python 3.6, when PEP 520 was accepted, class attribute definition order 
is preserved. That alone is sufficient to replace the example, but then 3.7 
came with guaranteed dictionary insertion order. The metaclass example uses 
OrderedDict, what may cause confusing to new programmers, since it is not 
needed.

I'm creating this issue in case someone who actually has used metaclasses can 
come up with an example, but I'll try to find/think of an example myself.

--
assignee: docs@python
components: Documentation
messages: 319166
nosy: adelfino, docs@python
priority: normal
severity: normal
status: open
title: New metaclass example for Data Model topic
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue33816] New metaclass example for Data Model topic

2018-06-09 Thread Andrés Delfino

Andrés Delfino  added the comment:

I'm talking about the example in Data Model, 3.3.3.6.

--

___
Python tracker 

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



[issue33815] List a = []*19 doesn't create a list with index length of 19

2018-06-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

To elaborate on Zach's comment:

Notice that your first example repeats 0 19 times. The second example repeats 
nothing 19 times.

If you first example returned a list with [0] repeated 19 (that is: [[0], [0], 
[0], ..., [0]]), then you're correct the second example should produce a list 
of 19 empty lists. But that's not the case here.

--
nosy: +eric.smith

___
Python tracker 

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



[issue33738] PyIndex_Check conflicts with PEP 384

2018-06-09 Thread Ned Deily


Ned Deily  added the comment:


New changeset ea62ce7f4fefc66bc0adba16bcd7666d5bbd5b44 by Ned Deily (Christian 
Tismer) in branch 'master':
bpo-33738: Fix macros which contradict PEP 384 (GH-7477)
https://github.com/python/cpython/commit/ea62ce7f4fefc66bc0adba16bcd7666d5bbd5b44


--

___
Python tracker 

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



[issue28222] test_distutils fails

2018-06-09 Thread Zachary Ware


Change by Zachary Ware :


--
pull_requests: +7196

___
Python tracker 

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



[issue33815] List a = []*19 doesn't create a list with index length of 19

2018-06-09 Thread Varada


Varada  added the comment:

Hi, Eric & Zach,

Thanks for your kind response. 

@Eric, from your comments am I to understand that you agree with me or state 
that my understanding is wrong ? :) I couldn't conclude it. 

The point where I find difficult to convince myself is why am I not able to 
access a[18] when I have already kind of declared it like a = []*19.

Is that really an expected behavior.

I agree with Zak, that nothing * anything = nothing. But, in that case why we 
even allow that command to work. 

It leads us think that it will create an empty list 19 times whereas it 
actually doesn't. It's kind of misleading don't you think. 

Many Thanks in advance Eric and Zak for your time on this,

--

___
Python tracker 

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



[issue28222] test_distutils fails

2018-06-09 Thread Zachary Ware


Change by Zachary Ware :


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



[issue28222] test_distutils fails

2018-06-09 Thread Zachary Ware


Zachary Ware  added the comment:


New changeset f6645ef027762adbb159a3b6d64a15538672eaa2 by Zachary Ware in 
branch '2.7':
bpo-28222: Don't fail if pygments is not available (GH-7564)
https://github.com/python/cpython/commit/f6645ef027762adbb159a3b6d64a15538672eaa2


--
nosy: +zach.ware

___
Python tracker 

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



[issue31120] [2.7] Python 64 bit _ssl compile fails due missing buildinf_amd64.h

2018-06-09 Thread Zachary Ware


Change by Zachary Ware :


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



[issue33815] List a = []*19 doesn't create a list with index length of 19

2018-06-09 Thread Stefan Behnel


Stefan Behnel  added the comment:

You misunderstood what the code is doing, and the response that you got 
indicates that the bug tracker is not the right place to discuss this 
misunderstanding. If you want to discuss this further, please ask on the Python 
mailing list (python-l...@python.org).

--
nosy: +scoder

___
Python tracker 

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



[issue33815] List a = []*19 doesn't create a list with index length of 19

2018-06-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Agreed with Stefan about this not being appropriate for the bug tracker.

And I'm saying that I don't agree with you. There's no bug here.

--

___
Python tracker 

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



[issue33738] PyIndex_Check conflicts with PEP 384

2018-06-09 Thread Ned Deily


Ned Deily  added the comment:

As I noted on PR 7477, I decided to merge the change to master so it would get 
some buildbot exposure before deciding whether to backport for 3.7.0rc1 which 
is coming up shortly.  I notice that the change introduced a compiler warning.  
Should that be fixed?

..\Objects\exceptions.c(349): warning C4090: 'return': different 'const' 
qualifiers 
[D:\buildarea\3.x.ware-win81-release\build\PCbuild\pythoncore.vcxproj]

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

--

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2018-06-09 Thread Yury Selivanov


Yury Selivanov  added the comment:

pause_reading and resume_reading became idempotent only in 3.7

--

___
Python tracker 

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



[issue33816] New metaclass example for Data Model topic

2018-06-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Probably, the entire section with the OrderedClass example should be removed.  
Once class dicts became ordered by default, the __prepare__ attribute lost its 
principal motivating use case.

--
nosy: +rhettinger

___
Python tracker 

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



[issue33462] reversible dict

2018-06-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Would you try python_startup and python_startup_nosite benchmark

That seems entirely unnecessary.  If adding __reversed__ has any effect on the 
rest of the build, that is pure random noise that can be ignored. It is normal 
to get small improvements or detriments that vary from compiler to compiler, os 
to os, etc.  Our normal practice is to ignore those and not optimize for random 
or hard-to-control compiler idiosyncrasies which appear and disappear as we add 
methods or as compilers get updated.

--
nosy: +tim.peters

___
Python tracker 

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



[issue33816] New metaclass example for Data Model topic

2018-06-09 Thread Andrés Delfino

Andrés Delfino  added the comment:

To what section are you refering by "the entire section"?

On a side note: I'll make a PR to remove the example. IMHO, there should be an 
example to give some idea of what a metaclass can do, but the current example 
is no longer useful and it's confusing because of how dicts now work.

--

___
Python tracker 

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



[issue33816] New metaclass example for Data Model topic

2018-06-09 Thread Andrés Delfino

Change by Andrés Delfino :


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

___
Python tracker 

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



[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2018-06-09 Thread Chris Eykamp


Chris Eykamp  added the comment:

I've been experiencing the same issue, which is triggered in the exception 
handling of web.py.

Bert's proposed fix, adding the zero byte check (if self._binary_file or 
self.length >= 0:) addresses the issue I'm seeing (tested on 3.5, it's what's 
available where I can reproduce the error).

This issue seems to be languishing.  Is there any way we could push this 
forward, even if it doesn't address every problem with the lib?

--
nosy: +watusimoto

___
Python tracker 

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



[issue33817] PyString_FromFormatV() fails to build empty strings

2018-06-09 Thread Tey


New submission from Tey :

Making PyString_FromFormatV() build an empty string on 2.7 will fail and raise 
the following error:
SystemError: Objects/stringobject.c:3903: bad argument to internal function

It does not matter if format is empty or not (e.g., both 
PyString_FromFormat("") and PyString_FromFormat("%s", "")).

The exception is raised from _PyString_Resize() (called at the end of 
PyString_FromFormatV()), because the string given to that method has a ref 
count different than 1. This is expected for empty strings, because 
PyString_FromStringAndSize() returns a reference to  when  is 
0.

A possible fix would be to prevent the call to _PyString_Resize() from 
PyString_FromFormatV() if  is equal to , or if there is no 
need to resize the string.

Python 3 versions before 3.6 might be impacted as well through 
PyBytes_FromFormatV() (cannot check).

The following code can be used to trigger the bug:

static int dobug(const char *fmt, ...) {
va_list args;
va_start(args, fmt);

PyObject *str = PyString_FromFormatV(fmt, args);
va_end(args);

if(str == NULL) {
fprintf(stderr, "Error: PyString_FromFormatV(%s) returned NULL\n", 
fmt);
return -1;
}

Py_DECREF(str);

return 0;
}

static PyObject* bug(PyObject *self) {
fprintf(stderr, "dobug(\"\") => %d\n", dobug(""));
fprintf(stderr, "dobug(\"%%s\", \"\") => %d\n", dobug("%s", ""));

if(PyErr_Occurred()) return NULL;
Py_RETURN_NONE;
}

--
components: Interpreter Core
messages: 319180
nosy: Tey
priority: normal
severity: normal
status: open
title: PyString_FromFormatV() fails to build empty strings
type: behavior
versions: Python 2.7, 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



[issue32493] UUID Module - FreeBSD build failure

2018-06-09 Thread Ned Deily


Ned Deily  added the comment:


New changeset 20cd5c6e21559f35feded5b3cfa9069a281d4325 by Ned Deily (Michael 
Felt) in branch '3.7':
bpo-32493: Correct test for uuid_enc_be availability in configure.ac. (GH-7511)
https://github.com/python/cpython/commit/20cd5c6e21559f35feded5b3cfa9069a281d4325


--

___
Python tracker 

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



[issue32493] UUID Module - FreeBSD build failure

2018-06-09 Thread Ned Deily


Change by Ned Deily :


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

___
Python tracker 

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



[issue32493] UUID Module - FreeBSD build failure

2018-06-09 Thread Ned Deily


Ned Deily  added the comment:


New changeset ced0adb2638e4c02945bfa82e15595918eef74f1 by Ned Deily in branch 
'master':
bpo-32493: Correct test for uuid_enc_be availability in configure.ac. (GH-7511) 
(GH-7567)
https://github.com/python/cpython/commit/ced0adb2638e4c02945bfa82e15595918eef74f1


--

___
Python tracker 

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



[issue32493] UUID Module - FreeBSD build failure

2018-06-09 Thread Ned Deily


Ned Deily  added the comment:

As noted on PR 7511 and PR 7567, I have merged Michael's configure.ac fixes for 
testing for uuid_enc_be availability (independent of platform) that were 
incorrect in earlier commits for this issue.  Merged for 3.7.0rc1 and master 
(3.8). Thanks, everyone!

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-09 Thread Steve Dower


Steve Dower  added the comment:

I'm okay to add it to the manifest for both in 3.8, along with a What's New 
entry.

High DPI screens are very common though, and adding it to existing releases 
won't allow existing apps or frameworks to account for the change. I don't want 
non-DPI aware apps to suddenly become unreadably small with a minor runtime 
update. Backporting Python-specific docs is fine.

--

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Steve, I would like to add the SetProcessDpiAwareness(1) call to IDLE tomorrow, 
for 3.7.0 and 3.6.6.  Do I need to make it an avoidable option? Can it hurt 
people on some machines?  It seems to me that if tk is doing dpi scaling, then 
it should always be correct to tell Windows that it is doing so.

--

___
Python tracker 

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



[issue33766] Grammar Incongruence

2018-06-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 0aa17ee6a76df0946d42e7657a501f1862065a22 by Terry Jan Reedy 
(Ammar Askar) in branch 'master':
bpo-33766: Document that end of file or string is a newline (GH-7383)
https://github.com/python/cpython/commit/0aa17ee6a76df0946d42e7657a501f1862065a22


--

___
Python tracker 

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



[issue33766] Grammar Incongruence

2018-06-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7199

___
Python tracker 

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



[issue33766] Grammar Incongruence

2018-06-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7200

___
Python tracker 

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



[issue33766] Grammar Incongruence

2018-06-09 Thread miss-islington


miss-islington  added the comment:


New changeset f01b951a0e70f36ca2a3caa043f89a5277bb0bb0 by Miss Islington (bot) 
in branch '2.7':
bpo-33766: Document that end of file or string is a newline (GH-7383)
https://github.com/python/cpython/commit/f01b951a0e70f36ca2a3caa043f89a5277bb0bb0


--
nosy: +miss-islington

___
Python tracker 

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



[issue33766] Grammar Incongruence

2018-06-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7201

___
Python tracker 

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



[issue33814] exec() maybe has a memory leak

2018-06-09 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Perhaps a little less self-righteous anger and a little more detail on this 
alleged bug would be appropriate.

Quote: 
I still think it's ridiculous that every item added to that dict has an 
"extra", non-obvious reference count that is impossible to vanquish of from 
within Python.

Have you demonstrated that this is the case? How do you know that is what is 
happening?

Quote:
I intuited leaving `locals` blank will do what usually happens when functions 
take optional arguments, and *usually* that is *not* the triggering of a 
"hidden" memory leak.

Have you demonstrated a memory leak? What is your intuition for what leaving 
locals blank should do? Did you try running the code without leaving locals 
blank?

Quote: 
the supposed justification for `exec`'s ability to very easily trigger a 
catastrophic memory leak

I wouldn't call your example code "very easily", nor do I know what "supposed 
justification" you are referring to. I read the docs for exec here

https://docs.python.org/3/library/functions.html#exec

and I see nothing justifying memory leaks or even mentioning them. Are you 
reading some other documentation?

Is this the shortest, simplest demonstration of the leak you can come up with? 
What output do you get and what output did you expect?

If it necessary for repeat to be imported under the name "re" over and over 
again? What do weakrefs have to do with this?

You call this a "catastrophic" memory leak, I don't know whether this is mere 
hyperbole or something that will lock up or crash my computer when I run it.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue33811] asyncio accepting connection limit

2018-06-09 Thread Lisa Guo


Lisa Guo  added the comment:

One rough idea would be like this: 
https://github.com/python/cpython/compare/master...lguo2020:fix-issue-33811?expand=1.
 Another option is to associate it with the loop:

loop.set_max_accept(2)

and then later

self._loop._start_serving(., max_accept=self._loop._max_accept)

--

___
Python tracker 

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



[issue33814] exec() maybe has a memory leak

2018-06-09 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I decided to risk this "catastrophic" leak, and ran this:

py> x = leaks()
py> x
((2, 3), , 24)
py> import gc
py> gc.collect()
22
py> x
((2, 3), , 24)


so I think Eric is correct, it is just a garbage collection issue. Possibly a 
bug, possibly normal behaviour. I don't think it is a documentation bug, if it 
is a bug at all it might be a garbage collection bug.

But I really don't know, because I don't understand what Dan thinks is the 
memory leak here or why it happens. I *think* Dan might be referring to the 
fact that each time you call leaks(), there's one extra reference to 
itertools.repeat.

Dan, if you can confirm that's the leak you are referring to, we would have a 
better chance of deciding whether it is a bug and if so if it is specific to 
exec.

--

___
Python tracker 

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



[issue33766] Grammar Incongruence

2018-06-09 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue33814] exec() maybe has a memory leak

2018-06-09 Thread Tim Peters


Tim Peters  added the comment:

Dan, your bug report is pretty much incoherent ;-)  This standard Stack 
Overflow advice applies here too:

https://stackoverflow.com/help/mcve

Guessing your complaint is that:

sys.getrefcount(itertools.repeat)

keeps increasing by 1 across calls to `leaks()`, then as Eric said it will drop 
back to its original value after a `gc.collect()` call.

Steven, best I can tell weakrefs have nothing to do with this.  The refcount on 
itertools.repeat increases if

weakref.ref(ns['f']), 

is deleted.

It's a simple reference cycle.  That is

ns['f'].__globals__ is ns

is True, so `ns` can't be collected via reference counting, and so `ns` also 
holds a reference to the irrelevantly renamed `itertools.repeat` too until 
cyclic gc can detect the trash cycle.

Dan, if that's _not_ what you're complaining about, please follow the advice at 
the top and add a focused, minimal example of what you are talking about.  In 
the meantime, I'm closing this as not-a-bug.

--
nosy: +tim.peters
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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-09 Thread Steve Dower


Steve Dower  added the comment:

Yep, that should be fine.

If you want to add it to the winapi module rather than use ctypes that's fine 
too.

--

___
Python tracker 

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



[issue33762] temp file isn't IOBase

2018-06-09 Thread Martin Panter


Martin Panter  added the comment:

I think it is an implementation detail whether the result subclasses IOBase or 
just implements its API. Why do you want to check the base class, and why 
IOBase in particular, rather than BufferedIOBase, RawIOBase, or TextIOBase?

--

___
Python tracker 

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



[issue33462] reversible dict

2018-06-09 Thread INADA Naoki


INADA Naoki  added the comment:

> If adding __reversed__ has any effect on the rest of the build, that is pure 
> random noise that can be ignored.

Although initialization cost of each one type is small, time for _Py_Ready() is 
not negligible.  And ABC.register() too.  Import time for _collections_abc is 
not negligible too.

I agree that cost of adding three builtin types and register them to ABC will 
be negligible or small enough.
But I think it's good to know before merge.

--

___
Python tracker 

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



[issue33812] Different behavior between datetime.py and its C accelerator

2018-06-09 Thread Alexander Belopolsky


Change by Alexander Belopolsky :


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



[issue33812] Different behavior between datetime.py and its C accelerator

2018-06-09 Thread Alexander Belopolsky


Alexander Belopolsky  added the comment:

Tim, given that I've updated the documentation, should we treat this as a bug 
fix or a feature?  Note that the type check is definitely a bug-fix (if not a 
security issue), but I clearly had a wrong definition of "naive" in mind when I 
was modifying astimezone to support naive instances.

In any case, it looks like a news entry is in order.

--

___
Python tracker 

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



[issue33812] Different behavior between datetime.py and its C accelerator

2018-06-09 Thread Tim Peters


Tim Peters  added the comment:

I'd call it a bug fix, but I'm really not anal about what people call things ;-)

--

___
Python tracker 

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



[issue33738] PyIndex_Check conflicts with PEP 384

2018-06-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

You are right Christian. I missed that PyTypeObject is opaque if Py_LIMITED_API 
is defined.

--

___
Python tracker 

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



[issue33805] dataclasses: replace() give poor error message if using InitVar

2018-06-09 Thread Dong-hee Na


Dong-hee Na  added the comment:

@eric.smith
Can I take a look this issue?

--
nosy: +corona10

___
Python tracker 

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



[issue33462] reversible dict

2018-06-09 Thread INADA Naoki


INADA Naoki  added the comment:

I confirmed the cost is negligible.

python_startup_no_site
==

Mean +- std dev: [master] 7.31 ms +- 0.39 ms -> [reverse] 7.41 ms +- 0.44 ms: 
1.01x slower (+1%)
Mean +- std dev: [master] 7.31 ms +- 0.39 ms -> [register] 7.20 ms +- 0.28 ms: 
1.01x faster (-1%)
Benchmark hidden because not significant (1): python_startup

"register" is "reverse" + following patch:

diff --git a/Lib/_collections_abc.py b/Lib/_collections_abc.py
index dbe30dff1f..28a7e2586c 100644
--- a/Lib/_collections_abc.py
+++ b/Lib/_collections_abc.py
@@ -280,6 +280,9 @@ Iterator.register(bytearray_iterator)
 Iterator.register(dict_keyiterator)
 Iterator.register(dict_valueiterator)
 Iterator.register(dict_itemiterator)
+Iterator.register(type(iter(reversed({}.keys()
+Iterator.register(type(iter(reversed({}.values()
+Iterator.register(type(iter(reversed({}.items()
 Iterator.register(list_iterator)
 Iterator.register(list_reverseiterator)
 Iterator.register(range_iterator)
@@ -306,6 +309,12 @@ class Reversible(Iterable):
 return NotImplemented


+Reversible.register(dict)
+Reversible.register(type({}.keys()))
+Reversible.register(type({}.values()))
+Reversible.register(type({}.items()))
+
+
 class Generator(Iterator):

 __slots__ = ()

--

___
Python tracker 

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



[issue33805] dataclasses: replace() give poor error message if using InitVar

2018-06-09 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue33818] Make PyExceptionClass_Name returning a const string

2018-06-09 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

PyExceptionClass_Name() returns just the tp_name field, a pointer to immutable 
char array. tp_name had type "char *" in old Python versions, but it was 
changed to "const char *" in revision af68c874a6803b4e90b616077a602c0593719a1d.

But PyExceptionClass_Name() still casts tp_name to "char *". I think it would 
be better to return "const char *". It would be a breaking change, but seems 
most third-party code uses the result of PyExceptionClass_Name() in context 
where "const char *" is acceptable [1], and it is easy to add "const" in a 
variable declaration if the result is assigned to a variable (as in both cases 
of using PyExceptionClass_Name() in the CPython core).

Since several similar breaking changes were made in 3.7 (isee ssue28761 and 
issue28769), it would be nice to made this change in 3.7 too. But it may be too 
late for 3.7.

[1] https://github.com/search?q=PyExceptionClass_Name&type=Code

--
components: Interpreter Core
messages: 319200
nosy: ned.deily, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Make PyExceptionClass_Name returning a const string
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



[issue33818] Make PyExceptionClass_Name returning a const string

2018-06-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PyExceptionClass_Name() returns just the tp_name field, a pointer to immutable 
char array. tp_name had type "char *" in old Python versions, but it was 
changed to "const char *" in revision af68c874a6803b4e90b616077a602c0593719a1d.

But PyExceptionClass_Name() still casts tp_name to "char *". I think it would 
be better to return "const char *". It would be a breaking change, but seems 
most third-party code uses the result of PyExceptionClass_Name() in context 
where "const char *" is acceptable [1], and it is easy to add "const" in a 
variable declaration if the result is assigned to a variable (as in both cases 
of using PyExceptionClass_Name() in the CPython core).

Since several similar breaking changes were made in 3.7 (see issue28761 and 
issue28769), it would be nice to made this change in 3.7 too. But it may be too 
late for 3.7.

[1] https://github.com/search?q=PyExceptionClass_Name&type=Code

--

___
Python tracker 

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



[issue33818] Make PyExceptionClass_Name returning a const string

2018-06-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue33818] Make PyExceptionClass_Name returning a const string

2018-06-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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