[issue33935] shutil.copyfile throws incorrect SameFileError on Google Drive File Stream

2018-06-21 Thread Deniz Bozyigit


Deniz Bozyigit  added the comment:

Hi, thank you for looking into this. I'm aware that the shown patch is not the 
ideal solution and a mere fix to get my jupyter operational. 

An indication on a workable solution could be the _samefile function in shutil 
that wraps os.path.samefile:

def _samefile(src, dst):
# Macintosh, Unix.
if hasattr(os.path, 'samefile'):
try:
return os.path.samefile(src, dst)
except OSError:
return False

# All other platforms: check for same pathname.
return (os.path.normcase(os.path.abspath(src)) ==
os.path.normcase(os.path.abspath(dst)))


I understand that the implicit platform differentiation that is done here (see 
the comment line) is not valid anymore since os.path.samefile is now available 
on windows systems. It seems that for a windows system the here implemented 
file name comparison could be workable (even moving it into os.path.samefile?), 
if the platform is identified correctly.

--

___
Python tracker 

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



[issue33876] doc Mention relevant pythonesque implementations

2018-06-21 Thread Mariatta Wijaya


Mariatta Wijaya  added the comment:

Thanks for the PR, and thanks everyone for the feedback.

But I don't think we should be the one maintaining a list of all available 
alternative Python implementation out there.

There is already a good list: 
https://wiki.python.org/moin/PythonImplementations which is the top result when 
people search for "Python implementation".

I'm inclined to close this issue.

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



[issue33936] OPENSSL_VERSION_1_1 never defined in _hashopenssl.c

2018-06-21 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue33905] IDLE: Test stackbrowser.Stackbrowser

2018-06-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

(My initial messages contained a mistaken idea based on a mis-remembering the 
details sys.last values and exceptions.)

If an exception is not caught and a traceback is printed, sys.last_type, 
sys.last_value, and sys.last_traceback are set.  When an exception is caught, 
the last_ x values are not touched, but the same are available by calling 
sys.exc_info.  Stackview accessed all 3 sys.last_x values, but they are not 
normally set when testing because exception are caught.  The test sets them 
from a sys.exc_info after catching an exception.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: IDLE: stackbrowser.Stackbrowser should accept exception. -> IDLE: Test 
stackbrowser.Stackbrowser
type: behavior -> enhancement

___
Python tracker 

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



[issue33936] OPENSSL_VERSION_1_1 never defined in _hashopenssl.c

2018-06-21 Thread Quentin Minster


New submission from Quentin Minster :

I'm getting a compile error in Modules/_hashopenssl.c because the file uses 
some pre-1.1.0 APIs even though I'm running OpenSSL 1.1.0.

This is because this file doesn't define the OPENSSL_VERSION_1_1 macro, like 
Modules/_ssl.c does.

--
components: Extension Modules
messages: 320207
nosy: laomaiweng
priority: normal
severity: normal
status: open
title: OPENSSL_VERSION_1_1 never defined in _hashopenssl.c
type: compile error

___
Python tracker 

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



[issue33905] IDLE: stackbrowser.Stackbrowser should accept exception.

2018-06-21 Thread miss-islington


miss-islington  added the comment:


New changeset d554414d981a8bfe38cc5df5751bc3efcb0c36c3 by Miss Islington (bot) 
in branch '3.7':
bpo-33905: Add test for idlelib.stackview.StackBrowser. (GH-7852)
https://github.com/python/cpython/commit/d554414d981a8bfe38cc5df5751bc3efcb0c36c3


--
nosy: +miss-islington

___
Python tracker 

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



[issue33905] IDLE: stackbrowser.Stackbrowser should accept exception.

2018-06-21 Thread miss-islington


miss-islington  added the comment:


New changeset a0622f1071164bc67a307cfec1173c295901c4b9 by Miss Islington (bot) 
in branch '3.6':
bpo-33905: Add test for idlelib.stackview.StackBrowser. (GH-7852)
https://github.com/python/cpython/commit/a0622f1071164bc67a307cfec1173c295901c4b9


--

___
Python tracker 

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



[issue33935] shutil.copyfile throws incorrect SameFileError on Google Drive File Stream

2018-06-21 Thread R. David Murray


R. David Murray  added the comment:

OK.  Finding a solution for this (other than never raising samefile on such 
systems and documenting it as a limitation) may be difficult.

--

___
Python tracker 

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



[issue33905] IDLE: stackbrowser.Stackbrowser should accept exception.

2018-06-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7465

___
Python tracker 

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



[issue33905] IDLE: stackbrowser.Stackbrowser should accept exception.

2018-06-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7464

___
Python tracker 

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



[issue33905] IDLE: stackbrowser.Stackbrowser should accept exception.

2018-06-21 Thread Terry J. Reedy


New submission from Terry J. Reedy :


New changeset bcd3a1a18d841338f57c39f6a7de8cf14d0c3e03 by Terry Jan Reedy in 
branch 'master':
bpo-33905: Add test for idlelib.stackview.StackBrowser. (GH-7852)
https://github.com/python/cpython/commit/bcd3a1a18d841338f57c39f6a7de8cf14d0c3e03


--

___
Python tracker 

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



[issue33935] shutil.copyfile throws incorrect SameFileError on Google Drive File Stream

2018-06-21 Thread Eryk Sun


Eryk Sun  added the comment:

David, this is a bug in Python, and the proposed patch is insufficient. We use 
the volume serial number as st_dev, and this is not guaranteed to be unique in 
Windows, and may be 0, just as a file's index number is also allowed to be 0. 
Both possibilities are well documented. With a WebDAV volume you will find that 
both numbers are 0. Using the VSN and file index as if they're the same as 
POSIX st_dev and st_ino is technically wrong. There is no guarantee that this 
tuple uniquely identifies a file in Windows.

--
nosy: +eryksun

___
Python tracker 

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



[issue33935] shutil.copyfile throws incorrect SameFileError on Google Drive File Stream

2018-06-21 Thread R. David Murray


R. David Murray  added the comment:

That patch would cause references to the same file on a google drive to report 
that the files were different.

I'd say this is a bug in Google Drive's posix emulation.

I'm not sure there's a good answer here, because even if every other element of 
the stat were equal, that wouldn't mean it was the same file: if you use 
copystat as well as copyfile the stats would otherwise be equal.

I think we should close this as a third party bug.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue26440] tarfile._FileInFile.seekable is broken in stream mode

2018-06-21 Thread Charmander


Change by Charmander <~@charmander.me>:


--
nosy: +charmander

___
Python tracker 

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



[issue33905] IDLE: stackbrowser.Stackbrowser should accept exception.

2018-06-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +7463
stage: test needed -> patch review

___
Python tracker 

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



[issue1617161] Instance methods compare equal when their self's are equal

2018-06-21 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

If [].append == [].append is True in the "unique set of callbacks" scenario, 
that implies that it's perfectly fine to not call one of them when both are 
registered. But this means that only one list ends up getting updated, when you 
tried to register both for updates. That's definitely surprising, and not in a 
good way.

--
nosy: +josh.r

___
Python tracker 

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



[issue33935] shutil.copyfile throws incorrect SameFileError on Google Drive File Stream

2018-06-21 Thread Deniz Bozyigit


Change by Deniz Bozyigit :


--
title: shutil.copyfile throws incorrect SameFileError -> shutil.copyfile throws 
incorrect SameFileError on Google Drive File Stream

___
Python tracker 

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



[issue33935] shutil.copyfile throws incorrect SameFileError

2018-06-21 Thread Deniz Bozyigit


New submission from Deniz Bozyigit :

When using shutil.copyfile on the Google Drive File Stream file system, a 
incorrect SameFileError can occur. 

MWE (assuming foo.txt exists in your google drive G:\\):
>>> f1 = 'G:\\My Drive\\foo.txt'
>>> f2 = 'G:\\My Drive\\foo2.txt'
>>> import shutil
>>> shutil.copyfile(f1, f2)
>>> shutil.copyfile(f1, f2)

--> Last line throws incorrect SameFileError. In comparison, executing the same 
code on a different file system (e.g. local hard drive) will result in no 
errors.

More details described here: https://github.com/jupyter/notebook/issues/3615

The error originates in the library in generalpath.py in the function samestat: 
Google Drive File Stream reports inode==0 which makes os.path.samefile(f1, f2) 
== True for any files f1 and f2 on Google File Stream.

I propose the following patch, which currently works for me:

--- genericpath.py  2018-06-22 02:14:27.145744900 +0200
+++ genericpath_new.py  2018-06-22 02:10:44.485961100 +0200
@@ -86,8 +86,11 @@
 # describing the same file?
 def samestat(s1, s2):
 """Test whether two stat buffers reference the same file"""
-return (s1.st_ino == s2.st_ino and
-s1.st_dev == s2.st_dev)
+return (s1.st_ino != 0 and
+   s2.st_ino != 0 and
+   s1.st_ino == s2.st_ino and
+s1.st_dev == s2.st_dev)
+


 # Are two filenames really pointing to the same file?

--
components: Library (Lib), Windows
messages: 320199
nosy: Deniz Bozyigit, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: shutil.copyfile throws incorrect SameFileError
type: crash
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue33919] Expose _PyCoreConfig structure to Python

2018-06-21 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

I think the basic implementation problem is that by the time you get to 
get_hash_info() in sysmodule.c, you no longer have access to the _PyCoreConfig 
object, nor the _PyMain object that it's generally attached to.

--

___
Python tracker 

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



[issue33905] IDLE: stackbrowser.Stackbrowser should accept exception.

2018-06-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


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

___
Python tracker 

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



[issue33905] IDLE: stackbrowser.Stackbrowser should accept exception.

2018-06-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


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

___
Python tracker 

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



[issue33460] ... used to indicate many different things in chapter 3, some are confusing

2018-06-21 Thread Lew Kurtz


Change by Lew Kurtz :


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

___
Python tracker 

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



[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-06-21 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue1617161] Instance methods compare equal when their self's are equal

2018-06-21 Thread Armin Rigo


Change by Armin Rigo :


--
nosy:  -arigo

___
Python tracker 

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



[issue33922] Enforce 64bit Python by Launcher

2018-06-21 Thread Robert


Robert  added the comment:

I extended the documentation and created a pullrequest:

https://github.com/python/cpython/pull/7849

--

___
Python tracker 

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



[issue33922] Enforce 64bit Python by Launcher

2018-06-21 Thread Robert


Change by Robert :


--
pull_requests: +7459

___
Python tracker 

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



[issue30291] Allow windows launcher to specify bit lengths with & without minor version

2018-06-21 Thread Robert


Change by Robert :


--
pull_requests: +7460

___
Python tracker 

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



[issue1617161] Instance methods compare equal when their self's are equal

2018-06-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue33897] Add a restart option to logging.basicConfig()

2018-06-21 Thread Dong-hee Na


Dong-hee Na  added the comment:

Can I take a look at this issue?

One question, if we pass the restart keyword as true, should we clear all 
handlers before we call basicConfig?, or should we maintain it?

--
nosy: +corona10

___
Python tracker 

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



[issue33912] [EASY] test_warnings: test_exec_filename() fails when run with -Werror

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

Thank you Christopher Frederickson for your contribution! I merged your PR. I 
confirm that it fixes the issue.

Thanks Thomas Kluyver for the hints ;-)

--

___
Python tracker 

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



[issue33912] [EASY] test_warnings: test_exec_filename() fails when run with -Werror

2018-06-21 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue33912] [EASY] test_warnings: test_exec_filename() fails when run with -Werror

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 419e88d18ccc83e182afca124d42f46794022aab by Victor Stinner 
(Christopher Frederickson) in branch 'master':
bpo-33912: Fix test_warnings when run with -Werror (GH-7839)
https://github.com/python/cpython/commit/419e88d18ccc83e182afca124d42f46794022aab


--

___
Python tracker 

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



[issue33928] _Py_DecodeUTF8Ex() creates surrogate pairs on Windows

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

> I don't see anything wrong.

I write a C function to test _Py_DecodeUTF8Ex():

* surrogateescape=0 fails with a decoding error as expected
* surrogateescape=1 escapes the bytes as expected as: '\udced\udcb2\udc80'

Ok, I just misunderstood the code: the decoder is fine!

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



[issue33934] locale.getlocale() seems wrong when the locale is yet unset (python3 on linux)

2018-06-21 Thread Nicolas Hainaux


New submission from Nicolas Hainaux :

Expected behaviour:

When unset, the locale in use is `C` (as stated in python documentation) and 
`locale.getlocale()` returns  `(None, None)` on Linux with python2.7 or on 
Windows with python2.7 and python 3.6 (at least):


$ python2
Python 2.7.15 (default, May  1 2018, 20:16:04) 
[GCC 7.3.1 20180406] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.getlocale()
(None, None)
>>> 


Issue:

But when using python3.4+ on Linux, instead of `(None, None)`, 
`locale.getlocale()` returns the same value as `locale.getdefaultlocale()`:


$ python
Python 3.6.3 (default, Oct 24 2017, 14:48:20) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.getlocale()
('fr_FR', 'UTF-8')
>>> locale.localeconv()
{'int_curr_symbol': '', 'currency_symbol': '', 'mon_decimal_point': '', 
'mon_thousands_sep': '', 'mon_grouping': [], 'positive_sign': '', 
'negative_sign': '', 'int_frac_digits': 127, 'frac_digits': 127, 
'p_cs_precedes': 127, 'p_sep_by_space': 127, 'n_cs_precedes': 127, 
'n_sep_by_space': 127, 'p_sign_posn': 127, 'n_sign_posn': 127, 'decimal_point': 
'.', 'thousands_sep': '', 'grouping': []}
>>> locale.str(2.5)
'2.5'


Though the locale actually in use is still `C` (as shown above by the output of 
`locale.localeconv()` and confirmed by the result of `locale.str(2.5)`, which 
shows a dot as decimal point and not a comma (as expected with `fr_FR.UTF-8`)).

I could observe this confusing behaviour on Linux with python3.4, 3.5, 3.6 and 
3.7 (rc1). (Also on FreeBSD with python3.6.1).

A problematic consequence of this behaviour is that it becomes impossible to 
detect whether the locale has already been set by the user, or not.

I could not find any other similar issue and hope this is not a duplicate.

--
components: Library (Lib)
messages: 320192
nosy: zezollo
priority: normal
severity: normal
status: open
title: locale.getlocale() seems wrong when the locale is yet unset (python3 on 
linux)
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2018-06-21 Thread Farhaan Bukhsh


Farhaan Bukhsh  added the comment:

Hahah! Let me try to put this on the IRC channel may be someone can help us 
there.

--

___
Python tracker 

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



[issue31530] CVE-2018-1000030: Python 2.7 readahead feature of file objects is not thread safe

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

I added this issue to my python-security page since the issue got a CVE number: 
CVE-2018-130

* 
http://python-security.readthedocs.io/vuln/cve-2018-130_python_2.7_readahead_is_not_thread_safe.html
* https://access.redhat.com/security/cve/cve-2018-130

--
title: Python 2.7 readahead feature of file objects is not thread safe -> 
CVE-2018-130: Python 2.7 readahead feature of file objects is not thread 
safe
type:  -> security

___
Python tracker 

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



[issue31530] Python 2.7 readahead feature of file objects is not thread safe

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

This bug has been fixed in Python 2.7.15.

--

___
Python tracker 

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



[issue33855] IDLE: Minimally test every non-startup module.

2018-06-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.8 -Python 3.5

___
Python tracker 

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



[issue33855] IDLE: Minimally test every non-startup module.

2018-06-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue33855] IDLE: Minimally test every non-startup module.

2018-06-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> fixed
stage: test needed -> resolved
status: open -> closed
versions: +Python 2.7, Python 3.5 -Python 3.8

___
Python tracker 

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



[issue33911] [EASY] test_docxmlrpc fails when run with -Werror

2018-06-21 Thread Nicolas Noé

Change by Nicolas Noé :


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

___
Python tracker 

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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-06-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I agree that error messages sometimes is misleading if use the C API.

PR 7846 fixes this, although I'm not sure this is the best wording.

--
assignee: docs@python -> serhiy.storchaka
components: +Interpreter Core
resolution: fixed -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-06-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +7456

___
Python tracker 

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



[issue33911] [EASY] test_docxmlrpc fails when run with -Werror

2018-06-21 Thread Nicolas Noé

Nicolas Noé  added the comment:

I'm willing to try solving this!

--
nosy: +niconoe

___
Python tracker 

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



[issue33931] Building 2.7 on Windows with PC\VS9.0 is broken

2018-06-21 Thread Zachary Ware


Zachary Ware  added the comment:

Thanks, Anselm!  I'll leave this open until our VS9 buildbots [1] confirm that 
they're happy with it, but I suspect since they weren't broken before they 
won't be affected by this anyway.

[1] http://buildbot.python.org/all/#/builders?tags=%2Bvs9

--
assignee: christian.heimes -> zach.ware
resolution:  -> fixed
status: open -> pending

___
Python tracker 

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



[issue33931] Building 2.7 on Windows with PC\VS9.0 is broken

2018-06-21 Thread Zachary Ware


Zachary Ware  added the comment:


New changeset 7b383a57145046a6a6ad6cd26f3139163df07885 by Zachary Ware (Anselm 
Kruis) in branch '2.7':
bpo-33931: Fix building using PC\VS9.0\build.bat -e (GH-7844)
https://github.com/python/cpython/commit/7b383a57145046a6a6ad6cd26f3139163df07885


--

___
Python tracker 

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



[issue33932] Calling Py_Initialize() twice now triggers a fatal error (Python 3.7)

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

Note: the doc doesn't say that the function must only be called once, nor 
document the (current) new Python 3.7 restriction (must only be called once):
https://docs.python.org/dev/c-api/init.html#c.Py_Initialize

--

___
Python tracker 

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



[issue33932] Calling Py_Initialize() twice now triggers a fatal error (Python 3.7)

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

Attached PR 7845 restores the Python 3.6 behaviour: calling Py_Initialize() 
twice does nothing.

--

___
Python tracker 

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



[issue33932] Calling Py_Initialize() twice now triggers a fatal error (Python 3.7)

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

The behaviour changed has been introduced by bpo-22257:

commit 1abcf6700b4da6207fe859de40c6c1bada6b4fec
Author: Eric Snow 
Date:   Tue May 23 21:46:51 2017 -0700

bpo-22257: Private C-API for core runtime initialization (PEP 432). (#1772)

(patch by Nick Coghlan)

Simplified change:

-if (initialized)
-return;
-initialized = 1;

+if (_Py_Initialized) {
+Py_FatalError("Py_InitializeCore: main interpreter already 
initialized");
+}

--
components: +Interpreter Core -Documentation

___
Python tracker 

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



[issue33925] builtin_function_or_method compares __self__ by identity instead of equality

2018-06-21 Thread R. David Murray


R. David Murray  added the comment:

This is still a duplicate issue, though, you are just arguing for a different 
resolution of the other one :)

--
nosy: +r.david.murray

___
Python tracker 

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



[issue33932] Calling Py_Initialize() twice now triggers a fatal error (Python 3.7)

2018-06-21 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue33932] Calling Py_Initialize() twice now triggers a fatal error (Python 3.7)

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

I set the priority to release blocker to make sure that someone looks at this 
issue, even if I'm not sure that it's a huge regression.

--
priority: normal -> release blocker

___
Python tracker 

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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-06-21 Thread Vedran Čačić

Vedran Čačić  added the comment:

Sure, here it is: https://bugs.python.org/issue33933

--

___
Python tracker 

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



[issue33933] Error message says dict has no len

2018-06-21 Thread Vedran Čačić

New submission from Vedran Čačić :

Look at this:

>>> import bisect
>>> bisect.bisect({}, None)
Traceback (most recent call last):
  File "", line 1, in 
bisect.bisect({}, None)
TypeError: object of type 'dict' has no len()

Of course, objects of type 'dict' do have len. The problem is that bisect 
considers its first argument a sequence, which is very sensible to do 
(although, with ordered dicts, it's not the only sensible choice), but it gives 
a very wrong error message given that context.

At https://bugs.python.org/issue32500, R. David Murray told me to open this.

--
components: Interpreter Core
messages: 320178
nosy: veky
priority: normal
severity: normal
status: open
title: Error message says dict has no len
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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-06-21 Thread R. David Murray


R. David Murray  added the comment:

IIUC that error message came from pypy, not CPython.  If you have a reproducer 
for CPython, you can open a new issue with a request to fix the error message.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue33931] Building 2.7 on Windows with PC\VS9.0 is broken

2018-06-21 Thread Anselm Kruis


Change by Anselm Kruis :


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

___
Python tracker 

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



[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2018-06-21 Thread R. David Murray


R. David Murray  added the comment:

I think we should get one or more of the core devs who were involved in the 
changes that added that parameter to sign off on whether this is a good idea or 
not (I have no opinion at the moment).  You should be able to find them via git 
blame and looking at the issues related to the changesets you find.  Unless 
someone who remembers comes along and just adds them to nosy :)

--
nosy: +r.david.murray
type:  -> enhancement
versions:  -Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue33932] Calling Py_Initialize() twice now triggers a fatal error (Python 3.7)

2018-06-21 Thread STINNER Victor

New submission from STINNER Victor :

It would help to document that calling Py_Initialize() twice in Python 3.7 now 
triggers a fatal error, whereas previous the second call did nothing. Document 
it at:
https://docs.python.org/dev/whatsnew/3.7.html#changes-in-the-c-api

... Or should it be considered as a regression?

--

My colleague Miro Hrončok reported a Python crash (SIGABRT) when running 
https://github.com/konlpy/konlpy test suite on Python 3.7:

"Fatal Python error: _Py_InitializeCore: main interpreter already initialized"

konlpy uses the JPype project, the bug is in JPype initialization function 
(it's a C extension):

* https://github.com/originell/jpype/issues/331
* https://github.com/originell/jpype/pull/332

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 320175
nosy: docs@python, eric.snow, ncoghlan, ned.deily, vstinner
priority: normal
severity: normal
status: open
title: Calling Py_Initialize() twice now triggers a fatal error (Python 3.7)
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



[issue33903] Can't use lib2to3 with embeddable zip file

2018-06-21 Thread Steve Dower


Steve Dower  added the comment:

There's a command to generate that file though I forget what it is. The 
embeddable distro does not support installation, though it may work sometimes 
(it's still the same Python binaries).

Try going to nuget.org, search for Python and install one of those packages 
(there should be instructions on the site). Alternatively, I think the 
WinPython distro has a non-installed version that you may be able to use.

--

___
Python tracker 

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



[issue33927] Allow json.tool to have identical infile and outfile

2018-06-21 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Michael, looking at the current code of json.tool, there is no reason for it 
not to be able to do this, I will a patch to do this tonight.

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue33931] Building 2.7 on Windows with PC\VS9.0 is broken

2018-06-21 Thread Anselm Kruis


New submission from Anselm Kruis :

Currently 2.7 fails to build on Win32 using PC\VS90\build.bat -e for two 
reasons:

1. Wrong openssl version: PC\VS9.0 is still at version 1.0.2k, whereas 
PCbuild/get_externals.bat downloads version 1.0.2o.

2. Building tcl fails with well known "nmakehlp" not found problem. It is 
caused by the following line in PC\VS90\build.bat: "nmake -f makefile.vc 
MACHINE=%machine% DEBUG=%debug_flag% INSTALLDIR="%tcltkdir%" clean all". 
Separate invocations of nmake for "clean" and "all" fix the problem.

I'll provide a pull request for both issues. I hope it is OK to make just a 
single PR, because the changes are trivial.


Relevant output from PC\VS90\build.bat:

Setting environment for using Microsoft Visual Studio 2008 x86 tools.

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

===
*** Compiler has 'Optimizations'
*** Compiler does not have 'Pentium 0x0f fix'
*** Linker has 'Win98 alignment problem'
*** Intermediate directory will be '.\Release_VC9\tcl_Dynamic'
*** Output directory will be '.\Release_VC9'
*** Suffix for binaries will be ''
*** Optional defines are '-DTCL_CFGVAL_ENCODING=\"cp1252\" -DSTDC_HEADERS 
-DNDEBUG -DTCL_CFG_OPTIMIZED'
*** Compiler version 9. Target machine is IX86
*** Host architecture is AMD64
*** Compiler options '-W3  -Ot -Oi -fp:strict -Gs -GS -GL  -RTC1 -W3'
*** Link options '-ltcg'
*** Dependency rules are not being used.

Cleaning .\Release_VC9\tcl_Dynamic\* ...
Cleaning ..\win\nmakehlp.obj ...
Cleaning ..\win\nmakehlp.exe ...
Cleaning ..\win\_junk.pch ...
Cleaning ..\win\vercl.x ...
Cleaning ..\win\vercl.i ...
Cleaning ..\win\versions.vc ...
cl -nologo -c -W3 -W3 -D _CRT_SECURE_NO_DEPRECATE -D 
_CRT_NONSTDC_NO_DEPRECATE -Fp.\Release_VC9\tcl_Dynamic\ -O2  -Ot -Oi -fp:strict 
-Gs -GS -GL -MD -I"
..\win" -I"..\generic" -I"..\libtommath" -DTCL_PIPE_DLL=\"tclpip85.dll\" 
-DTCL_TOMMATH -DMP_PREC=4 -Dinline=__inline -DTCL_CFGVAL_ENCODING=\"cp1252\" 
-DSTDC_HEA
DERS -DNDEBUG -DTCL_CFG_OPTIMIZED  -DTCL_USE_STATIC_PACKAGES=0  
-Fo.\Release_VC9\tcl_Dynamic\tclAppInit.obj ..\win\tclAppInit.c
tclAppInit.c
Der Befehl "nmakehlp" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
NMAKE : fatal error U1077: 'nmakehlp' : return code '0x1'
Stop.

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

===
*** Compiler has 'Optimizations'
*** Compiler does not have 'Pentium 0x0f fix'
*** Linker has 'Win98 alignment problem'
*** Intermediate directory will be '.\Release_VC9\tcl_Dynamic'
*** Output directory will be '.\Release_VC9'
*** Suffix for binaries will be ''
*** Optional defines are '-DTCL_CFGVAL_ENCODING=\"cp1252\" -DSTDC_HEADERS 
-DNDEBUG -DTCL_CFG_OPTIMIZED'
*** Compiler version 9. Target machine is IX86
*** Host architecture is AMD64
*** Compiler options '-W3  -Ot -Oi -fp:strict -Gs -GS -GL  -RTC1 -W3'
*** Link options '-ltcg'
*** Dependency rules are not being used.

Installing to 'D:\kruis_F\fg2\stackless\python\PC\VS9.0\..\..\externals\tcltk'
Installing tcl85.dll
Datei tcl85.dll nicht gefunden
NMAKE : fatal error U1077: 'xcopy' : return code '0x4'
Stop.

--
assignee: christian.heimes
components: SSL, Tkinter
messages: 320172
nosy: anselm.kruis, christian.heimes, steve.dower, zach.ware
priority: normal
severity: normal
status: open
title: Building 2.7 on Windows with PC\VS9.0 is broken
type: compile error
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



[issue33462] reversible dict

2018-06-21 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi, is everything good with attached PR or should I refactor it further?

--

___
Python tracker 

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



[issue33928] _Py_DecodeUTF8Ex() creates surrogate pairs on Windows

2018-06-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I don't see anything wrong.

--

___
Python tracker 

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



[issue33716] test_concurrent_futures.test_crash() failed on x86 Windows7 3.7

2018-06-21 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 3ad8decd76c736f393755537aeb19b5612c21761 by Pablo Galindo in 
branch 'master':
bpo-33716, test_concurrent_futures: increase timeout (GH-7828)
https://github.com/python/cpython/commit/3ad8decd76c736f393755537aeb19b5612c21761


--
nosy: +pablogsal

___
Python tracker 

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



[issue1617161] Instance methods compare equal when their self's are equal

2018-06-21 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

I just posted to python-dev about this issue:

https://mail.python.org/pipermail/python-dev/2018-June/153959.html

However, I think that comparing using "==" is the right thing to do. So I think 
that

>>> [].append == [].append
False

should really return True.

--
nosy: +jdemeyer

___
Python tracker 

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



[issue33930] Segfault with deep recursion into object().__dir__

2018-06-21 Thread Alistair Buxton


New submission from Alistair Buxton :

The following small snippet of code will crash 3.6.5 with a segfault.

The crash occurs at cleanup, so it won't happen in the interactive interpreter 
(until you exit).


# --- code ---

o = object()
for x in range(100):
o = o.__dir__
print(x, id(o.__dir__))

# --- end code ---

--
components: Interpreter Core
messages: 320167
nosy: a-j-buxton
priority: normal
severity: normal
status: open
title: Segfault with deep recursion into object().__dir__
type: crash
versions: Python 3.6

___
Python tracker 

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



[issue33925] builtin_function_or_method compares __self__ by identity instead of equality

2018-06-21 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> This is a duplicate of issue1617161.

Well, it's really the opposite. That issue seems to be arguing that __self__ 
should be compared using "is" while I think it should be compared using "==".

--

___
Python tracker 

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



[issue33921] Explain that '' can be used to bind to all interfaces for the AF_INET address family in the docs

2018-06-21 Thread John Hagen


John Hagen  added the comment:

@ammar2

I see that now. Yeah it's further down in the docs and doesn't actually call 
out '' like is done for AF_CAN:

A tuple (interface, ) is used for the AF_CAN address family, where interface is 
a string representing a network interface name like 'can0'. The network 
interface name '' can be used to receive packets from all network interfaces of 
this family.

Ideally I think putting something in this section would be helpful:

A pair (host, port) is used for the AF_INET address family, where host is a 
string representing either a hostname in Internet domain notation like 
'daring.cwi.nl' or an IPv4 address like '100.50.200.5', and port is an integer.

--

___
Python tracker 

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



[issue32942] test_script_helper fails on Windows when run from the source code directory

2018-06-21 Thread STINNER Victor


Change by STINNER Victor :


--
title: Regression: test_script_helper fails -> test_script_helper fails on 
Windows when run from the source code directory

___
Python tracker 

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



[issue32942] Regression: test_script_helper fails

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

I confirm that I reproduce the issue on Windows when running "python -m test 
test_script_helper -v" from the source code directory, on 3.6, 3.7 and master 
branches.

Using Python 3.6 installed on the system (using python.org installer), the same 
command pass.

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



[issue33928] _Py_DecodeUTF8Ex() creates surrogate pairs on Windows

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

> Could you show an example please?

I saw an issue when reading the code, I didn't try to trigger the issue using 
real code yet.

--

___
Python tracker 

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



[issue33735] test_multiprocessing_spawn leaked [1, 2, 1] memory blocks on AMD64 Windows8.1 Refleaks 3.7

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

I just created bpo-33929: "test_multiprocessing_spawn: 
WithProcessesTestProcess.test_many_processes() leaks 5 handles on Windows". See 
also my PR 7827.

--

___
Python tracker 

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



[issue33914] test_gdb fails for Python 2.7.15

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

Vibhuti: Hi! Would you mind to describe your environment? What is your 
operating system (name, version)? Are you running test_gdb as root or as your 
normal user? How did you install Python?

Note: I recently backported python-gdb.py a few enhancements from master to 
2.7: commit e36f94f204f3257a206a7766464a94230337fd18.

--
nosy: +vstinner

___
Python tracker 

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



[issue33929] test_multiprocessing_spawn: WithProcessesTestProcess.test_many_processes() leaks 5 handles on Windows

2018-06-21 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_multiprocessing_spawn leaks 5 handles -> 
test_multiprocessing_spawn: WithProcessesTestProcess.test_many_processes() 
leaks 5 handles on Windows

___
Python tracker 

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



[issue33929] test_multiprocessing_spawn leaks 5 handles

2018-06-21 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +davin, pitrou

___
Python tracker 

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



[issue32555] Encoding issues with the locale encoding

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

freebsd$ LC_ALL=fr_FR.ISO8859-1 ./python -c 'import locale, os; 
locale.setlocale(locale.LC_ALL, ""); print(ascii(os.strerror(2)))'
'Fichier ou r\xe9pertoire inexistant'

I ran manually this test on FreeBSD: it pass on Python 3.6, 3.7 and master. I 
close the issue.


> Another issue: _Py_DecodeUTF8Ex() creates surrogate pairs with 16-bit wchar_t 
> (on Windows), whereas input bytes should be escaped. I'm quite sure that it's 
> a bug.

I created bpo-33928 for that one.

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



[issue33929] test_multiprocessing_spawn leaks 5 handles

2018-06-21 Thread STINNER Victor


New submission from STINNER Victor :

The following test leaks 5 open handles when checking for leaks using my PR 
7827:

test.test_multiprocessing_spawn.WithProcessesTestProcess.test_many_processes

Command to reproduce the leak (using my PR 7827):

python -m test -R 3:3 test_multiprocessing_spawn -m 
test.test_multiprocessing_spawn.WithProcessesTestProcess.test_many_processes

--
components: Library (Lib)
messages: 320160
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_multiprocessing_spawn leaks 5 handles
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



[issue33928] _Py_DecodeUTF8Ex() creates surrogate pairs on Windows

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

Extract of _Py_DecodeUTF8Ex() code, there is an explicit "write a surrogate 
pair" comment:

#if SIZEOF_WCHAR_T == 4
ch = ucs4lib_utf8_decode(&s, e, (Py_UCS4 *)unicode, &outpos);
#else
ch = ucs2lib_utf8_decode(&s, e, (Py_UCS2 *)unicode, &outpos);
#endif
if (ch > 0xFF) {
#if SIZEOF_WCHAR_T == 4
Py_UNREACHABLE();
#else
assert(ch > 0x && ch <= MAX_UNICODE);
/* write a surrogate pair */
unicode[outpos++] = (wchar_t)Py_UNICODE_HIGH_SURROGATE(ch);
unicode[outpos++] = (wchar_t)Py_UNICODE_LOW_SURROGATE(ch);
#endif
}

--

___
Python tracker 

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



[issue33921] Explain that '' can be used to bind to all interfaces for the AF_INET address family in the docs

2018-06-21 Thread Ammar Askar


Ammar Askar  added the comment:

It's kinda mentioned:

"For IPv4 addresses, two special forms are accepted instead of a host address: 
the empty string represents INADDR_ANY"

Though it could be more explicit on what means since binding to all interfaces 
is a common use case.

--
nosy: +ammar2

___
Python tracker 

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



[issue33928] _Py_DecodeUTF8Ex() creates surrogate pairs on Windows

2018-06-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Could you show an example please?

--

___
Python tracker 

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



[issue32710] test_asyncio leaked [4, 4, 3] memory blocks, sum=11 on AMD64 Windows8.1 Refleaks 3.x

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, I found again this bug while working on my PR 7827 (detect handle leaks on 
Windows in regrtest).

--

___
Python tracker 

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



[issue33925] builtin_function_or_method compares __self__ by identity instead of equality

2018-06-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is a duplicate of issue1617161.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Instance methods compare equal when their self's are equal

___
Python tracker 

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



[issue33928] _Py_DecodeUTF8Ex() creates surrogate pairs on Windows

2018-06-21 Thread STINNER Victor


New submission from STINNER Victor :

_Py_DecodeUTF8Ex() creates surrogate pairs with 16-bit wchar_t (on Windows), 
whereas input bytes should be escaped. I'm quite sure that it's a bug.

--
components: Interpreter Core
messages: 320154
nosy: serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: _Py_DecodeUTF8Ex() creates surrogate pairs on Windows
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



[issue33927] Allow json.tool to have identical infile and outfile

2018-06-21 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

yep, or you could use sponge

cat example.json | python3 -m json.tool | sponge example.json

a small workaround ;-)

--
nosy: +matrixise

___
Python tracker 

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



[issue33927] Allow json.tool to have identical infile and outfile

2018-06-21 Thread Michael Kuhlmann


New submission from Michael Kuhlmann :

It would be nice to have same infile and outfile for json.tool to replace json 
files with their pretty-printed version.

Currently, if I try this I get an error:
$ python3 -m json.tool example.json example.json
Expecting value: line 1 column 1 (char 0)

--
messages: 320151
nosy: kuhlmann
priority: normal
severity: normal
status: open
title: Allow json.tool to have identical infile and outfile
type: behavior

___
Python tracker 

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



[issue33926] test_gdb is skipped in builds since gdb is not installed as part of build script

2018-06-21 Thread STINNER Victor


Change by STINNER Victor :


--
components: +Tests
nosy: +zach.ware

___
Python tracker 

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



[issue33926] test_gdb is skipped in builds since gdb is not installed as part of build script

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

While test_gdb is not tested on pre-commit, it's tested by buildbots on 
post-commit.

--
nosy: +vstinner

___
Python tracker 

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



[issue33926] test_gdb is skipped in builds since gdb is not installed as part of build script

2018-06-21 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

I was checking on https://bugs.python.org/issue30345 and 
https://bugs.python.org/issue33914. I looked into Travis and VSTS builds for 
test_gdb. Though python is built with `--with-pydebug` gdb is not installed in 
the builds and hence the test_gdb is skipped. Adding installation of gdb will 
help in making sure test_gdb is run.

# test_gdb skipped : 

* https://travis-ci.org/python/cpython/jobs/394900803#L1532

# After installation of gdb 

My build fails due to urllib errors and trying to install gdb using sudo 
apt-get install gdb on MacOS. The config can be fixed.

test_gdb tests : https://travis-ci.org/tirkarthi/cpython/jobs/394947895#L2501

I am willing to make a PR for Travis but I don't know how VSTS config works to 
test it on VSTS builds with an account.

Thanks

--
components: Build
messages: 320149
nosy: xtreak
priority: normal
severity: normal
status: open
title: test_gdb is skipped in builds since gdb is not installed as part of 
build script
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



[issue33925] builtin_function_or_method compares __self__ by identity instead of equality

2018-06-21 Thread Jeroen Demeyer


New submission from Jeroen Demeyer :

Methods of Python functions compare equal if the functions are equal and if 
__self__ is equal:

>>> class X:
... def __eq__(self, other): return True
... def meth(self): pass
>>> X().meth == X().meth
True

This is because X() == X() even though X() is not X().

For extension types, we get instead:

>>> [].append == [].append
False

This is because comparison is done with "is" instead of "==". This is a 
needless difference.

--
messages: 320148
nosy: jdemeyer
priority: normal
severity: normal
status: open
title: builtin_function_or_method compares __self__ by identity instead of 
equality

___
Python tracker 

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



[issue33716] test_concurrent_futures.test_crash() failed on x86 Windows7 3.7

2018-06-21 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

I don't remember :-/  It's probably ok to increase the timeout, though.

--

___
Python tracker 

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



[issue23224] LZMADecompressor object is only initialized in __init__

2018-06-21 Thread STINNER Victor


STINNER Victor  added the comment:

Calling directly __new__() is very unusual, so I'm not surprised that you found 
bugs. Calling __init__() twice is also an unusal practice. I concur with 
Serhiy: implementing new instead of init should prevent such bug. I recall that 
some objects decided instead to raise an exception if they are not fully 
initialized (if init has not been called), but using new instead of init seems 
to be safer approach if we can implement it.

In the meanwhile, I blocked by the memory leak (handle leak) in bz2 and lzma: 
bpo-33916. I proposed a very simple fix: PR 7843. I propose to apply this one 
since it's easy to backport it to all branches, whereas replacing init with new 
would be more difficult and risky to backport: I would suggest to only make 
this change in the master.

What do you think?

--
nosy: +vstinner

___
Python tracker 

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



[issue33916] test_lzma: test_refleaks_in_decompressor___init__() leaks 100 handles on Windows

2018-06-21 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7453

___
Python tracker 

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



[issue33910] update random.Random 's parameter to have a proper name.

2018-06-21 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

Thanks @rhettinger, this is a perfectly valid position, and one of the respons 
I was expecting.

>  That said, it doesn't seem to have ever caused a problem in practice (this 
> API has been around for a very long time)

I have myself not found a lot of usage of `random.Random(x=123)` though I can't 
say what the lack of occurences is due to. If I have the choice between
  - Random(123)
  - Random(x=123)
  - Random(seed=123)

I definitively find `Random(x=123)` the  least readable. I can guess what 
`Random(123)` means, `Random(seed=123)` is self-explanatory, `Random(x=123)` 
will make me doubt what this means. So you might say no one as reported problem 
because no one is using it...

Yes `x` is explained in the docstring, but that's still requires reading the 
docstring and reaching for it. As some tab completion engine show functions 
signatures I want to argue that good parameter names could thus make a 
difference.

Thanks again for you quick response I'm going to close corresponding PRs.

--

___
Python tracker 

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



[issue33914] test_gdb fails for Python 2.7.15

2018-06-21 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I think it's a problem with user-level permission error not being able to 
create a process (Wild guess to try sudo?). The tests run without error for me. 
Please add in information regarding you environment, gdb version and perhaps 
the whole output of `./python -Werror -m test -v test_gdb`

# Test log

karthi@ubuntu-s-1vcpu-1gb-blr1-01:~/python-build/cpython$ ./python -Werror -m 
test -v test_gdb
== CPython 2.7.15+ (remotes/upstream/2.7:f291888, Jun 21 2018, 09:13:04) [GCC 
5.4.0 20160609]
==   Linux-4.4.0-127-generic-x86_64-with-debian-stretch-sid little-endian
==   /home/karthi/python-build/cpython/build/test_python_13424
== CPU count: 1
Run tests sequentially
0:00:00 load avg: 1.53 [1/1] test_gdb
GDB version 7.11:
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word".
test_NULL_instance_dict (test.test_gdb.PrettyPrintTests)
Ensure that a PyInstanceObject with with a NULL in_dict is handled ... ok
test_NULL_ob_type (test.test_gdb.PrettyPrintTests)
Ensure that a PyObject* with NULL ob_type is handled gracefully ... ok
test_NULL_ptr (test.test_gdb.PrettyPrintTests)
Ensure that a NULL PyObject* is handled gracefully ... ok
test_builtin_function (test.test_gdb.PrettyPrintTests) ... ok
test_builtin_method (test.test_gdb.PrettyPrintTests) ... ok
test_builtins_help (test.test_gdb.PrettyPrintTests)
Ensure that the new-style class _Helper in site.py can be handled ... ok
test_classic_class (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of classic class instances ... ok
test_corrupt_ob_type (test.test_gdb.PrettyPrintTests)
Ensure that a PyObject* with a corrupt ob_type is handled gracefully ... ok
test_corrupt_tp_flags (test.test_gdb.PrettyPrintTests)
Ensure that a PyObject* with a type with corrupt tp_flags is handled ... ok
test_corrupt_tp_name (test.test_gdb.PrettyPrintTests)
Ensure that a PyObject* with a type with corrupt tp_name is handled ... ok
test_dicts (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of dictionaries ... ok
test_exceptions (test.test_gdb.PrettyPrintTests) ... ok
test_frames (test.test_gdb.PrettyPrintTests) ... ok
test_frozensets (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of frozensets ... ok
test_getting_backtrace (test.test_gdb.PrettyPrintTests) ... ok
test_int (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of various "int" values ... ok
test_lists (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of lists ... ok
test_long (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of various "long" values ... ok
test_modern_class (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of new-style class instances ... ok
test_selfreferential_dict (test.test_gdb.PrettyPrintTests)
Ensure that a reference loop involving a dict doesn't lead proxyval ... ok
test_selfreferential_list (test.test_gdb.PrettyPrintTests)
Ensure that a reference loop involving a list doesn't lead proxyval ... ok
test_selfreferential_new_style_instance (test.test_gdb.PrettyPrintTests) ... ok
test_selfreferential_old_style_instance (test.test_gdb.PrettyPrintTests) ... ok
test_sets (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of sets ... ok
test_singletons (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of True, False and None ... ok
test_strings (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of strings ... ok
test_subclassing_list (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of an instance of a list subclass ... ok
test_subclassing_tuple (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of an instance of a tuple subclass ... ok
test_truncation (test.test_gdb.PrettyPrintTests)
Verify that very long output is truncated ... ok
test_tuples (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of tuples ... ok
test_unicode (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of unicode values ... ok
test_basic_command (test.test_gdb.PyListTests)
Verify that the "py-list" command works ... ok
test_one_abs_arg (test.test_gdb.PyListTests)
Verify the "py-list" command with one absolute argument ... ok
test_two_abs_args (test.test_gdb.PyListTests)
Verify the "py-list" command with two absolute arguments ... ok
tes

[issue33903] Can't use lib2to3 with embeddable zip file

2018-06-21 Thread Mickaël S .

Mickaël S.  added the comment:

In my case, on the computer doing releases, I cannot use the full Python 
installer (even with a minimal unattend.xml file) because any software 
installation is prohibited. This is an issue in my side but it is for the 
context.

I was expecting to be able to install modules even with the embeddable Python. 
I do not see that limitation in the docs.

The issue here is that I cannot install a package with no wheel because pip 
requires 'lib2to3\\Grammar3.6.5.final.0.pickle' (even if I am targetting python 
3.6 only). Do you see it as an issue or a desired behavior?

--

___
Python tracker 

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



[issue33894] tempfile.tempdir cannot be unset

2018-06-21 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset b225cb770fb17596298f5a05c41a7c90c470c4f8 by Eric V. Smith (Miss 
Islington (bot)) in branch '3.6':
bpo-33894: Clarified the tempfile.tempdir documentation (GH-7829) (GH-7842)
https://github.com/python/cpython/commit/b225cb770fb17596298f5a05c41a7c90c470c4f8


--

___
Python tracker 

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



[issue33922] Enforce 64bit Python by Launcher

2018-06-21 Thread Robert


Robert  added the comment:

A thanks!

In the meantime I found the corresponding changelog entry:
https://bugs.python.org/issue30291

I checked the corresponding commit:

there is no documentation update. It would be nice if the new feature can be 
found in the documentation (including the fact that -64 is only supported after 
installing python 3.7 or newer)...

--

___
Python tracker 

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



[issue33894] tempfile.tempdir cannot be unset

2018-06-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7452

___
Python tracker 

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



[issue33894] tempfile.tempdir cannot be unset

2018-06-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7451

___
Python tracker 

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



[issue29612] TarFile.extract() suffers from hard links inside tarball

2018-06-21 Thread Joachim Trouverie


Joachim Trouverie  added the comment:

Travis build failed for a reason unrelated to my changes. I relaunched it using 
an empty commit. 

If anyone could validate my changes I would rebase to validate my work.

--

___
Python tracker 

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



  1   2   >