[issue32075] Expose ZipImporter Type Object in the include header files.

2017-11-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

There is a plan of reimplementing zipimport in Python (see issue25711). What 
are you going to do with this?

I think that C extensions should use a common import API.

--
nosy: +brett.cannon, eric.snow, ncoghlan, serhiy.storchaka, twouters

___
Python tracker 

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



[issue32075] Expose ZipImporter Type Object in the include header files.

2017-11-20 Thread Decorater

Decorater  added the comment:

That is true, but Well, I am using this in a project of mine currently where it 
loads up encrypted scripts from a zip file. However I must have the import hook 
itself be in an C extension and subclass the current zipimporter. However 
knowing a rewrite for it is best, I have not experienced any bugs with it so 
far actually.

--

___
Python tracker 

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



[issue32075] Expose ZipImporter Type Object in the include header files.

2017-11-20 Thread Decorater

Decorater  added the comment:

Well since issue25711 might be for 3.7 and newer I guess this patch might 
actually be for 3.6.4 or something then. And then the rewrite would take over 
on 3.7 and newer depending on if the rewrite makes it in to 3.7.

--
versions: +Python 3.6 -Python 3.7, Python 3.8

___
Python tracker 

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



[issue32081] ipaddress should support fast IP lookups

2017-11-20 Thread Attila Nagy

New submission from Attila Nagy :

It would be nice if ipaddress could support fast IP lookups, like this:
https://github.com/jsommers/pytricia

--
components: Library (Lib)
messages: 306535
nosy: Attila Nagy
priority: normal
severity: normal
status: open
title: ipaddress should support fast IP lookups
type: enhancement

___
Python tracker 

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



[issue32075] Expose ZipImporter Type Object in the include header files.

2017-11-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The C API cann't be changed in a bugfix release. Unless for fixing bugs, but 
even in that case we should be very very careful. There is no a bug.

--

___
Python tracker 

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



[issue32082] atexit module: allow getting/setting list of handlers directly

2017-11-20 Thread Erik Bray

New submission from Erik Bray :

In Python 2 it was possible to directly manipulate the list of registered 
atexit handlers through atexit._exithandlers.  Obviously I'm not complaining 
that this went away, as it was an underscored attribute.  But this possibility 
was still useful in the context of testing.

For example, we have a test suite that runs many test cases in subprocesses run 
with multiprocessing.Process.  Since these call os._exit() any atexit handlers 
registered by the code under test are not run.  It's useful, however, to test 
that either

a) Expected atexit handlers ran correctly or
b) No unexpected atexit handlers were registered

To this end we would save and clear atexit._exithandlers, call 
atexit._run_exitfuncs(), then restore the original atexit._exithandlers.

This is not possible on Python 3 since that all lives in the C module state for 
sub-interpreter support.  For the time being it was necessary to work around 
this with a Cython module, but coding around internal extension module 
structures is hardly ideal: 
https://git.sagemath.org/sage.git/diff/src/sage/misc/_context_py3.pyx?id=85b17201255e9919eaa7b5cff367e8bc271c2a3f

I think it would be useful--for testing purposes *only*--to add a 
_get_exitfuncs() function that returns a tuple of the registered handlers, and 
likewise a _set_exitfuncs(handlers) with sets the registered handlers from an 
iterable (the latter being little more than a shortcut for `atexit._clear(); 
for h in handlers: atexit.register(*h)`).

I would propose that these be undocumented internal functions to emphasize that 
they are not how the module should be used in normal circumstances.  At the 
same time it might be worth addressing https://bugs.python.org/issue22867  I 
can provide a patch if this idea is acceptable.

--
components: Library (Lib)
messages: 306537
nosy: erik.bray
priority: normal
severity: normal
status: open
title: atexit module: allow getting/setting list of handlers directly
type: behavior

___
Python tracker 

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



[issue25144] 3.5 Win install fails with "TARGETDIR"

2017-11-20 Thread Per Fryking

Per Fryking  added the comment:

Got the same issue with the 3.6 installer from python.org

The thing is that I can't elevate the priviliges to be administrator. So I'm 
stuck.

Uploading the log. Running windows 7

--
nosy: +Per Fryking
Added file: https://bugs.python.org/file47278/Python 3.6.3 
(32-bit)_20171120135800.log

___
Python tracker 

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



[issue32083] sqlite3 Cursor.description can't return column types

2017-11-20 Thread Katsuhiko YOSHIDA

New submission from Katsuhiko YOSHIDA :

My schema of sqlite3 table is the following.

--- schema check start ---
% sqlite3 sample.db
SQLite version 3.16.0 2016-11-04 19:09:39
Enter ".help" for usage hints.
sqlite> PRAGMA table_info(Employees);
0|EmployeeID|int|1||1
1|LastName|varchar(20)|1||0
2|FirstName|varchar(10)|1||0

(ommiting)

sqlite>
--- schema check end ---

Then, I tried to output column types by calling Cursor.description. Like this.

--- sample code start ---
import sqlite3

con = sqlite3.connect("sample.db", detect_types=sqlite3.PARSE_DECLTYPES)
cursor = con.cursor()
cursor.execute("select LastName, FirstName from Employees limit 1;")
print cursor.description
cursor.close()
con.close()
--- sample code end ---

The output is the following.

(('LastName', None, None, None, None, None, None), ('FirstName', None, None, 
None, None, None, None))

When changing detect_types parameter to

detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES

the result is same.

I expect to output a column type in second element. Could you tell me why?

--
components: Library (Lib)
messages: 306539
nosy: kyoshidajp
priority: normal
severity: normal
status: open
title: sqlite3 Cursor.description can't return column types
type: behavior
versions: Python 2.7, Python 3.6

___
Python tracker 

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



[issue32084] [Security] http.server can be abused to redirect to (almost) arbitrary URL

2017-11-20 Thread STINNER Victor

New submission from STINNER Victor :

iDer reported a vulnerability in the HTTP server.

(1) Start a local HTTP server (listen to tcp/8000):

python3 -m http.server 8000

(2) Open a web browser and to go:

http://localhost:8000//www.python.org/%2f..

=> the browser is redirected to http://www.python.org/%2f../

(on this example, the python.org web server redirects to 
https://www.python.org/%2f../ )


Raw HTTP to see the HTTP redirection using netcat:
---
$ echo -ne "GET //www.python.org/%2f.. HTTP/1.0\n\n" | nc localhost 8000
HTTP/1.0 301 Moved Permanently
Server: SimpleHTTP/0.6 Python/3.6.2
Date: Mon, 20 Nov 2017 13:31:42 GMT
Location: //www.python.org/%2f../
---

The problem is in the SimpleHTTPRequestHandler.send_head() function:

* self.path = '//www.python.org/%2f..'
* translate_path() translates '//www.python.org//..' path to self.directory 
(the current directory by default).
* isdir(self.directory) is True but self.path doesn't send with '/', so 
send_head() creates a HTTP redirection (HTTP 301)
* The redirection URL is '//www.python.org/%2f../'. Extract of the raw HTTP: 
"Location: //www.python.org/%2f../"

The web browsers translates the URL '//www.python.org/%2f../' to 
"http://www.python.org/%2f../";... It surprised me, but ok, it's a fact.

I'm not sure what is the best way to fix this vulnerability without rejecting 
valid HTTP requests.

IMHO the root issue is the redirection URL starting with "//". I would expect 
something like "localhost//". The problem is that I'm not sure that the HTTP 
server knows its own "external" hostname. "localhost" is wrong is the server is 
accessed from the outside. Maybe the server must just fail on that case?


This vulnerabilility was reported to the Python Security Response Team (PSRT) 
at October 18, 2017 (one month ago). Since no obvious fix was found, it was 
decided to make the vulnerability public to get more eyes on it to find a quick 
fix.

Note: I'm not sure that this vulnerability is important, since the redirected 
URL ends with "/%2f../" which should be rejected by any correct HTTP Server 
(say, not the Python builtin "simple" HTTP server...).

--
components: Library (Lib)
messages: 306540
nosy: vstinner
priority: normal
severity: normal
status: open
title: [Security] http.server can be abused to redirect to (almost) arbitrary 
URL
type: security
versions: Python 2.7, 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



[issue32083] sqlite3 Cursor.description can't return column types

2017-11-20 Thread Berker Peksag

Berker Peksag  added the comment:

Thank you for your report. According to 
https://github.com/python/cpython/blob/04dee2720851ec39e831beaa3edc0c59f228f461/Modules/_sqlite/cursor.c#L573
 we always set the 'type_code' field described in PEP 249 to None. Setting it 
would be a new feature so it can only go into Python 3.7.

--
nosy: +berker.peksag, ghaering, lemburg
stage:  -> needs patch
type: behavior -> enhancement
versions: +Python 3.7 -Python 2.7, Python 3.6

___
Python tracker 

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



[issue32084] [Security] http.server can be abused to redirect to (almost) arbitrary URL

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

Extract of send_head():

path = self.translate_path(self.path)
f = None
if os.path.isdir(path):
parts = urllib.parse.urlsplit(self.path)
...

urllib.parse.urlsplit('//www.python.org/%2f..') returns:

SplitResult(scheme='', netloc='www.python.org', path='/%2f..', query='', 
fragment='')

Is urlsplit() the correct function to call here? www.python.org is part of the 
path, not of the netloc.

--

___
Python tracker 

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



[issue32085] [Security] A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages!

2017-11-20 Thread STINNER Victor

New submission from STINNER Victor :

Vulnerabilities described below are likely these ones reported in bpo-30500, 
but it would be nice to double check if *all* reported vulnerabilities have 
been fixed!
http://python-security.readthedocs.io/vuln/bpo-30500_urllib_connects_to_a_wrong_host.html

--

At July 27, 2017, Orange Tsai (Security Consultant, DEVCORE) reported 
vulnerabilities in Python, in the code parsing URLs.

Conference: 
https://www.blackhat.com/us-17/briefings/schedule/#a-new-era-of-ssrf---exploiting-url-parser-in-trending-programming-languages-6292
Slides: 
https://www.blackhat.com/docs/us-17/thursday/us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-Languages.pdf

His following blog post only contains the vulnerabilities in Python:
http://blog.orange.tw/2017/07/how-i-chained-4-vulnerabilities-on.html

Note: His twitter account, https://twitter.com/orange_8361


== Issue 1 ==

* CR-LF Injection on HTTP protocol
* Smuggling SMTP protocol over HTTP protocol


http://127.0.0.1:25/%0D%0AHELO orange.tw%0D%0AMAIL FROM
>> GET /
<< 421 4.7.0 ubuntu Rejecting open proxy localhost [127.0.0.1]
>> HELO orange.tw
Connection closed

=> "SMTP Hates HTTP Protocol It Seems Unexploitable"

"Gopher Is Good What If There Is No Gopher Support?"

"HTTPS What Won't Be Encrypted in a SSL Handshake?"


== Issue 2 ==

* HTTPS: What Won't Be Encrypted in a SSL Handshake?
* Exploit the Unexploitable - Smuggling SMTP over TLS SNI

https://127.0.0.1□%0D%0AHELO□orange.tw%0D%0AMAIL□FROM...:25/
(...)
>< HELO orange.tw
<< 250 ubuntu Hello localhost [127.0.0.1], please meet you
>> MAIL FROM: 
<< 250 2.1.0 ... Sender ok


== Big Picture ==

Python vulnerable to:

* Python httplib:

  * CR-LF Injection: Path, Host and SNI

* Python urllib: 

  * CR-LF Injection: Host and SNI
  * Host Injection

* Python urllib2

  * CR-LF Injection: Host and SNI

--
messages: 306543
nosy: vstinner
priority: normal
severity: normal
status: open
title: [Security] A New Era of SSRF - Exploiting URL Parser in Trending 
Programming Languages!
type: security

___
Python tracker 

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



[issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize()

2017-11-20 Thread STINNER Victor

New submission from STINNER Victor :

See the python-dev thread:
https://mail.python.org/pipermail/python-dev/2017-November/150605.html

--
components: Interpreter Core
messages: 306544
nosy: vstinner
priority: normal
severity: normal
status: open
title: C API: Clarify which C functions are safe to be called before 
Py_Initialize()
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



[issue32084] [Security] http.server can be abused to redirect to (almost) arbitrary URL

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

I wrote this patch, but I'm not sure that it's ok to always reject redirection 
URLs starting with //:

diff --git a/Lib/http/server.py b/Lib/http/server.py
index 502bce0c7a..494031b8c2 100644
--- a/Lib/http/server.py
+++ b/Lib/http/server.py
@@ -673,10 +673,18 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
 parts = urllib.parse.urlsplit(self.path)
 if not parts.path.endswith('/'):
 # redirect browser - doing basically what apache does
-self.send_response(HTTPStatus.MOVED_PERMANENTLY)
 new_parts = (parts[0], parts[1], parts[2] + '/',
  parts[3], parts[4])
 new_url = urllib.parse.urlunsplit(new_parts)
+
+# Browsers interpret "Location: //uri" as an absolute URI
+# like "http://URI";
+if new_url.startswith('//'):
+self.send_error(HTTPStatus.BAD_REQUEST,
+"URI must not start with //")
+return None
+
+self.send_response(HTTPStatus.MOVED_PERMANENTLY)
 self.send_header("Location", new_url)
 self.end_headers()
 return None

--

___
Python tracker 

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



[issue32087] deprecated-removed directive generates overlapping msgids in .pot files

2017-11-20 Thread KINEBUCHI Tomohiko

New submission from KINEBUCHI Tomohiko :

When gettext builder is invoked, deprecated-removed directive which is defined 
in Doc/tools/extensions/pyspecific.py generates overlapping msgids in .pot 
files.

For example, the following .rst source (taken from Doc/library/dmb.rst L354)::

   .. deprecated-removed:: 3.6 3.8
  Creating database in ``'r'`` and ``'w'`` modes.  Modifying database in
  ``'r'`` mode.

results to following .pot file entries::

   #: ../../library/dbm.rst:357
   msgid "Deprecated since version 3.6, will be removed in version 3.8: 
Creating database in 'r' and 'w' modes.  Modifying database in 'r' mode."
   msgstr ""

   #: ../../library/dbm.rst:357
   msgid "Creating database in ``'r'`` and ``'w'`` modes.  Modifying database 
in ``'r'`` mode."
   msgstr ""

using the command::

   sphinx-build -E -b gettext -D gettext_compact=0  -w warnings.txt -d 
build/.doctrees . locale/pot


The root cause is deprecated-removed directive constructs inappropriate 
sub-doctree for translation.
First, above .rst source is compiled into following tree structure::

   
 
   
 Deprecated since version 3.6, will be removed in version 3.8:
   
 Creating database in...

and gettext builder picks up paragraph node and the second inline node as 
translation targets.

Expected result is that two inline nodes are picked up as translation targets 
and the paragraph node is not, and expected .pot file entries are such as 
following::

   #: ../../library/dbm.rst:357
   msgid "Deprecated since version 3.6, will be removed in version 3.8:"
   msgstr ""

   #: ../../library/dbm.rst:357
   msgid "Creating database in ``'r'`` and ``'w'`` modes.  Modifying database 
in ``'r'`` mode."
   msgstr ""

--
assignee: docs@python
components: Documentation
messages: 306546
nosy: cocoatomo, docs@python
priority: normal
severity: normal
status: open
title: deprecated-removed directive generates overlapping msgids in .pot files
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



[issue32088] Display DeprecationWarning, PendingDeprecationWarning and ImportWarning in debug mode

2017-11-20 Thread STINNER Victor

New submission from STINNER Victor :

Related python-dev thread:
https://mail.python.org/pipermail/python-dev/2017-November/150608.html
"[Python-Dev] Show DeprecationWarning in debug mode?"

I propose to display Display DeprecationWarning, PendingDeprecationWarning and 
ImportWarning when Python is compiled in debug mode.

Attached PR implements proposed change.

--
components: Library (Lib)
messages: 306547
nosy: vstinner
priority: normal
severity: normal
status: open
title: Display DeprecationWarning, PendingDeprecationWarning and ImportWarning 
in debug mode
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue32087] deprecated-removed directive generates overlapping msgids in .pot files

2017-11-20 Thread KINEBUCHI Tomohiko

Change by KINEBUCHI Tomohiko :


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

___
Python tracker 

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



[issue32088] Display DeprecationWarning, PendingDeprecationWarning and ImportWarning in debug mode

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue32088] Display DeprecationWarning, PendingDeprecationWarning and ImportWarning in debug mode

2017-11-20 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers

2017-11-20 Thread STINNER Victor

New submission from STINNER Victor :

The -X dev mode currently *hides* some ResourceWarning warnings:

$ cat x.py 
def func():
open('/etc/issue')

func()
func()

$ ./python x.py 
x.py:2: ResourceWarning: unclosed file <_io.TextIOWrapper name='/etc/issue' 
mode='r' encoding='UTF-8'>
  open('/etc/issue')
x.py:2: ResourceWarning: unclosed file <_io.TextIOWrapper name='/etc/issue' 
mode='r' encoding='UTF-8'>
  open('/etc/issue')

haypo@selma$ ./python -X dev x.py 
x.py:2: ResourceWarning: unclosed file <_io.TextIOWrapper name='/etc/issue' 
mode='r' encoding='UTF-8'>
  open('/etc/issue')


The problem is that the "-W default" inserted by -X dev overrides the final 
filter on ResourceWarning:

$ ./python -X dev -c 'import warnings, pprint; pprint.pprint(warnings.filters)'
[('default',
  re.compile('', re.IGNORECASE),
  ,
  re.compile(''),
  0),
 ('ignore', None, , None, 0),
 ('always', None, , None, 0)]

--
messages: 306548
nosy: ncoghlan, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: In developer mode (-X dev), ResourceWarning is only emited once per line 
numbers
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



[issue32088] Display DeprecationWarning, PendingDeprecationWarning and ImportWarning in debug mode

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

Warnings filters in debug mode.

Reference (current code):

$ ./python -c 'import warnings, pprint; pprint.pprint(warnings.filters)'
[('ignore', None, , None, 0),
 ('ignore', None, , None, 0),
 ('ignore', None, , None, 0),
 ('ignore', None, , None, 0),
 ('always', None, , None, 0)]

With my PR 4474:

$ ./python -c 'import warnings, pprint; pprint.pprint(warnings.filters)'
[('ignore', None, , None, 0),
 ('always', None, , None, 0)]


BytesWarning is not modified by my PR since this specific warning is controlled 
by the -b option. Example with my PR.

-b option, ignore => default:

$ ./python -b -c 'import warnings, pprint; pprint.pprint(warnings.filters)'
[('default', None, , None, 0),
 ('always', None, , None, 0)]

-bb option, ignore => error:

$ ./python -bb -c 'import warnings, pprint; pprint.pprint(warnings.filters)'
[('error', None, , None, 0),
 ('always', None, , None, 0)]


Note: While writing this comment, I also found a bug in the new developer mode 
(-X dev): bpo-32089.

--

___
Python tracker 

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



[issue31790] double free or corruption (while using smem)

2017-11-20 Thread Zoltan Krajcsovics

Zoltan Krajcsovics  added the comment:

In a span of about 1 month, I had multiple errors:

*** Error in `/usr/bin/python': free(): invalid next size (normal): 
0x55f9c9e7c970 ***
*** Error in `/usr/bin/python': free(): invalid next size (normal): 
0x55e33fda3970 ***
*** Error in `/usr/bin/python': free(): invalid next size (normal): 
0x564d42335970 ***
*** Error in `/usr/bin/python': double free or corruption (out): 
0x561d8b9d4f80 ***
*** Error in `/usr/bin/python': double free or corruption (out): 
0x557700e74f80 ***
*** Error in `/usr/bin/python': free(): invalid next size (normal): 
0x564b6142e970 ***

In the same time-period, I have been running the same code on another system, 
with a different python version, which did not produce any error:

python version that causes issues:
python --version
Python 2.7.13

python version that is error-free:
Python 2.7.9

--
Added file: https://bugs.python.org/file47279/logs.txt

___
Python tracker 

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



[issue32050] Deprecated python3 -x option

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 733b5f3f2f2425fa939d71bc317f2e0f1968c2a0 by Victor Stinner in 
branch '2.7':
bpo-32050: Fix -x option documentation (#4423)
https://github.com/python/cpython/commit/733b5f3f2f2425fa939d71bc317f2e0f1968c2a0


--

___
Python tracker 

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



[issue32050] Deprecated python3 -x option

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4410

___
Python tracker 

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



[issue32050] Fix -x option documentation

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


--
title: Deprecated python3 -x option -> Fix -x option documentation

___
Python tracker 

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



[issue32047] asyncio: enable debug mode when -X dev is used

2017-11-20 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



[issue32047] asyncio: enable debug mode when -X dev is used

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 44862df2eeec62adea20672b0fe2a5d3e160569e by Victor Stinner in 
branch 'master':
bpo-32047: -X dev enables asyncio debug mode (#4418)
https://github.com/python/cpython/commit/44862df2eeec62adea20672b0fe2a5d3e160569e


--

___
Python tracker 

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



[issue32090] test_put() of test_multiprocessing queue tests has a race condition

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


--
title: test_put() -> test_put() of test_multiprocessing queue tests has a race 
condition

___
Python tracker 

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



[issue32090] test_put()

2017-11-20 Thread STINNER Victor

New submission from STINNER Victor :

The test failed on AMD64 FreeBSD 10.x Shared 3.x:

http://buildbot.python.org/all/#/builders/87/builds/200/steps/4/logs/stdio

FAIL: test_put (test.test_multiprocessing_fork.WithProcessesTestQueue)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/_test_multiprocessing.py",
 line 809, in test_put
self.assertEqual(queue_empty(queue), False)
AssertionError: True != False

--

I succeeded to reproduce the issue on Linux with this change:

diff --git a/Lib/test/_test_multiprocessing.py 
b/Lib/test/_test_multiprocessing.py
index dbca2d89ed..0754ac0d52 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -804,7 +804,7 @@ class _TestQueue(BaseTestCase):
 queue.put_nowait(6)
 
 # the values may be in buffer but not yet in pipe so sleep a bit
-time.sleep(DELTA)
+time.sleep(0)
 
 self.assertEqual(queue_empty(queue), False)
 self.assertEqual(queue_full(queue, MAXSIZE), True)

--
components: Tests
messages: 306553
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_put()
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



[issue32091] test_s_option() of test_site.HelperFunctionsTests failed on x86 Gentoo Refleaks 3.6

2017-11-20 Thread STINNER Victor

New submission from STINNER Victor :

Failure on x86 Gentoo Refleaks 3.6:

http://buildbot.python.org/all/#/builders/72/builds/43


0:58:35 load avg: 5.21 [135/406/1] test_site failed -- running: 
test_multiprocessing_forkserver (483 sec)
beginning 6 repetitions
123456
test test_site failed -- Traceback (most recent call last):
  File 
"/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/Lib/test/test_site.py", 
line 186, in test_s_option
self.assertIn(usersite, sys.path)
AssertionError: '/buildbot/buildarea/.local/lib/python3.6/site-packages' not 
found in ['', '/usr/local/lib/python36.zip', 
'/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/Lib', 
'/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/build/lib.linux-i686-3.6-pydebug',
 '/usr/local/lib/python3.6/site-packages']
(...)
Re-running test 'test_site' in verbose mode
(...)
FAIL: test_s_option (test.test_site.HelperFunctionsTests)
--
Traceback (most recent call last):
  File 
"/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/Lib/test/test_site.py", 
line 186, in test_s_option
self.assertIn(usersite, sys.path)
AssertionError: '/buildbot/buildarea/.local/lib/python3.6/site-packages' not 
found in ['', '/usr/local/lib/python36.zip', 
'/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/Lib', 
'/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/build/lib.linux-i686-3.6-pydebug',
 '/usr/local/lib/python3.6/site-packages']

--
components: Tests
messages: 306554
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_s_option() of test_site.HelperFunctionsTests failed on x86 Gentoo 
Refleaks 3.6
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



[issue32091] test_s_option() of test_site.HelperFunctionsTests failed on x86 Gentoo Refleaks 3.6

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

Same failure on x86 Gentoo Refleaks 2.7:

FAIL: test_s_option (test.test_site.HelperFunctionsTests)
--
Traceback (most recent call last):
  File 
"/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/test/test_site.py", 
line 190, in test_s_option
self.assertIn(usersite, sys.path)
AssertionError: '/buildbot/buildarea/.local/lib/python2.7/site-packages' not 
found in ['/usr/local/lib/python27.zip', 
'/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib', 
'/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/plat-linux2', 
'/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/lib-tk', 
'/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/lib-old', 
'/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/build/lib.linux-i686-2.7-pydebug',
 '/usr/local/lib/python2.7/site-packages']

--

___
Python tracker 

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



[issue32091] test_s_option() of test_site.HelperFunctionsTests failed on x86 Gentoo Refleaks 3.6

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


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



[issue25711] Rewrite zipimport from scratch

2017-11-20 Thread Decorater

Decorater  added the comment:

So, after reviewing this it started to make me rethink about the zipimport.py 
file.

So my question is how would that file work if it is an pyc file in python37.zip 
or something just to zipimport other modules? There is got to be some sort of 
low level api that can zip import the zip importer then on the rewrite. Am I 
right?

Maybe the best bet is to wait for bug reports on the C Code and fixup the C 
Code if possible so that way there is no conflicts like the ones I just 
questioned.

--
nosy: +Decorater

___
Python tracker 

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



[issue31687] test_semaphore_tracker() of test_multiprocessing_spawn fails randomly (race condition?)

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

Failure on x86 Gentoo Refleaks 3.6, two days ago:

http://buildbot.python.org/all/#/builders/72/builds/41

==
FAIL: test_semaphore_tracker 
(test.test_multiprocessing_spawn.TestSemaphoreTracker)
--
Traceback (most recent call last):
  File 
"/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/Lib/test/_test_multiprocessing.py",
 line 4161, in test_semaphore_tracker
_multiprocessing.sem_unlink(name2)
AssertionError: OSError not raised
==
FAIL: test_sys_exit 
(test.test_multiprocessing_spawn.WithProcessesTestSubclassingProcess)
--
Traceback (most recent call last):
  File 
"/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/Lib/test/_test_multiprocessing.py",
 line 584, in test_sys_exit
self.assertEqual(p.exitcode, 1)
AssertionError: None != 1

--

___
Python tracker 

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



[issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD

2017-11-20 Thread Tim Peters

Tim Peters  added the comment:

I have no opinion about any version of xxxBSD, because I've never used one ;-)  
If current versions of those do have this failure, has anyone opened a bug 
report on _their_ tracker(s)?  I've seen no reason yet to imagine these 
failures are a fault in Python.

--

___
Python tracker 

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



[issue32092] mock.patch with autospec does not consume self / cls argument

2017-11-20 Thread Claudiu Belu

New submission from Claudiu Belu :

Currently, the autospec=True argument can be passed to mock.patch, but when 
trying to make assertions on the call and its arguments, it can fail, as it 
expects an instance / class instance reference as the first argument (self / 
cls arguments are not consumed when autospec-ing).

Steps to reproduce:

>>> import mock
>>> from mock.tests import testmock
>>>
>>> with mock.patch.object(testmock.Something, 'meth', autospec=True):
... smth = testmock.Something()
... smth.meth(mock.sentinel.a, mock.sentinel.b, mock.sentinel.c, 
mock.sentinel.d)
... smth.meth.assert_called_once_with(mock.sentinel.a, mock.sentinel.b, 
mock.sentinel.c, mock.sentinel.d)
...

Traceback (most recent call last):
  File "", line 4, in 
  File "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 318, in 
assert_called_once_with
return mock.assert_called_once_with(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 948, in 
assert_called_once_with
return self.assert_called_with(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 937, in 
assert_called_with
six.raise_from(AssertionError(_error_message(cause)), cause)
  File "/usr/local/lib/python2.7/dist-packages/six.py", line 718, in raise_from
raise value
AssertionError: Expected call: meth(sentinel.a, sentinel.b, sentinel.c, 
sentinel.d)
Actual call: meth(, 
sentinel.a, sentinel.b, sentinel.c, sentinel.d)

Expected result: no AssertionError.

--
messages: 306559
nosy: cbelu
priority: normal
severity: normal
status: open
title: mock.patch with autospec does not consume self / cls argument
versions: Python 2.7, 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



[issue32092] mock.patch with autospec does not consume self / cls argument

2017-11-20 Thread Claudiu Belu

Change by Claudiu Belu :


--
type:  -> behavior

___
Python tracker 

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



[issue32092] mock.patch with autospec does not consume self / cls argument

2017-11-20 Thread Claudiu Belu

Change by Claudiu Belu :


--
components: +Library (Lib)

___
Python tracker 

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



[issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize()

2017-11-20 Thread Eric Snow

Change by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



[issue32092] mock.patch with autospec does not consume self / cls argument

2017-11-20 Thread Claudiu Belu

Claudiu Belu  added the comment:

Currently, the autospec=True argument can be passed to mock.patch, but when 
trying to make assertions on the call and its arguments, it can fail, as it 
expects an instance / class instance reference as the first argument (self / 
cls arguments are not consumed when autospec-ing).

Steps to reproduce:

ubuntu@ubuntu:/opt/stack/cpython$ ./python
Python 3.7.0a2+ (heads/mock-add-autospec:51a9270, Nov 20 2017, 06:48:44)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from unittest import mock
from unittest.test.testmock import testmock

with mock.patch.object(testmock.Something, 'meth', autospec=True):
smth = testmock.Something()
smth.meth(mock.sentinel.a, mock.sentinel.b, mock.sentinel.c, 
mock.sentinel.d)
smth.meth.assert_called_once_with(mock.sentinel.a, mock.sentinel.b, 
mock.sentinel.c, mock.sentinel.d)

>>> >>> >>> ... ... ... ... 
Traceback (most recent call last):
  File "", line 4, in 
  File "/opt/stack/cpython/Lib/unittest/mock.py", line 196, in 
assert_called_once_with
return mock.assert_called_once_with(*args, **kwargs)
  File "/opt/stack/cpython/Lib/unittest/mock.py", line 856, in 
assert_called_once_with
return self.assert_called_with(*args, **kwargs)
  File "/opt/stack/cpython/Lib/unittest/mock.py", line 845, in 
assert_called_with
raise AssertionError(_error_message()) from cause
AssertionError: Expected call: meth(sentinel.a, sentinel.b, sentinel.c, 
sentinel.d)
Actual call: meth(, sentinel.a, sentinel.b, sentinel.c, sentinel.d)

Expected result: no AssertionError.

--

___
Python tracker 

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



[issue32092] mock.patch with autospec does not consume self / cls argument

2017-11-20 Thread Claudiu Belu

Change by Claudiu Belu :


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

___
Python tracker 

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



[issue30587] Mock with spec object does not ensure method call signatures

2017-11-20 Thread Claudiu Belu

Change by Claudiu Belu :


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

___
Python tracker 

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



[issue32050] Fix -x option documentation

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset c5a2071586f735d2a61d1756e7011cfbb6ce86c9 by Victor Stinner in 
branch 'master':
bpo-32050: Fix -x option documentation (#4475)
https://github.com/python/cpython/commit/c5a2071586f735d2a61d1756e7011cfbb6ce86c9


--

___
Python tracker 

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



[issue32050] Fix -x option documentation

2017-11-20 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4414

___
Python tracker 

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



[issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize()

2017-11-20 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +ned.deily
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



[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

+531  elif sys.platform.startswith("aix"):
  +532  getters = [_netstat_getnode]

LGTM. Do you want to write this a pull request?

--
nosy: +vstinner

___
Python tracker 

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



[issue32050] Fix -x option documentation

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

I removed the note from the documentation since it was outdated.

Serhiy, Terry: Do you want to work on a patch to rephrase the "DOS specific 
hack only" sentence?

> @py -3 -x %0 %* & exit /b

I'm not a BATCH expert, so I don't know if this command works on all Windows 
version, or even on MS-DOS. So I'm not confident to propose such doc change 
myself, sorry.

--

___
Python tracker 

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



[issue32050] Fix -x option documentation

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 60a376cf0023d1070329d0e861a5596637ff3275 by Victor Stinner (Miss 
Islington (bot)) in branch '3.6':
bpo-32050: Fix -x option documentation (GH-4475) (#4477)
https://github.com/python/cpython/commit/60a376cf0023d1070329d0e861a5596637ff3275


--

___
Python tracker 

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



[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2017-11-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

_unixdll_getnode, _ifconfig_getnode, and _arp_getnode were changed recently. 
Are they still not working on AIX?

--
nosy: +serhiy.storchaka
versions: +Python 3.7 -Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue32050] Fix -x option documentation

2017-11-20 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I don't know either.  Once of the Windows experts should review and revise.

--

___
Python tracker 

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



[issue32078] string result of str(bytes()) in Python3

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

Calling str(bytes) is wrong in Python 3:

$ python3 -bb
Python 3.6.2 (default, Oct  2 2017, 16:51:32) 
>>> str(b'abc')
BytesWarning: str() on a bytes instance

Just don't do that :-)

Use repr(bytes) if you want the b'...' format:

>>> repr(b'abc')
"b'abc'"

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



[issue32022] Python crashes with mutually recursive code

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

I don't think that we can fix this issue. I suggest to close it as WONTFIX.


> sys.setrecursionlimit(3000)

While Python does its best to catch stack overflow, the C implementation of 
CPython can exhaust the stack memory (8 MB in Linux?) and then crash with a 
"stack overflow".

I suggest to rewrite your algorithm to reduce the maximum stack depth.

Or maybe try to find a way to extend the maximum size of the stack (is it 
possible without rebuilding Python?). See for example RLIMIT_STACK of the 
resource module on Unix.


> On linux x86-64 with python 3.6.3 and python 3.7.0a2+ I get a RecursionError: 
> maximum recursion depth exceeded.

The exact memory usage depends on the Python version and maybe compiler flags. 
We reduce the stack usage in Python 3.7, search for "Stack consumption" in:

https://vstinner.github.io/contrib-cpython-2017q1.html

--

___
Python tracker 

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



[issue32093] macOS: implement time.thread_time() using thread_info()

2017-11-20 Thread STINNER Victor

New submission from STINNER Victor :

bpo-32025 added time.thread_time() function. On macOS, CLOCK_THREAD_CPUTIME_ID 
is not available. I propose to add a macOS implementation using thread_info(): 
return the sum of user and system times.

--
components: macOS
messages: 306569
nosy: ned.deily, pitrou, ronaldoussoren, vstinner
priority: normal
severity: normal
status: open
title: macOS: implement time.thread_time() using thread_info()
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



[issue32025] Add time.thread_time()

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

I opened bpo-32093 for macOS. I close this one.

Nice enhancement, I already like this new clock ;-)

--
components: +FreeBSD -Library (Lib)
nosy: +koobs
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



[issue32043] Add a new -X dev option: "developer mode"

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4415

___
Python tracker 

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



[issue32088] Display DeprecationWarning, PendingDeprecationWarning and ImportWarning in debug mode

2017-11-20 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 895862aa01793a26e74512befb0c66a1da2587d6 by Łukasz Langa (Victor 
Stinner) in branch 'master':
bpo-32088: Display Deprecation in debug mode (#4474)
https://github.com/python/cpython/commit/895862aa01793a26e74512befb0c66a1da2587d6


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue12276] 3.x ignores sys.tracebacklimit=0

2017-11-20 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Bugs in PyTraceBack_Print()

___
Python tracker 

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



[issue31897] Unexpected exceptions in plistlib.loads

2017-11-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Opened issue32072 for infinite recursion and related issues.

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



[issue32094] _args_from_interpreter_flags() doesn't keep -X options

2017-11-20 Thread Antoine Pitrou

New submission from Antoine Pitrou :

`subprocess._args_from_interpreter_flags()` is used to control the flags passed 
to child Python processes, for example launched by multiprocessing.  
Unfortunately, not all flags are actually recognized by this function:

$ ./python -X dev
Python 3.7.0a2+ (heads/master:895862a, Nov 20 2017, 19:15:23) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys._xoptions
{'dev': True}
>>> import subprocess
>>> subprocess._args_from_interpreter_flags()
['-Wdefault']

--
components: Library (Lib)
messages: 306574
nosy: barry, davin, pitrou, vstinner
priority: normal
severity: normal
status: open
title: _args_from_interpreter_flags() doesn't keep -X options
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-11-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Ah, this is Cygwin!

This is a Tk bug 
(https://core.tcl.tk/tk/tktview?name=5ee8af61e5ef8e233158a43459624f4ecf58a6fe). 
It was fixed, but not completely. The fix doesn't work on Cygwin.

--

___
Python tracker 

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



[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-11-20 Thread Zachary Ware

Zachary Ware  added the comment:

> Ah, this is Cygwin!

Hmm, no; Cygwin isn't installed on ware-win81-release.

When was the fix made?  2.7 on Windows currently uses 8.5.15, we can bump it up 
to latest 8.5 if that will help.

--

___
Python tracker 

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



[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2017-11-20 Thread Michael Felt

Michael Felt  added the comment:

On 11/20/2017 5:22 PM, Serhiy Storchaka wrote:
> Serhiy Storchaka  added the comment:
>
> _unixdll_getnode, _ifconfig_getnode, and _arp_getnode were changed recently. 
> Are they still not working on AIX?
After a clone of master:
a) _unixdll_getnode is renamed to _unix_getnode
since the function _load_system_functions() still depends on 
find_library() - that always returns None, still not working.
Note also - find_library('uuid') will not work on a standard AIX - as 
the library libuuid.a does not exist, neither have I ever seen a shared 
library with the name libuuid.so.
FYI: Finally, "nm -Ae /usr/lib/libc.a | grep uuid" returns

root@x071:[/root]nm -Ae /usr/lib/libc.a | grep uuid
/usr/lib/libc.a[shr.o]: ._gen_localhost_uuid t 3248320
/usr/lib/libc.a[shr.o]: ._gen_localhost_uuid@AF22_8 t 3256928
/usr/lib/libc.a[shr.o]: .uuid__get_os_time   T 3234208
/usr/lib/libc.a[shr.o]: .uuid__uemul T 3236064
/usr/lib/libc.a[shr.o]: .uuid_compare    T 3237088
/usr/lib/libc.a[shr.o]: .uuid_copy   T 3236224
/usr/lib/libc.a[shr.o]: .uuid_create T 3240480
/usr/lib/libc.a[shr.o]: .uuid_create_nil T 3240160
/usr/lib/libc.a[shr.o]: .uuid_create_os  T 3256608
/usr/lib/libc.a[shr.o]: .uuid_disk   T 3252448
/usr/lib/libc.a[shr.o]: .uuid_equal  T 3238336
/usr/lib/libc.a[shr.o]: .uuid_equal_nc   T 3248384
/usr/lib/libc.a[shr.o]: .uuid_for_key    T 3249504
/usr/lib/libc.a[shr.o]: .uuid_from_string    T 3238944
/usr/lib/libc.a[shr.o]: .uuid_from_string_nc T 3248960
/usr/lib/libc.a[shr.o]: .uuid_get_address    t 3234720
/usr/lib/libc.a[shr.o]: .uuid_hash   T 3236384
/usr/lib/libc.a[shr.o]: .uuid_is_nil T 3237984
/usr/lib/libc.a[shr.o]: .uuid_is_nil_nc  T 3249408
/usr/lib/libc.a[shr.o]: .uuid_is_valid_string_nc T 3248512
/usr/lib/libc.a[shr.o]: .uuid_is_valid_string_nc@AF23_10 t 3257184
/usr/lib/libc.a[shr.o]: .uuid_localhost  T 3254208
/usr/lib/libc.a[shr.o]: .uuid_os_md5 t 3245248
/usr/lib/libc.a[shr.o]: .uuid_os_sha1    t 3245376
/usr/lib/libc.a[shr.o]: .uuid_to_string  T 3239648
/usr/lib/libc.a[shr.o]: .uuid_to_string_nc   T 3248608
/usr/lib/libc.a[shr.o]: _uuid_rmutex B  548664 12
/usr/lib/libc.a[shr.o]: _uuid_rmutex d  512480 4
/usr/lib/libc.a[shr.o]: getosuuid    U   -
/usr/lib/libc.a[shr.o]: setosuuid    U   -
/usr/lib/libc.a[shr.o]: uuid_c_version   D  503544 4
/usr/lib/libc.a[shr.o]: uuid_compare D  498436 12
/usr/lib/libc.a[shr.o]: uuid_copy    D  498412 12
/usr/lib/libc.a[shr.o]: uuid_create  D  498508 12
/usr/lib/libc.a[shr.o]: uuid_create_nil  D  498496 12
/usr/lib/libc.a[shr.o]: uuid_create_os   D  498616 12
/usr/lib/libc.a[shr.o]: uuid_disk    D  498592 12
/usr/lib/libc.a[shr.o]: uuid_equal   D  498460 12
/usr/lib/libc.a[shr.o]: uuid_equal_nc    D  498520 12
/usr/lib/libc.a[shr.o]: uuid_for_key D  498580 12
/usr/lib/libc.a[shr.o]: uuid_from_string D  498472 12
/usr/lib/libc.a[shr.o]: uuid_from_string_nc  D  498556 12
/usr/lib/libc.a[shr.o]: uuid_g_nil_uuid  D  432472 16
/usr/lib/libc.a[shr.o]: uuid_g_nil_uuid  d  512476 4
/usr/lib/libc.a[shr.o]: uuid_hash    D  498424 12
/usr/lib/libc.a[shr.o]: uuid_is_nil  D  498448 12
/usr/lib/libc.a[shr.o]: uuid_is_nil_nc   D  498568 12
/usr/lib/libc.a[shr.o]: uuid_is_valid_string_nc D 498532  12
/usr/lib/libc.a[shr.o]: uuid_localhost   D  498604 12
/usr/lib/libc.a[shr.o]: uuid_to_string   D  498484 12
/usr/lib/libc.a[shr.o]: uuid_to_string_nc    D  498544 12

i.e., there is nothing with uuid_generate in it.

_arp_getnode()
AIX does not return any value for itself.
Neither does Centos, (so I expect RHEL will also not), and my old 
debians do not either.

So, after summary - these three functions still do nothing/do not work 
on AIX 6.1 or AIX 7.1 (cannot test AIX 7.2).

And - as before, netstat -ia - when looking at ':', still returns

01:00:5e:00:00:01

for every interface.

>
> --
> nosy: +serhiy.storchaka
> versions: +Python 3.7 -Python 3.3, Python 3.4, Python 3.5
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-11-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The fix was made 2015-11-09. The tag core-8-5-15 was created 2013-09-16.

I'm not well experienced with fossil and thought that 8.5.15 contains this fix, 
but now I see that this is not true. Yes, updating Tcl/Tk can help.

--

___
Python tracker 

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



[issue28538] _socket module cross-compilation error on android-24

2017-11-20 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
pull_requests: +4416

___
Python tracker 

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



[issue28538] _socket module cross-compilation error on android-24

2017-11-20 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

These changes are not needed anymore now that Unified Headers are supported by 
android-ndk-r14 (see issue 29040)

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

___
Python tracker 

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



[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2017-11-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

What return commands `ifconfig`, `ifconfig -a`, `ifconfig -av`, `ip link list`, 
`arp -an`, `lanscan -ai` (if not error)?

--

___
Python tracker 

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



[issue32095] AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails

2017-11-20 Thread Michael Felt

New submission from Michael Felt :

after git clone from master:
make install fails to complete with:

Important - python is not installed already.
FYI: also note - build completes successfully with 2.7.14 (will download and 
check other python3 versions)

if test "xupgrade" != "xno"  ; then  case upgrade in  upgrade) 
ensurepip="--upgrade" ;;  install|*) ensurepip="" ;;  esac;   ./python -E -m 
ensurepip  $ensurepip --root=/ ;  fi
Traceback (most recent call last):
  File "/data/prj/python/git/src/python3-3.7.0.1/Lib/runpy.py", line 193, in 
_run_module_as_main
"__main__", mod_spec)
  File "/data/prj/python/git/src/python3-3.7.0.1/Lib/runpy.py", line 85, in 
_run_code
exec(code, run_globals)
  File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ensurepip/__main__.py", 
line 5, in 
sys.exit(ensurepip._main())
  File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ensurepip/__init__.py", 
line 204, in _main
default_pip=args.default_pip,
  File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ensurepip/__init__.py", 
line 117, in _bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ensurepip/__init__.py", 
line 27, in _run_pip
import pip
  File "/tmp/tmpg0jc_9p6/pip-9.0.1-py2.py3-none-any.whl/pip/__init__.py", line 
28, in 
  File "/tmp/tmpg0jc_9p6/pip-9.0.1-py2.py3-none-any.whl/pip/vcs/mercurial.py", 
line 9, in 
  File "/tmp/tmpg0jc_9p6/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 
36, in 
  File "/tmp/tmpg0jc_9p6/pip-9.0.1-py2.py3-none-any.whl/pip/utils/glibc.py", 
line 4, in 
  File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ctypes/__init__.py", line 
7, in 
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
make: 1254-004 The error code from the last command is 1.

--
components: Build
messages: 306581
nosy: Michael.Felt
priority: normal
severity: normal
status: open
title: AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails
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



[issue32094] _args_from_interpreter_flags() doesn't keep -X options

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue32095] AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails

2017-11-20 Thread Michael Felt

Michael Felt  added the comment:

FYI: version 3.6.3 compiles and builds without this issue.

+ make install DESTDIR=/var/aixtools/python/Python/3.6.3.0 > 
.buildaix/install.out
+ mkinstallp.ksh /var/aixtools/python/Python/3.6.3.0 > .buildaix/mkinstallp.out

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



[issue32095] AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails

2017-11-20 Thread Zachary Ware

Zachary Ware  added the comment:

Do you have libffi (and its development headers) installed where the compiler 
can find it?  Python 3.7 no longer bundles a copy of libffi (see #27979).

--
nosy: +zach.ware
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



[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-20 Thread Jonas H.

Jonas H.  added the comment:

Thanks Antoine. I will need some guidance as to what are the correct places to 
make these changes. I'm not quite sure about the abstractions here (runner, 
loader, suite, case, etc.)

My PoC (see GitHub link in first post) uses a TestSuite subclass. (The subclass 
is only so that it's easier to assess the general implementation approach; I 
guess it should be put into the main class instead.)

Things I'm unsure of:

1) Is suite the correct place for this kind of feature?
2) Is the hardcoded fnmatch-based pattern matcher ok, or do we need a new 
abstraction "NameMatcher"?
3) Is the approach of dynamically wrapping 'skip()' around to-be-skipped test 
cases OK?
4) The try...catch statement around 'test.id()' is needed because there are 
some unit tests (unit tests for the unittest module itself) that check for some 
error cases/error handling in the unittest framework, and crash if we try to 
call '.id()' on them. Please remove the try...catch to see these errors if 
you're interested in the details. Is the check OK like that, or is this a code 
smell?

Thanks
Jonas

--

___
Python tracker 

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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-20 Thread Eric Snow

New submission from Eric Snow :

(see the python-dev thread [1])
(related: issue #32086)

When I consolidated the global runtime state into a single global, _PyRuntime, 
calls Py_DecodeLocale() started to break if the runtime hadn't been intialized 
yet.  This is because that function relies on PyMem_RawMalloc() and 
PyMem_RawFree(), which rely on the raw allocator having been initialized as 
part of the runtime (it used to be intialized statically).

The documentation for various "Process-wide parameters" [2] explicitly directs 
users to call Py_DecodeLocale() where necessary.  The docs for 
Py_DecodeLocale(), in turn, explicitly refer to calling PyMem_RawFree().  So 
changing the pre-runtime-init behavior of Py_DecodeLocale() and PyMem_RawFree() 
is a regression that should be fixed.

[1] https://mail.python.org/pipermail/python-dev/2017-November/150605.html
[2] https://docs.python.org/3/c-api/init.html#process-wide-parameters

--
assignee: eric.snow
messages: 306585
nosy: eric.snow, ncoghlan, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Py_DecodeLocale() fails if used before the runtime is initialized.
type: crash

___
Python tracker 

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



[issue32095] AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails

2017-11-20 Thread Michael Felt

Michael Felt  added the comment:

no. I'll install what I have atm.

Too bad - as now it will have an install dependency.

re: https://bugs.python.org/issue27976#msg274628 -- seems a warning that libffi 
is not available might be useful after all.

Question: is ffi still bundled for Darwin - even in 3.7? If yes, maybe it 
should also be bundled for AIX.

In any case, just installing a libffi.a library fixed the install (i.e., make; 
make install)

--
nosy:  -zach.ware
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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-20 Thread Eric Snow

Change by Eric Snow :


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

___
Python tracker 

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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-20 Thread Decorater

Decorater  added the comment:

Interesting, on 3.6.3 on my embedded program it seems to work just fine.

Did anything change in it since then?

https://github.com/AraHaan/Els_kom_new/blob/master/PC/komextract_new.c

--
nosy: +Decorater

___
Python tracker 

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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-20 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
components: +Interpreter Core
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



[issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize()

2017-11-20 Thread Decorater

Decorater  added the comment:

For me, it looks like Py_DecodeLocal() is still safe (according to python 3.6.3 
unless anything changed in it).

--
nosy: +Decorater

___
Python tracker 

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



[issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize()

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

> For me, it looks like Py_DecodeLocal() is still safe (according to python 
> 3.6.3 unless anything changed in it).

This issue is a regression in Python 3.7.

--

___
Python tracker 

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



[issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize()

2017-11-20 Thread Decorater

Decorater  added the comment:

Ah, I see now.

--

___
Python tracker 

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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

Duplicate of bpo-32086.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> C API: Clarify which C functions are safe to be called before 
Py_Initialize()

___
Python tracker 

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



[issue32066] asyncio: Support pathlib.Path in create_unix_connection; sock arg should be optional

2017-11-20 Thread Yury Selivanov

New submission from Yury Selivanov :


New changeset 423fd362f8e4d6c867a5afc8ac7cbeeb66cac19c by Yury Selivanov in 
branch 'master':
bpo-32066: Support pathlib.Path in create_unix_connection; sock arg should be 
optional (#4447)
https://github.com/python/cpython/commit/423fd362f8e4d6c867a5afc8ac7cbeeb66cac19c


--

___
Python tracker 

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



[issue32066] asyncio: Support pathlib.Path in create_unix_connection; sock arg should be optional

2017-11-20 Thread Yury Selivanov

Change by Yury Selivanov :


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

___
Python tracker 

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



[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

First, I should clarify that I'm not a unittest maintainer.  However, as far as 
I can tell, the maintainers have not been very active lately.  Also, this is a 
reasonably simple enhancement (at least conceptually), so I think can do 
without a maintainer's formal approval.

To your questions:

> 1) Is suite the correct place for this kind of feature?

At its core, TestSuite is really a glorified collection of tests.  The 
selection logic is inside the TestLoader, and indeed the TestLoader docstring 
says:

"""This class is responsible for loading tests according to various criteria 
and returning them wrapped in a TestSuite"""

So I would recommend putting this in TestLoader.

> 2) Is the hardcoded fnmatch-based pattern matcher ok, or do we need a new 
> abstraction "NameMatcher"?

I think the hardcoded approach is ok.  Though to benefit readability you may 
want to use a predicate function instead.

> 3) Is the approach of dynamically wrapping 'skip()' around to-be-skipped test 
> cases OK?

I think this is the wrong approach.  A test that isn't selected shouldn't be 
skipped, it should not appear in the output at all.  Another reason for putting 
this in TestLoader :-)

> 4) The try...catch statement around 'test.id()' is needed because there are 
> some unit tests (unit tests for the unittest module itself) that check for 
> some error cases/error handling in the unittest framework, and crash if we 
> try to call '.id()' on them

I'd ask the question differently: do you need to call .id() to do the matching 
at all?  Intuitively, the TestLoader probably knows about the test names 
already, even before it instantiates TestCases for them.  TestCases shouldn't 
be instantiated for tests that are not selected.

--

___
Python tracker 

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



[issue2504] Add gettext.pgettext() and variants support

2017-11-20 Thread Jonathan Schoonhoven

Jonathan Schoonhoven  added the comment:

Is there anything I can do to help get this into the codebase and out issue 
purgatory? We're not that far off from the 10 year anniversary of this issue.

--
nosy: +Jonathan Schoonhoven

___
Python tracker 

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



[issue32097] doctest does not consider \r\n a

2017-11-20 Thread Bert JW Regeer

New submission from Bert JW Regeer :

doctest fails to consider `\r\n` as a blank line.

--
components: Library (Lib)
files: test.py
messages: 306595
nosy: X-Istence
priority: normal
severity: normal
status: open
title: doctest does not consider \r\n a 
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47280/test.py

___
Python tracker 

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



[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-20 Thread Jonas H.

Jonas H.  added the comment:

> > 3) Is the approach of dynamically wrapping 'skip()' around to-be-skipped 
> > test cases OK?

> I think this is the wrong approach.  A test that isn't selected shouldn't be 
> skipped, it should not appear in the output at all.  Another reason for 
> putting this in TestLoader :-)

My first implementation actually was mostly the test loader. Two things made me 
change my mind and try to make the changes in the suite code:

- The loader code really only deals with loading (i.e., finding + importing) 
tests. Yes it expects a file pattern like "test*.py" for identifying test case 
files. But apart from that it didn't "feel" right to put name based selection 
there.
- In py.test you'll get a console output like "5 tests passed, 1 test failed, 
12 tests deselected". We can't get anything similar without making bigger 
changes to the test loader, runner, etc. code. Using skip() we at least have 
some info on "skipped" tests, although they're technically not skipped.

Are you still saying this should go to the test loader?

--

___
Python tracker 

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



[issue32094] _args_from_interpreter_flags() doesn't keep -X options

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset f39b674876d2bd47ec7fc106d673b60ff24092ca by Victor Stinner in 
branch 'master':
bpo-32094: Update subprocess for -X dev (#4480)
https://github.com/python/cpython/commit/f39b674876d2bd47ec7fc106d673b60ff24092ca


--

___
Python tracker 

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



[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le 21/11/2017 à 00:23, Jonas H. a écrit :
> 
> - The loader code really only deals with loading (i.e., finding + importing) 
> tests. Yes it expects a file pattern like "test*.py" for identifying test 
> case files. But apart from that it didn't "feel" right to put name based 
> selection there.

Take a look at TestLoader.loadTestsFromName().  It does much more than
look up test files, it can also look up individual classes or methods.

> - In py.test you'll get a console output like "5 tests passed, 1 test failed, 
> 12 tests deselected". We can't get anything similar without making bigger 
> changes to the test loader, runner, etc. code. Using skip() we at least have 
> some info on "skipped" tests, although they're technically not skipped.

I'm not sure what the point of displaying the number of "deselected"
tests is: that information doesn't sound very useful in itself.

But in any case, marking them skipped feels wrong to me.  Most often,
skipping a test is an indication that the current system is not fit to
run it (such as not enough RAM, or lacking a third-party library, or
being the wrong OS entirely).

> Are you still saying this should go to the test loader?

IMHO, yes.  Looking at your posted implementation, at least I don't
think TestSuite is the place for it.

--

___
Python tracker 

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



[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

If it helps, think of TestLoader as collecting tests, rather than simply 
loading Python modules.

--

___
Python tracker 

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



[issue2504] Add gettext.pgettext() and variants support

2017-11-20 Thread Éric Araujo

Éric Araujo  added the comment:

The patch would need to be applied on top of the current master to make a pull 
request.  Then, the tasks outlined in that message should be addressed:

https://bugs.python.org/issue2504#msg122439

--
assignee: loewis -> 

___
Python tracker 

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



[issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

The internal Python test runner "regrtest" already implements the feature as 
the -m MATCH option and --matchfile FILENAME option. It's implemented in 
test.support._match_file().

See bpo-31324 for a recent issue on this feature: performance issue (it's going 
to be fixed).

--
nosy: +vstinner

___
Python tracker 

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



[issue32098] Hardcoded value in Lib/test/test_os.py:L1324:URandomTests.get_urandom_subprocess()

2017-11-20 Thread hackan

New submission from hackan :

The value of `count` is hardcoded to 16 in 
https://github.com/python/cpython/blob/6a55d09573e5c35c9e4a24a6f811120b41a2a994/Lib/test/test_os.py#L1324

--
messages: 306602
nosy: hackan
priority: normal
severity: normal
status: open
title: Hardcoded value in 
Lib/test/test_os.py:L1324:URandomTests.get_urandom_subprocess()
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

Attached PR 4482 fixes warnings filters:

haypo@selma$ ./python -X dev -c 'import warnings, pprint; 
pprint.pprint(warnings.filters)'
[('ignore', None, , None, 0),
 ('always', None, , None, 0),
 ('default', None, , None, 0)]

--

___
Python tracker 

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



[issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


--
nosy: +pitrou

___
Python tracker 

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



[issue32094] _args_from_interpreter_flags() doesn't keep -X options

2017-11-20 Thread STINNER Victor

STINNER Victor  added the comment:

Thanks for the bug report Antoine, it's now fixed!

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



[issue32098] Hardcoded value in Lib/test/test_os.py:L1324:URandomTests.get_urandom_subprocess()

2017-11-20 Thread STINNER Victor

Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue32099] Use range in itertools roundrobin recipe

2017-11-20 Thread Terry J. Reedy

New submission from Terry J. Reedy :

The itertools roundrobin recipe has an outer loop executed a preset number of 
times.  It is currently implemented with two assignments and a while loop.
https://docs.python.org/3/library/itertools.html#itertools-recipes
These can be replaced with a for loop using a reversed range.

def roundrobin(*iterables):
"roundrobin('ABC', 'D', 'EF') --> A D E B F C"
nexts = cycle(iter(it).__next__ for it in iterables)
for current_len in reversed(range(1, len(iterables)+1)):
try:
for next in nexts:
yield next()
except StopIteration:
nexts = cycle(islice(nexts, current_len - 1))

I think this is easier to understand.  So do some other participants in the 
current python-ideas thread 'Rewriting the "roundrobin" recipe in the itertools 
documentation'.

I changed 'pending' to 'current_len' because, to me, 'pending' should be the 
set of iter_nexts and not their number.

I originally avoided the '-1' in the islice call by decrementing both range 
arguments by 1 and calling the loop variable 'reduced_len'.  But having the 
loop variable be the size of the nexts iterable in the next outer iteration 
seemed confusing and not worth the trivial efficiency gain.

An independent change would be to replace 'next' with 'iter' on the basis that 
reusing the builtin name is not good and because 'nexts' is awkward to 
pronounce.

I will produce a PR if any version is preferred to the current one.
---

The OP proposed, and some participants like, an accept-reject algorithm based 
on zip_longest.

def roundrobin(*iters):
"roundrobin('ABC', 'D', 'EF') --> A D E B F C"
# Perhaps "flat_zip_nofill" is a better name, or something similar
sentinel = object()
for tup in it.zip_longest(*iters, fillvalue=sentinel):
yield from (x for x in tup if x is not sentinel)

I dislike creating tuples we don't want, with values we don't want, with an 
arbitrarily small acceptance ratio.  I also note that zip_longest is properly 
used in grouper, whereas roundrobin is the only recipe using cycle.

--
assignee: docs@python
components: Documentation
messages: 306605
nosy: docs@python, rhettinger, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Use range in itertools roundrobin recipe
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue31672] string.Template should use re.ASCII flag

2017-11-20 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
pull_requests: +4420

___
Python tracker 

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



[issue32100] IDLE: PathBrowser isn't working

2017-11-20 Thread Cheryl Sabella

New submission from Cheryl Sabella :

Clicking on Path Browser in the File menu gives an error instead of opening the 
Path Browser.

--
assignee: terry.reedy
components: IDLE
messages: 306606
nosy: csabella, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: PathBrowser isn't working
type: crash
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



  1   2   >