[issue34195] test_nt_helpers fails with case difference in drive letter

2018-07-23 Thread Tim Golden


New submission from Tim Golden :

>From a fresh build on Win10 with VS2017:

python -munittest -v test.test_ntpath.TestNtpath.test_nt_helpers

gives the following error:

==
FAIL: test_nt_helpers (test.test_ntpath.TestNtpath)
--
Traceback (most recent call last):
  File "c:\work-in-progress\python\cpython\lib\test\test_ntpath.py", line 432, 
in test_nt_helpers
self.assertEqual(drive, nt._getvolumepathname(sys.executable))
AssertionError: 'c:\\' != 'C:\\'
- c:\
? ^
+ C:\
? ^


Ad hoc, it appears that:

`sys.executable` gives a lower-case path while `nt._getvolumepathname` gives an 
upper-case drive letter.

While the test could be trivially fixed, it seems worth investigating a little 
further to see what's happening inside `nt._getvolumepathname`

--
assignee: tim.golden
components: Windows
messages: 322185
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: test_nt_helpers fails with case difference in drive letter
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue21446] Update reload fixer to use importlib instead of imp

2018-07-23 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 05a72f15f76301c505a91728f0818b421fddd290 by Berker Peksag (Miss 
Islington (bot)) in branch '3.7':
bpo-21446: Update reload fixer to use importlib (GH-8391)
https://github.com/python/cpython/commit/05a72f15f76301c505a91728f0818b421fddd290


--

___
Python tracker 

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



[issue21446] Update reload fixer to use importlib instead of imp

2018-07-23 Thread Berker Peksag


Change by Berker Peksag :


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

___
Python tracker 

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



[issue34195] test_nt_helpers fails with case difference in drive letter

2018-07-23 Thread Tim Golden


Tim Golden  added the comment:

import nt, sys; assert 
sys.executable.startswith(nt._getvolumepathname(sys.executable))

This code fails only when run from the python.bat as created by 
pcbuild\build.bat. The obvious difference is that the batch file sets 
PYTHONHOME which, presumably, is used to form sys.executable (haven't checked 
the startup code yet).

The docs for GetVolumePathName [*] don't specify that the drive letter of the 
path returned will be upper-case, but it doesn't seem unlikely.

So... it looks as though the test is unduly sensitive to case-differences in 
the face of something like PYTHONHOME which affects the way in which 
sys.executable is formed.

Phew! I'll put a test patch together later...

[*] 
https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getvolumepathnamew

--

___
Python tracker 

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



[issue34196] @staticmethod mangles name of outside class with __ (it is not inside class with staticmethod, but name mangled anyway), so NameError is produced

2018-07-23 Thread Leeland Morgan


New submission from Leeland Morgan :

Hi! I'm not sure this is bug, but I did not find info about outside classes 
name mangling.

Here is a repro url:

https://repl.it/@LeelandMorgan/FlatSociableResource

--
components: Interpreter Core
messages: 322188
nosy: Leeland Morgan
priority: normal
severity: normal
status: open
title: @staticmethod mangles name of outside class with __ (it is not inside 
class with staticmethod, but name mangled anyway), so NameError is produced
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



[issue34195] test_nt_helpers fails with case difference in drive letter

2018-07-23 Thread Eryk Sun


Eryk Sun  added the comment:

os__getvolumepathname_impl in Modules/posixmodule.c doesn't directly modify the 
case. So that leaves WinAPI GetVolumePathNameW as the culprit, but, according 
to the following test, apparently not in Windows 10.0.17134:

kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
path = (ctypes.c_wchar * 4)()
kernel32.GetVolumePathNameW(r'c:\windows', path, 4)

>>> path.value
'c:\\'

On a related note, nowadays we need to be careful to only use a 
case-insensitive comparison for drive letters and other device names. On 
account of WSL, recent versions of NTFS support flagging directories as case 
sensitive [1][2]. For example, a volume may be mounted using a junction in a 
case-sensitive directory. 

[1]: 
https://blogs.msdn.microsoft.com/commandline/2018/02/28/per-directory-case-sensitivity-and-wsl
[2]: 
https://blogs.msdn.microsoft.com/commandline/2018/06/14/improved-per-directory-case-sensitivity-support-in-wsl

--
nosy: +eryksun

___
Python tracker 

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



[issue19072] classmethod doesn't honour descriptor protocol of wrapped callable

2018-07-23 Thread Berker Peksag


Change by Berker Peksag :


--
pull_requests: +7931

___
Python tracker 

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



[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-07-23 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Indeed, I think this simply needs a documentation fix.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
versions: +Python 3.6, Python 3.8

___
Python tracker 

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



[issue25094] [EASY][Windows] test_tools fails on Windows when passing

2018-07-23 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue25094] [EASY][Windows] test_tools fails on Windows when passing

2018-07-23 Thread STINNER Victor


STINNER Victor  added the comment:

Oh. I identified the root issue: Tools/scripts/2to3 is installed as 
Tools/scripts/2to3.py, a ".py" suffix is added. This script is tested on all 
non-Windows and skipped on Windows when run from source code, but test_sundry() 
imports 2to3.py which causes the test to fail, since the script expects an 
argument on the command line and fails with SystemExit which is not catched by 
test_sundry().

I wrote PR 8406 to skip 2to3.py. My PR also removes imported modules to remove 
side effects of the test.

--

Python 2.7 is not affected: test_tools is skipped on installed Python:

vstinner@WIN C:\>py -2.7 -m test test_tools 
...
test_tools skipped -- test irrelevant for an installed Python
...
Tests result: SUCCESS

--
versions: +Python 3.8

___
Python tracker 

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



[issue34195] test_nt_helpers fails with case difference in drive letter

2018-07-23 Thread Tim Golden


Tim Golden  added the comment:

Thanks, @eryksun. Whatever the reason, it's consistently failing in the way I 
describe. A case-insensitive test is obviously good for that and for the other 
reasons you give, so I'll patch the test anyway.

--

___
Python tracker 

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



[issue34197] Make csv.Dialect attributes skipinitialspace, doublequote and strict booleans

2018-07-23 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Currently attributes skipinitialspace, doublequote and strict of the 
csv.Dialect class are integers 0 or 1.

>>> import csv
>>> d = csv.reader([]).dialect
>>> d.skipinitialspace
0
>>> d.doublequote
1
>>> d.strict
0

The proposed PR makes them False or True.

--
assignee: serhiy.storchaka
components: Library (Lib)
messages: 322193
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Make csv.Dialect attributes skipinitialspace, doublequote and strict 
booleans
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-07-23 Thread tzickel


tzickel  added the comment:

What other object in the standard lib, leaks resources when deleted in CPython 
? Even that documentation says the garbage collector will eventually destroy 
it, just like here... I think there is an implementation bug.

--

___
Python tracker 

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



[issue25094] [EASY][Windows] test_tools fails on Windows when passing

2018-07-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 752d4b7531093c55d6f0a5846748f981d79b29d3 by Victor Stinner in 
branch 'master':
bpo-25094: Fix test_tools.test_sundry() on Windows (GH-8406)
https://github.com/python/cpython/commit/752d4b7531093c55d6f0a5846748f981d79b29d3


--

___
Python tracker 

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



[issue25094] [EASY][Windows] test_tools fails on Windows when passing

2018-07-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7933

___
Python tracker 

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



[issue25094] [EASY][Windows] test_tools fails on Windows when passing

2018-07-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7934

___
Python tracker 

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



[issue34190] x86 Gentoo Refleaks 3.x: test_sys_setprofile leaked [1, 1, 1] references, sum=3

2018-07-23 Thread STINNER Victor


STINNER Victor  added the comment:

I'm able to reproduce the issue on master:

vstinner@apu$ ./python -m test -R 3:3 test_sys_setprofile -m 
test.test_sys_setprofile.ProfileSimulatorTestCase.test_unbound_method_invalid_args
Run tests sequentially
0:00:00 load avg: 0.82 [1/1] test_sys_setprofile
beginning 6 repetitions
123456
..
test_sys_setprofile leaked [1, 1, 1] references, sum=3
test_sys_setprofile failed

== Tests result: FAILURE ==

1 test failed:
test_sys_setprofile

Total duration: 113 ms
Tests result: FAILURE

The test has been modified recently:

commit 56868f940e0cc0b35d33c0070107ff3bed2d8766
Author: jdemeyer 
Date:   Sat Jul 21 10:30:59 2018 +0200

bpo-34126: Fix crashes while profiling invalid calls. (GH-8300)

--
nosy: +vstinner

___
Python tracker 

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



[issue34126] Profiling certain invalid calls crashes Python

2018-07-23 Thread STINNER Victor


STINNER Victor  added the comment:

The new test_sys_setprofile.test_unbound_method_invalid_args() test leaks 
Python references and spotted an old reference leak: bpo-34190.

--
nosy: +vstinner
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue34190] x86 Gentoo Refleaks 3.x: test_sys_setprofile leaked [1, 1, 1] references, sum=3

2018-07-23 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +jdemeyer, serhiy.storchaka

___
Python tracker 

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



[issue34190] x86 Gentoo Refleaks 3.x: test_sys_setprofile leaked [1, 1, 1] references, sum=3

2018-07-23 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

Just to avoid duplicate work: I can have a look at this.

--

___
Python tracker 

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



[issue33336] [imaplib] MOVE is a legal command

2018-07-23 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset caa331d492acc67d8f4edd16542cebfabbbe1e79 by Victor Stinner (Matěj 
Cepl) in branch 'master':
bpo-6, imaplib: Legalize MOVE command (GH-6569)
https://github.com/python/cpython/commit/caa331d492acc67d8f4edd16542cebfabbbe1e79


--

___
Python tracker 

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



[issue33336] [imaplib] MOVE is a legal command

2018-07-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7935

___
Python tracker 

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



[issue33336] [imaplib] MOVE is a legal command

2018-07-23 Thread STINNER Victor


STINNER Victor  added the comment:

I don't think that "git cherry-pick -x" can be used before a PR is merged, 
since the merge changes the SHA1 (using our current workflow).

--

___
Python tracker 

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



[issue33336] [imaplib] MOVE is a legal command

2018-07-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7936

___
Python tracker 

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



[issue33336] [imaplib] MOVE is a legal command

2018-07-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7937

___
Python tracker 

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



[issue33336] [imaplib] MOVE is a legal command

2018-07-23 Thread STINNER Victor

STINNER Victor  added the comment:

Matěj Cepl: There is a bot to backport changes to other branches. I closed your 
backport PRs. I prefer to polish the change for the master branch, and only 
backport later. For example, I modified the commit message of your PR. The bot 
also uses "git cherry-pick -x" to mention the sha1 of the backported commit 
which helps to track the origin of backports.

--

___
Python tracker 

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



[issue34198] Additional encoding options to tkinter.filedialog

2018-07-23 Thread Narito Takizawa


Change by Narito Takizawa :


--
components: Tkinter
nosy: narito
priority: normal
severity: normal
status: open
title: Additional encoding options to tkinter.filedialog
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue34199] Add support for delete logger in log module.

2018-07-23 Thread Chetan kolhe


New submission from Chetan kolhe :

Hi,
Currently, there is no support for whether the logger object is present or not. 
when logging module imported in current namespace all logger object get 
imported. which uses the memory.
Add the option explicitly to delete the logger object.

e.g logging.deletLoger("name for logger object")

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 322202
nosy: chetankolhe
priority: normal
severity: normal
status: open
title: Add support for delete logger in log module.
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue34198] Additional encoding options to tkinter.filedialog

2018-07-23 Thread Narito Takizawa


Change by Narito Takizawa :


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

___
Python tracker 

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



[issue34195] test_nt_helpers fails with case difference in drive letter

2018-07-23 Thread Tim Golden


Tim Golden  added the comment:

@eryksun almost idly I ran your ctypes code in the built interpreter. As 
written, it produces a lower-case c:\\ as yours did.

But...

Running Debug|Win32 interpreter...
Python 3.8.0a0 (heads/master:7a3056f, Jul 23 2018, 08:23:33) [MSC v.1912 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes, sys
>>>
>>> sys.executable
'c:\\work-in-progress\\python\\cpython\\PCbuild\\win32\\python_d.exe'
>>> kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
>>> path = (ctypes.c_wchar * 4)()
>>> kernel32.GetVolumePathNameW(sys.executable, path, 4)
1
>>> path.value
'C:\\'
>>>

--

___
Python tracker 

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



[issue25094] [EASY][Windows] test_tools fails on Windows when passing

2018-07-23 Thread miss-islington


miss-islington  added the comment:


New changeset 1724c0c984e6406d80d8ebe3bb7b70f23c8b5f45 by Miss Islington (bot) 
in branch '3.6':
bpo-25094: Fix test_tools.test_sundry() on Windows (GH-8406)
https://github.com/python/cpython/commit/1724c0c984e6406d80d8ebe3bb7b70f23c8b5f45


--
nosy: +miss-islington

___
Python tracker 

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



[issue25094] [EASY][Windows] test_tools fails on Windows when passing

2018-07-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ba1810e1ec8973e48128e17845b981d8894c0550 by Victor Stinner (Miss 
Islington (bot)) in branch '3.7':
bpo-25094: Fix test_tools.test_sundry() on Windows (GH-8406) (GH-8407)
https://github.com/python/cpython/commit/ba1810e1ec8973e48128e17845b981d8894c0550


--

___
Python tracker 

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



[issue25094] [EASY][Windows] test_tools fails on Windows when passing

2018-07-23 Thread STINNER Victor


STINNER Victor  added the comment:

The issue should now be fixed in 3.6, 3.7 and master branches. You will have to 
wait for the next release in each branch to get the fix! In the meanwhile, you 
can skip manually the 2to3 by modifying manually the test.

Thanks for everybody who helped to report and identify the origin of the bug!

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



[issue34177] test_site fails in macOS-PR VSTS builds for 3.7 branch

2018-07-23 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Adding @vstinner as a friendly reminder since buildbot related failures are 
notified. This issue causes all the PRs for 3.7 on Mac OS VSTS builds to fail 
since July 19 though other Mac related builds are passing.

Feel free to remove yourself or close this if it's irrelevant.

Thanks

--
nosy: +vstinner

___
Python tracker 

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



[issue34200] [Windows] python -X utf8 -m test test_pkg fails

2018-07-23 Thread STINNER Victor


New submission from STINNER Victor :

vstinner@WIN C:\vstinner\python\master>python -X utf8 -m test -v test_pkg   

==  
ERROR: test_4 (test.test_pkg.TestPkg)   
--  
Traceback (most recent call last):  
  File "C:\vstinner\python\master\lib\test\test_pkg.py", line 180, in test_4
self.run_code(s)
  File "C:\vstinner\python\master\lib\test\test_pkg.py", line 69, in run_code   
exec(textwrap.dedent(code), globals(), {"self": self})  
  File "", line 2, in   
  File "C:\Users\vstinner\AppData\Local\Temp\tmpgr2te1hp\t4.py", line 1, in 
RuntimeError: Shouldnt load t4.py   

==  
FAIL: test_7 (test.test_pkg.TestPkg)
--  
Traceback (most recent call last):  
  File "C:\vstinner\python\master\lib\test\test_pkg.py", line 260, in test_7
'__name__', '__package__', '__path__', '__spec__']) 
AssertionError: Lists differ: ['__c[34 chars]__loader__', '__name__', '__package
__', '__spec__'] != ['__c[34 chars]__loader__', '__name__', '__package__', '__pa
th__', '__spec__']  

First differing element 6:  
'__spec__'  
'__path__'  

Second list contains 1 additional elements. 
First extra element 7:  
'__spec__'  

  ['__cached__',
   '__doc__',   
   '__file__',  
   '__loader__',
   '__name__',  
   '__package__',   
+  '__path__',  
   '__spec__']  

--

--
components: Tests, Windows
messages: 322208
nosy: paul.moore, steve.dower, tim.golden, vstinner, zach.ware
priority: normal
severity: normal
status: open
title: [Windows] python -X utf8 -m test test_pkg fails
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



[issue33719] Test failures on Python 3.7 beta 5 and Windows 10

2018-07-23 Thread STINNER Victor


STINNER Victor  added the comment:

* test_mashal has been fixed: bpo-33720
* test_tools has been fixed: bpo-25094
* test_pkg -X utf8: I just created bpo-34200

It seems like all test failures reported in this issue have been fixed or got 
their own dedicated issue, so I close thie issue.

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



[issue34200] python -X utf8 -m test test_pkg fails

2018-07-23 Thread STINNER Victor


STINNER Victor  added the comment:

I'm able to reproduce the bug on Linux as well. I able to reproduce the bug on 
3.7 and master, but the bug seems random. Example on Linux with master:

vstinner@apu$ ./python -X utf8 -m test test_pkg 
Run tests sequentially
0:00:00 load avg: 1.30 [1/1] test_pkg

== Tests result: SUCCESS ==

1 test OK.

Total duration: 73 ms
Tests result: SUCCESS
vstinner@apu$ ./python -X utf8 -m test test_pkg 
Run tests sequentially
0:00:00 load avg: 1.35 [1/1] test_pkg

== Tests result: SUCCESS ==

1 test OK.

Total duration: 72 ms
Tests result: SUCCESS
vstinner@apu$ ./python -X utf8 -m test test_pkg 
Run tests sequentially
0:00:00 load avg: 1.35 [1/1] test_pkg
test test_pkg failed -- Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/test/test_pkg.py", line 260, in 
test_7
'__name__', '__package__', '__path__', '__spec__'])
AssertionError: Lists differ: ['__c[34 chars]__loader__', '__name__', 
'__package__', '__spec__'] != ['__c[34 chars]__loader__', '__name__', 
'__package__', '__path__', '__spec__']

First differing element 6:
'__spec__'
'__path__'

Second list contains 1 additional elements.
First extra element 7:
'__spec__'

  ['__cached__',
   '__doc__',
   '__file__',
   '__loader__',
   '__name__',
   '__package__',
+  '__path__',
   '__spec__']

test_pkg failed

== Tests result: FAILURE ==

1 test failed:
test_pkg

Total duration: 74 ms
Tests result: FAILURE

--
title: [Windows] python -X utf8 -m test test_pkg fails -> python -X utf8 -m 
test test_pkg fails

___
Python tracker 

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



[issue34195] test_nt_helpers fails with case difference in drive letter

2018-07-23 Thread Tim Golden


Tim Golden  added the comment:

I think I've got down to the determining factor. For info:

PYTHONHOME has nothing to do with it: the same thing happens if I cd into 
PCBuild\win32 and run python_d.exe directly

For historical reasons the directory in which I'm building 
(c:\work-in-progress) is actually a junction to c:\users\\work-in-progress. 
There is some commentary in the API docs about traversing junctions, so 
presumably that's special-cased in some way which results in an uppercase drive 
letter.

If I rebuild in, eg, c:\temp which is a normal directory, I don't see the 
uppercase conversion. So, while I still need to fix the underlying test to be 
case-insensitive, it looks like the Mystery of the Uppercase Drive Letter is at 
least mostly solved.

--

___
Python tracker 

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



[issue34200] importlib: python -m test test_pkg -m test_7 fails randomly

2018-07-23 Thread STINNER Victor


Change by STINNER Victor :


--
title: python -X utf8 -m test test_pkg fails -> importlib: python -m test 
test_pkg -m test_7 fails randomly

___
Python tracker 

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



[issue34199] Add support for delete logger in log module.

2018-07-23 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34200] importlib: python -m test test_pkg -m test_7 fails randomly

2018-07-23 Thread STINNER Victor


STINNER Victor  added the comment:

The test creates the following files:

/tmp/tmpsobc8gzf/t7.py
/tmp/tmpsobc8gzf/t7
/tmp/tmpsobc8gzf/t7/__init__.py
/tmp/tmpsobc8gzf/t7/sub.py
/tmp/tmpsobc8gzf/t7/sub
/tmp/tmpsobc8gzf/t7/sub/__init__.py
/tmp/tmpsobc8gzf/t7/sub/.py
/tmp/tmpsobc8gzf/t7/sub/subsub
/tmp/tmpsobc8gzf/t7/sub/subsub/__init__.py

/tmp/tmpsobc8gzf contains t7.py file and t7/ subdirectory.


The test pass when the directory is loaded:

vstinner@apu$ ./python -m test test_pkg -m test_7
Run tests sequentially
0:00:00 load avg: 0.96 [1/1] test_pkg
MODULE 

== Tests result: SUCCESS ==

1 test OK.

Total duration: 51 ms
Tests result: SUCCESS


But fail when it gets the t7.py file:

vstinner@apu$ ./python -m test test_pkg -m test_7
Run tests sequentially
0:00:00 load avg: 0.96 [1/1] test_pkg
MODULE 
test test_pkg failed -- Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/test/test_pkg.py", line 261, in 
test_7
'__name__', '__package__', '__path__', '__spec__'])
AssertionError: Lists differ: ['__c[34 chars]__loader__', '__name__', 
'__package__', '__spec__'] != ['__c[34 chars]__loader__', '__name__', 
'__package__', '__path__', '__spec__']

First differing element 6:
'__spec__'
'__path__'

Second list contains 1 additional elements.
First extra element 7:
'__spec__'

  ['__cached__',
   '__doc__',
   '__file__',
   '__loader__',
   '__name__',
   '__package__',
+  '__path__',
   '__spec__']

test_pkg failed

== Tests result: FAILURE ==

1 test failed:
test_pkg

Total duration: 49 ms
Tests result: FAILURE

--

___
Python tracker 

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



[issue34200] importlib: python -m test test_pkg -m test_7 fails randomly

2018-07-23 Thread STINNER Victor


STINNER Victor  added the comment:

I'm also able to reproduce the bug on Python 3.6.

Note: -X utf8 option is unrelated to this issue.

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



[issue34200] importlib: python -m test test_pkg -m test_7 fails randomly

2018-07-23 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Almost always fails 8/10 times.

cpython git:(master) $ ./python -m unittest -v test.test_pkg
test_1 (test.test_pkg.TestPkg) ... ok
test_2 (test.test_pkg.TestPkg) ... ok
test_3 (test.test_pkg.TestPkg) ... ok
test_4 (test.test_pkg.TestPkg) ... ERROR
test_5 (test.test_pkg.TestPkg) ... ok
test_6 (test.test_pkg.TestPkg) ... ok
test_7 (test.test_pkg.TestPkg) ... FAIL
test_8 (test.test_pkg.TestPkg) ... ok

==
ERROR: test_4 (test.test_pkg.TestPkg)
--
Traceback (most recent call last):
  File "/home/cpython/Lib/test/test_pkg.py", line 180, in test_4
self.run_code(s)
  File "/home/cpython/Lib/test/test_pkg.py", line 69, in run_code
exec(textwrap.dedent(code), globals(), {"self": self})
  File "", line 2, in 
  File "/tmp/tmpfxqne6o1/t4.py", line 1, in 
RuntimeError: Shouldnt load t4.py

==
FAIL: test_7 (test.test_pkg.TestPkg)
--
Traceback (most recent call last):
  File "/home/cpython/Lib/test/test_pkg.py", line 260, in test_7
'__name__', '__package__', '__path__', '__spec__'])
AssertionError: Lists differ: ['__c[34 chars]__loader__', '__name__', 
'__package__', '__spec__'] != ['__c[34 chars]__loader__', '__name__', 
'__package__', '__path__', '__spec__']

First differing element 6:
'__spec__'
'__path__'

Second list contains 1 additional elements.
First extra element 7:
'__spec__'

  ['__cached__',
   '__doc__',
   '__file__',
   '__loader__',
   '__name__',
   '__package__',
+  '__path__',
   '__spec__']

--
Ran 8 tests in 0.040s

FAILED (failures=1, errors=1)

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



[issue34200] importlib: python -m test test_pkg -m test_7 fails randomly

2018-07-23 Thread STINNER Victor


STINNER Victor  added the comment:

I removed Windows experts from the nosy list, since the issue is related to 
importlib, no Windows.

--
components:  -Windows
nosy: +barry, brett.cannon, ncoghlan -paul.moore, steve.dower, tim.golden, 
xtreak, zach.ware

___
Python tracker 

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



[issue34199] Add support for delete logger in log module.

2018-07-23 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This seems related : 
https://mail.python.org/pipermail/python-list/2011-November/615602.html

--

___
Python tracker 

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



[issue33336] [imaplib] MOVE is a legal command

2018-07-23 Thread miss-islington


miss-islington  added the comment:


New changeset 112784984784199d54176132edc38ce8c9b007c1 by Miss Islington (bot) 
in branch '3.6':
bpo-6, imaplib: Legalize MOVE command (GH-6569)
https://github.com/python/cpython/commit/112784984784199d54176132edc38ce8c9b007c1


--
nosy: +miss-islington

___
Python tracker 

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



[issue34190] x86 Gentoo Refleaks 3.x: test_sys_setprofile leaked [1, 1, 1] references, sum=3

2018-07-23 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


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

___
Python tracker 

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



[issue34190] x86 Gentoo Refleaks 3.x: test_sys_setprofile leaked [1, 1, 1] references, sum=3

2018-07-23 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, so it's a real bug, a reference leak, which have been introduced by:

commit 93fac8dd358cd0e85e7b59115db226ce685d3f6f
Author: INADA Naoki 
Date:   Tue Mar 7 14:24:37 2017 +0900

bpo-29676: fix lsprof can't profile C method call. (GH523)

When LOAD_METHOD is used for calling C mehtod, PyMethodDescrObject
was passed to profilefunc from 5566bbb.
But lsprof traces only PyCFunctionObject. Additionally, there can be
some third party extension which assumes passed arg is
PyCFunctionObject without calling PyCFunction_Check().

So make PyCFunctionObject from PyMethodDescrObject when
tstate->c_profilefunc is set.

--

___
Python tracker 

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



[issue34190] x86 Gentoo Refleaks 3.x: test_sys_setprofile leaked [1, 1, 1] references, sum=3

2018-07-23 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +inada.naoki, yselivanov

___
Python tracker 

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



[issue34195] test_nt_helpers fails with case difference in drive letter

2018-07-23 Thread Eryk Sun


Eryk Sun  added the comment:

> the directory in which I'm building (c:\work-in-progress) is actually 
> a junction to c:\users\\work-in-progress

That makes sense. GetVolumePathName traverses backwards from the final 
component. If it reaches a reparse point (other than a junction that targets a 
volume name of the form "\??\Volume{GUID}\"), it has to start over from the 
reparsed final path obtained from GetFinalPathNameByHandle. Subsequently it's 
traversing back from "C:\Users\\work-in-progress" down to upper-case "C:\".

--

___
Python tracker 

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



[issue34177] test_site fails in macOS-PR VSTS builds for 3.7 branch

2018-07-23 Thread STINNER Victor


Change by STINNER Victor :


--
components: +macOS
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



[issue34177] test_site fails in macOS-PR VSTS builds for 3.7 branch

2018-07-23 Thread STINNER Victor


Change by STINNER Victor :


--
components: +Tests -Build

___
Python tracker 

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



[issue33336] [imaplib] MOVE is a legal command

2018-07-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 96bba049f4bd4d030a72326fd1a67586454f6e2c by Victor Stinner (Miss 
Islington (bot)) in branch '3.7':
bpo-6, imaplib: Legalize MOVE command (GH-6569) (GH-8409)
https://github.com/python/cpython/commit/96bba049f4bd4d030a72326fd1a67586454f6e2c


--

___
Python tracker 

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



[issue34201] Make ndarray.readonly a bool

2018-07-23 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

memoryview.readonly is a bool, but ndarray.readonly is an int 0 or 1. The 
proposed PR makes ndarray.readonly a bool and makes test_buffer using more 
strict assertIs() instead of assertEqual() for testing boolean values.

--
components: Tests
messages: 31
nosy: serhiy.storchaka, skrah
priority: normal
severity: normal
status: open
title: Make ndarray.readonly a bool
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue34201] Make ndarray.readonly a bool

2018-07-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue33336] [imaplib] MOVE is a legal command

2018-07-23 Thread miss-islington


miss-islington  added the comment:


New changeset 7868426c1fe562d2d70bbfd0bb3d0da82f909001 by Miss Islington (bot) 
in branch '2.7':
bpo-6, imaplib: Legalize MOVE command (GH-6569)
https://github.com/python/cpython/commit/7868426c1fe562d2d70bbfd0bb3d0da82f909001


--

___
Python tracker 

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



[issue33336] [imaplib] MOVE is a legal command

2018-07-23 Thread STINNER Victor

STINNER Victor  added the comment:

Matěj Cepl: Thanks for your change. I applied it to 2.7, 3.6, 3.7 and master 
branches.

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



[issue33336] [imaplib] MOVE is a legal command

2018-07-23 Thread STINNER Victor


STINNER Victor  added the comment:

Anthony Singleton: "Fuck you"

What does justify this verbal violence?

--

___
Python tracker 

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



[issue34158] Documentation of datetime '%z' format code is odd

2018-07-23 Thread Paul Ganssle


Change by Paul Ganssle :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue34190] x86 Gentoo Refleaks 3.x: test_sys_setprofile leaked [1, 1, 1] references, sum=3

2018-07-23 Thread STINNER Victor


Change by STINNER Victor :


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



[issue32780] ctypes: memoryview gives incorrect PEP3118 format strings for both packed and unpacked structs

2018-07-23 Thread Eric Wieser


Eric Wieser  added the comment:

> It should be fairly simple to modify the code to use a format of "B" 
> for unions, so that it at least matches the itemsize

Seems reasonable, although:

* I think it should be "B" or "()B"
* I'd rather leave that for a later patch. While it would be correct, it's 
still not correct enough to be that useful, since ultimately the union layout 
is still lost. I'd prefer to focus on fixing the part of the PEPE3118 
implementation that is most useful, rather than committing to fixing the whole 
thing all at once.

--

___
Python tracker 

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



[issue34193] Fix pluralization in TypeError messages in getargs.c

2018-07-23 Thread ppperry


Change by ppperry :


--
nosy: +ppperry

___
Python tracker 

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



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

2018-07-23 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



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

2018-07-23 Thread Zackery Spytz


Change by Zackery Spytz :


--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue34125] Profiling depends on whether **kwargs is given

2018-07-23 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


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

___
Python tracker 

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



[issue34046] subparsers -> add_parser doesn't support hyphen char '-'

2018-07-23 Thread paul j3


paul j3  added the comment:

Do you understand why this is happening?

Subparsers is, in effect, a positional argument with 'choices' - the choices 
being the parsers (and their aliases).

But '-dr' looks like an flagged (optionals) argument.  Since you didn't define 
such an argument, it gets put in the 'unrecognized' category.

So, no, you can't used a flag-like name for a parser.  Why are you trying to do 
this?

--
nosy: +paul.j3

___
Python tracker 

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



[issue8525] Display exceptions' subclasses in help()

2018-07-23 Thread Eric Wieser


Eric Wieser  added the comment:

> I get the following results for builtin objects that have defined subclasses

>From that list, the only unhelpful ones with > 4 items, in my opinion, appear 
>to be `object`, since that just tells you every type that exists, and `tuple`, 
>because that lists every single namedtuple.

> So it is USEFUL to know ALL subclasses of a given Exception class

I agree with this - most of the value here comes from showing the full set of 
exceptions. If we don't do that, we should probably point the user to calling 
`cls.__subclasses__()` so they can inspect the full list

--
nosy: +Eric.Wieser

___
Python tracker 

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



[issue34174] argparse formatter_class issue for RawDescriptionHelpFormatter

2018-07-23 Thread paul j3


paul j3  added the comment:

argparse does import 'textwrap', but as '_textwrap', so it could be used with:

argparse._textwrap.dedent(...)

Importing your own is cleaner.

--
nosy: +paul.j3

___
Python tracker 

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



[issue34191] argparse: Missing subparser error message should be more clear

2018-07-23 Thread paul j3


paul j3  added the comment:

Your code runs fine under 3.6.5.

But if I add 'subparsers.required=True', I get your error.  It's having 
problems formatting the name of the subparsers command when issuing the error 
message.

If I add a 'dest' to the add_subparsers I get the expected error message:

import argparse

parser = argparse.ArgumentParser(description="Automatically process XML")
subparsers = parser.add_subparsers(title='subcommands', dest='cmd')
subparsers.required=True
chain_parser = subparsers.add_parser('chain', aliases=['c'], 
help='Automatically run a chain of transformations')

args = parser.parse_args()
print(args)

The default 'dest' for subparsers is None, and the error arises from

','.join([None])

The problems with a missing 'dest' came up in earlier discussions about making 
required/not required subparsers.  3.7 made subparsers 'required' by default, 
but it appears that it hasn't addressed this missing 'dest' problem.

But I haven't followed the latest release details closely.

--
nosy: +paul.j3

___
Python tracker 

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



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

2018-07-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7943

___
Python tracker 

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



[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-07-23 Thread tzickel


tzickel  added the comment:

I think I've found the code bug causing the leak:

https://github.com/python/cpython/blob/caa331d492acc67d8f4edd16542cebfabbbe1e79/Lib/multiprocessing/pool.py#L180

There is a circular reference between the Pool object, and the 
self._worker_handler Thread object (and it's also saved in the frame locals for 
the thread object, which prevents it from being garbage collected).

--

___
Python tracker 

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



[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-07-23 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

> What other object in the standard lib, leaks resources when deleted in 
> CPython ?

Threads come to mind, for example:

>>> import time, threading, weakref
>>> t = threading.Thread(target=time.sleep, args=(10,))
>>> t.start()
>>> wr = weakref.ref(t)
>>> del t
>>> wr()


Note I'm not against fixing this issue, just saying it's not that surprising 
for Pool to keep lingering around when you lost any user-visible reference to 
it.

--

___
Python tracker 

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



[issue34190] x86 Gentoo Refleaks 3.x: test_sys_setprofile leaked [1, 1, 1] references, sum=3

2018-07-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 147d95511f59cfdd2d522f9d736f2335457bae20 by Victor Stinner 
(jdemeyer) in branch 'master':
bpo-34190: Fix reference leak in call_function() (GH-8413)
https://github.com/python/cpython/commit/147d95511f59cfdd2d522f9d736f2335457bae20


--

___
Python tracker 

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



[issue34190] x86 Gentoo Refleaks 3.x: test_sys_setprofile leaked [1, 1, 1] references, sum=3

2018-07-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7944

___
Python tracker 

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



[issue34188] Allow dict choices to "transform" values in argpagse

2018-07-23 Thread paul j3


paul j3  added the comment:

The 'choices' mechanism is a simple 'value in choices' test.  A dictionary (or 
other mapping) works because it works with 'in'.

'type' as noted is the means that argparse provides for transforming an input 
string into some other object (most commonly a number with 'int' or 'float').  
The choices test is performed after the type transformation.

The 'set_defaults()' with subparsers is offered almost as a parenthetical idea, 
and has nothing to do with 'choices' or 'type'.  'set_defaults' is just another 
way of setting default values, and works even with 'dest' which aren't 
otherwise defined.  If that isn't clear, I'd suggest testing it with the main 
parser.  

In Python functions are first class objects, and thus can be used just like 
strings or numbers - assigned to variables, put in lists, etc.  

In:

   adict = {'I':int, 'F':float}
   parser.add_argument('foo', type=lambda x: adict.get(x), 
choices=adict.values())

the 'type' transforms the commandline string into a the dictionary value, and 
'choices' then tests that against the values of the dictionary.  (I had to use 
`lambda` instead of 'adict.get' directly because of testing that 'type' does.)

--
nosy: +paul.j3

___
Python tracker 

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



[issue32752] no information about accessing typing.Generic type arguments

2018-07-23 Thread Jared Deckard


Jared Deckard  added the comment:

typing_inspect is now filled with python version checks for 3.7. The 
implementation got significantly more complex when differentiating generics at 
runtime.

3.6 was undocumented, but the OO API was intuitive:

>>> T = typing.Union[int, float]
>>> assert T.__class__ == typing.Union
>>> assert T.__args__ == (int, float)

3.7 is less convenient and less consistent:

>>> T = typing.Union[int, float]
>>> assert T.__class__ == typing._GenericAlias
>>> assert T.__origin__ == typing.Union
>>> L = typing.List[int]
>>> assert L.__class__ == typing._GenericAlias
>>> assert L.__origin__ == list

--
nosy: +Jared Deckard

___
Python tracker 

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



[issue30400] Race condition in shutil.copyfile(): source file replaced file during copy

2018-07-23 Thread Preston Moore

Preston Moore  added the comment:

Hey everyone,

I have updated the pull request to include a version of copyfile() that 
attempts to address the discussed race condition by open()’ing a file 
descriptor to the relevant files as early as possible and maintaining it 
throughout processing.  In order for this to work I had to use some lower level 
posix-only features. Specifically, I had to open() the files non-blocking 
initially and using fcntl() to make them blocking once some initial checks have 
been performed.  The functions behavior under Windows should be unchanged.  I 
chose this course because Windows doesn’t support fcntl() or os.open() with 
O_NONBLOCK.

I will add a few additional tests around the new checks and get things ready 
for a merge.  I would also be glad to use a strategy of this nature to fix 
similar bugs in the other areas discussed above.

Thanks,
Preston

--

___
Python tracker 

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



[issue13407] tarfile doesn't support multistream bzipped tar files

2018-07-23 Thread Andrés Delfino

Andrés Delfino  added the comment:

This is no longer reproducible under 3.7.0.

>>> import tarfile
>>> tf = tarfile.open("kdelibs-4.7.3.tar.bz2", "r")
>>> print(len(tf.getnames()))
9237

Not sure I should be the one closing this.

--
nosy: +adelfino

___
Python tracker 

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



[issue29710] Incorrect representation caveat on bitwise operation docs

2018-07-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

> 4. Performing these calculations with at least one extra sign extension bit 
> in a finite two's complement representation (a working bit-width of ``1 + 
> max(x.bit_length(), y.bit_length()`` or more) is sufficient to get the same 
> result as if there were an infinite number of sign bits.

LGTM

--

___
Python tracker 

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



[issue34189] Add simple tests for new Tk widget options

2018-07-23 Thread Zackery Spytz


Zackery Spytz  added the comment:

It appears that a file was backported to 2.7 by accident.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue29710] Incorrect representation caveat on bitwise operation docs

2018-07-23 Thread Sanyam Khurana


Sanyam Khurana  added the comment:

Seems good to me. I've made the changes in the PR.

--

___
Python tracker 

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



[issue8525] Display exceptions' subclasses in help()

2018-07-23 Thread Sanyam Khurana


Sanyam Khurana  added the comment:

Hi,

My perception with all the discussion and WIP patch is that we can ideally 
limit the no. of subclasses shown only for object, and not for any other class.

>From that list, the only unhelpful ones with > 4 items, in my opinion, appear 
>to be `object`, since that just tells you every type that exists, and `tuple`, 
>because that lists every single namedtuple.

> So it is USEFUL to know ALL subclasses of a given Exception class

+1

> I agree with this - most of the value here comes from showing the full set of 
> exceptions. If we don't do that, we should probably point the user to calling 
> `cls.__subclasses__()` so they can inspect the full list

I agree with this. I would propose to only limit to 4 classes for subclasses of 
`object` and for everything else displaying all the subclasses. We can 
optionally display the message to call `cls.__subclasses()` in the case when 
`help(object)` is called.

How does it sound?

--

___
Python tracker 

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



[issue34191] argparse: Missing subparser error message should be more clear

2018-07-23 Thread paul j3


paul j3  added the comment:

Updating you Python3.7 might change the behavior.  If I read

https://github.com/python/cpython/commits/master/Lib/argparse.py

correctly, subparsers are no longer required by default (it reverted back to 
earlier Py3 behavior).  There is a proposed patch for handling this 'dest=None' 
issue, but I don't think that's been pushed.

But simply adding the 'dest' to subparses should work without update.  If you 
want to identify which subparser was used, you need this 'dest'.

--

___
Python tracker 

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



[issue13407] tarfile doesn't support multistream bzipped tar files

2018-07-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is a 2.7 only documentation issue.

--

___
Python tracker 

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



[issue29710] Incorrect representation caveat on bitwise operation docs

2018-07-23 Thread Tim Peters


Tim Peters  added the comment:

@CuriousLearner, does the PR also include Nick's first suggested change?  Here:

"""
1. Replace the opening paragraph of 
https://docs.python.org/3/library/stdtypes.html#bitwise-operations-on-integer-types
 (the one I originally quoted when opening this issue) with the text:

=
Bitwise operations only make sense for integers. The result of bitwise 
operations is calculated as though carried out in two's complement with an 
infinite number of sign bits.
=
"""

--

___
Python tracker 

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



[issue13407] tarfile doesn't support multistream bzipped tar files

2018-07-23 Thread Andrés Delfino

Andrés Delfino  added the comment:

Sorry, you are right. I'll try on 2.7 when I get home, and make a PR if needed.

--

___
Python tracker 

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



[issue29710] Incorrect representation caveat on bitwise operation docs

2018-07-23 Thread Sanyam Khurana


Sanyam Khurana  added the comment:

Hey Tim,

> @CuriousLearner, does the PR also include Nick's first suggested change?  
> Here:

"""
=
Bitwise operations only make sense for integers. The result of bitwise 
operations is calculated as though carried out in two's complement with an 
infinite number of sign bits.
=
"""

I think it was then discussed to keep this line as:

"""
===
Bitwise operations only make sense for integers. Negative numbers are treated 
as their 2's complement value.
===
"""

Does this needs to be changed?

Here is the link of the PR: 
https://github.com/python/cpython/pull/1691/files#diff-7498e907ba97646df434a0eb583c6909

--

___
Python tracker 

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



[issue29710] Incorrect representation caveat on bitwise operation docs

2018-07-23 Thread Tim Peters


Tim Peters  added the comment:

Nick suggested two changes on 2018-07-15 (look above).  Mark & I agreed about 
the first change, so it wasn't mentioned again after that.  All the rest has 
been refining the second change.

--

___
Python tracker 

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



[issue34189] Add simple tests for new Tk widget options

2018-07-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +7945

___
Python tracker 

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



[issue34189] Add simple tests for new Tk widget options

2018-07-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Good point Zackery!

--

___
Python tracker 

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



[issue29710] Incorrect representation caveat on bitwise operation docs

2018-07-23 Thread Sanyam Khurana


Sanyam Khurana  added the comment:

On, yes, I think I missed the first point, earlier. Thank You! I did the 
changes.

--

___
Python tracker 

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



[issue34189] Add simple tests for new Tk widget options

2018-07-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset fbcb6fae6233efbde1f6bb9fe51e33baec4767b8 by Serhiy Storchaka in 
branch '2.7':
bpo-34189: Remove a file backported by accident. (GH-8419)
https://github.com/python/cpython/commit/fbcb6fae6233efbde1f6bb9fe51e33baec4767b8


--

___
Python tracker 

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



[issue23927] getargs.c skipitem() doesn't skip 'w*'

2018-07-23 Thread Joe Jevnik


Change by Joe Jevnik :


--
pull_requests: +7946

___
Python tracker 

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



[issue23927] getargs.c skipitem() doesn't skip 'w*'

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



[issue15127] Supressing warnings with -w "whether gcc supports ParseTuple"

2018-07-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This code was removed in f6b687fcd4d62e53443e23376dc02c177fecc0d4.

--
nosy: +serhiy.storchaka
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



[issue30863] Rewrite PyUnicode_AsWideChar() and PyUnicode_AsWideCharString()

2018-07-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Victor already wrote similar patch in issue16254.

--

___
Python tracker 

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



[issue30863] Rewrite PyUnicode_AsWideChar() and PyUnicode_AsWideCharString()

2018-07-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue30863] Rewrite PyUnicode_AsWideChar() and PyUnicode_AsWideCharString()

2018-07-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Victor already wrote similar patch in issue22323.

--

___
Python tracker 

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



[issue22323] Rewrite PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(): don't cache the result

2018-07-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Oh, I have reimplemented this in issue30863.

--

___
Python tracker 

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



[issue34184] Lib/test/test_dataclasses.py failed when ran as a script

2018-07-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 3fe5cccb08283f5f4817ac432560972a4c0f5290 by Serhiy Storchaka in 
branch 'master':
bpo-34184: Fix running Lib/test/test_dataclasses.py as a script. (GH-8382)
https://github.com/python/cpython/commit/3fe5cccb08283f5f4817ac432560972a4c0f5290


--

___
Python tracker 

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



  1   2   >