[issue26553] Write HTTP in uppercase

2016-03-19 Thread Aatish Neupane

Changes by Aatish Neupane :


Added file: http://bugs.python.org/file42202/2_fix_3.5.patch

___
Python tracker 

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



[issue26576] Tweak wording of decorator docos

2016-03-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Guido, the discrepancy between the decorator doc's 'equivalent code' and 
actual, optimized, behavior with regard to skipping an intermediate binding of 
the function to the name came up soon after decorators were added.  I cannot 
find the issue, but as I remember, you said at the time that the doc's 
'equivalent' code was good enough, and perhaps that you did not want to force 
the optimization on other implementations (not sure of this latter).

This issue has come up often enough on Python list and SO that many think that 
the actual behavior should be documented.  But should it be documented as a 
guaranteed language feature or as just an optional optimization?

--
nosy: +gvanrossum, terry.reedy

___
Python tracker 

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



[issue18140] urlparse, urlsplit confused when password includes fragment (#), query (?)

2016-03-19 Thread Martin Panter

Changes by Martin Panter :


--
title: urlparse.urlsplit confused to fragment when password include # -> 
urlparse, urlsplit confused when password includes fragment (#), query (?)
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



[issue26575] lambda not closed on specific value in comprehension

2016-03-19 Thread Martin Panter

Martin Panter added the comment:

https://docs.python.org/3.5/faq/programming.html#why-do-lambdas-defined-in-a-loop-with-different-values-all-return-the-same-result

--
nosy: +martin.panter
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages

2016-03-19 Thread Eric Snow

Eric Snow added the comment:

Yeah, I've opened issue26584 to keep the matters separate.  We can address a 
more comprehensive cleanup there.

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



[issue26250] no document for sqlite3.Cursor.connection

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 52660878c833 by Ezio Melotti in branch '3.5':
#26250: document the sqlite3.Cursor.connection attribute.  Initial patches by 
Aviv Palivoda and Varpu Rantala.
https://hg.python.org/cpython/rev/52660878c833

New changeset 6fed752fd88e by Ezio Melotti in branch 'default':
#26250: merge with 3.5.
https://hg.python.org/cpython/rev/6fed752fd88e

New changeset 6dcf60bf855b by Ezio Melotti in branch '2.7':
#26250: document the sqlite3.Cursor.connection attribute.  Initial patches by 
Aviv Palivoda and Varpu Rantala.
https://hg.python.org/cpython/rev/6dcf60bf855b

--
nosy: +python-dev

___
Python tracker 

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



[issue26396] Create json.JSONType

2016-03-19 Thread Brett Cannon

Brett Cannon added the comment:

Here is a preliminary patch with docs. I didn't do any tests because I just 
don't know what kind of test we would want. Use isinstance() to make sure it 
covers the types we expect? And I'm not sure how to test the key type for 
mappings.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file42206/jsontype.diff

___
Python tracker 

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



[issue26553] Write HTTP in uppercase

2016-03-19 Thread Aatish Neupane

Changes by Aatish Neupane :


Added file: http://bugs.python.org/file42197/fix_2.7.patch

___
Python tracker 

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



[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2428d794b0e1 by Victor Stinner in branch 'default':
On ResourceWarning, log traceback where the object was allocated
https://hg.python.org/cpython/rev/2428d794b0e1

--
nosy: +python-dev

___
Python tracker 

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



[issue26257] Eliminate buffer_tests.py

2016-03-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti, serhiy.storchaka

___
Python tracker 

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



[issue22758] Regression in Python 3.2 cookie parsing

2016-03-19 Thread Berker Peksag

Berker Peksag added the comment:

I will commit this to the 3.2 branch today.

--
status: closed -> open

___
Python tracker 

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



[issue26583] test_timestamp_overflow of test_importlib fails if PYTHONDONTWRITEBYTECODE is set

2016-03-19 Thread Ned Deily

Ned Deily added the comment:

Ah, setting PYTHONDONTWRITEBYTECODE explains it.  When running the tests via 
"make test", python is invoked with -E to avoid issues like that.  But here's a 
patch that skips test_timestamp_overflow if bytecode files cannot be written 
(Issue20796 documents a similar problem and workaround for test_import).

--
components:  -Macintosh
keywords: +patch
nosy: +brett.cannon -ronaldoussoren
stage:  -> patch review
title: test_timestamp_overflow fails -> test_timestamp_overflow of 
test_importlib fails if PYTHONDONTWRITEBYTECODE is set
versions: +Python 3.5
Added file: http://bugs.python.org/file42189/issue26583.patch

___
Python tracker 

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



[issue26040] Improve coverage and rigour of test.test_math

2016-03-19 Thread Jeff Allen

Changes by Jeff Allen :


Added file: http://bugs.python.org/file42191/extra_cmath_testcases.py

___
Python tracker 

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



[issue26581] Double coding cookie

2016-03-19 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

When Python source file contains double coding cookies on different lines, the 
first wins. When it contains double coding cookies on the same line, the last 
wins.

PEP 263 was sufficiently vague about this. Now this is clarified 
(22490711c870). The first coding cookie should always win.

Proposed patch fixes Python tokenizer, the tokenize module, and other places. 
Tests are taken from issue25643.

--
components: Interpreter Core, Library (Lib)
files: tokenize_double_coding.patch
keywords: patch
messages: 261909
nosy: gvanrossum, haypo, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Double coding cookie
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file42185/tokenize_double_coding.patch

___
Python tracker 

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



[issue26572] urlparse does not handle passwords with ? in them.

2016-03-19 Thread Martin Panter

Martin Panter added the comment:

I think this is the same as Issue 18140. Perhaps you can answer my question at 
the bottom there about why the question mark is not encoded, and why splitting 
at the at (@) symbol should be higher priority than the query (?) symbol.

--
nosy: +martin.panter
resolution:  -> duplicate
status: open -> closed
superseder:  -> urlparse, urlsplit confused when password includes fragment 
(#), query (?)

___
Python tracker 

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



[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

Patch version 2:

- modify _tracemalloc._get_traces() to include domain in traces
- add tracemalloc.DomainFilter(domain)
- add domain optional parameter to tracemalloc.Filter constructor

Currently, Snapshot._group_by() ignores domain information. I don't know how 
the domain should be exposed, *if* it should be exposed.

By the way, maybe we don't need to export the domain at the Python level at 
all? (Don't expose it in _tracemalloc._get_traces()).

--
Added file: http://bugs.python.org/file42210/tracemalloc-2.patch

___
Python tracker 

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



[issue26252] Add an example to importlib docs on setting up an importer

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dc24ab548e2b by Brett Cannon in branch 'default':
Issue #26252: Add an example on how to register a finder
https://hg.python.org/cpython/rev/dc24ab548e2b

--
nosy: +python-dev

___
Python tracker 

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



[issue25720] Fix curses module compilation with ncurses6

2016-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I suspect that the patch can break build with non-ncurses implementations or 
with old ncurses (when is_pad() was added?). Needed more direct feature check.

--

___
Python tracker 

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



[issue26530] tracemalloc: add C API to manually track/untrack memory allocations

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

> So you guarantee tracemalloc itself won't use such a hack for other
purposes? ;-)

Hum, maybe we can make the "hack" "official": add two C macro to store and 
retrieve the domain from a pointer. The macro can validate that the domain is 
smaller or equal to 8 using an assertion (only in debug mode?).

--

___
Python tracker 

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



[issue26583] test_timestamp_overflow fails

2016-03-19 Thread SilentGhost

Changes by SilentGhost :


--
components: +Macintosh, Tests
nosy: +ned.deily, ronaldoussoren
type:  -> behavior

___
Python tracker 

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



[issue26543] imaplib noop Debug

2016-03-19 Thread gigaplastik

Changes by gigaplastik :


--
nosy: +gigaplastik

___
Python tracker 

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



[issue26040] Improve coverage and rigour of test.test_math

2016-03-19 Thread Jeff Allen

Changes by Jeff Allen :


Removed file: http://bugs.python.org/file42190/stat_math.py

___
Python tracker 

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



[issue26574] replace_interleave can be optimized for single character byte strings

2016-03-19 Thread Josh Snider

New submission from Josh Snider:

replace_interleave in Objects/bytesobject.c and Objects/bytearrayobject.c can 
be optimized for the special case where the interleaving byte string is a 
single character.

Here's some quick results from timeit showing that it's about three times 
faster for the special case.
* Before (cold start):
>>> timeit.timeit('(b"x" * 200).replace(b"", b".")', number=1000)
7.619218342995737
* After (cold start):
>>> timeit.timeit('(b"x" * 200).replace(b"", b".")', number=1000)
2.7605581780080684

For the non-special case, running timeit.timeit('(b"x" * 200).replace(b"", 
b".0")', number=1) takes ~173 seconds on both versions.

--
components: Library (Lib)
files: bytes.patch
keywords: patch
messages: 261870
nosy: Josh Snider
priority: normal
severity: normal
status: open
title: replace_interleave can be optimized for single character byte strings
type: performance
versions: Python 3.6
Added file: http://bugs.python.org/file42179/bytes.patch

___
Python tracker 

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



[issue26257] Eliminate buffer_tests.py

2016-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It looks to me that all tests from CommonTest except test_capitalize_nonascii 
can be merged into BaseTest.

A number of tests from MixinStrUnicodeUserStringTest could be applied to bytes 
and bytearray too.

I think we should left only two classes in string_tests: common tests for str, 
UserString, bytes and bytearray, and common tests for str and UserString that 
are not applicable to bytes and bytearray.

--

___
Python tracker 

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



[issue26587] Possible duplicate entries in sys.path if .pth files are used with zip's

2016-03-19 Thread Mandeep Singh Grang

Mandeep Singh Grang added the comment:

Here is a testcase to reproduce the issue:

> cat test.py
import site, sys
site.addsitedir('/foo/bar')
print (sys.path)

This prints just a single instance of '/foo/bar':

['/local/mnt/workspace/python/tst', '/foo/bar', '/usr/local/lib/python36.zip', 
'/local/mnt/workspace/python/src/Lib', 
'/local/mnt/workspace/python/src/Lib/plat-linux', 
'/local/mnt/workspace/python/build/build/lib.linux-x86_64-3.6-pydebug']

Now if we explicitly set PYTHONPATH to include '/foo/bar'
> export PYTHONPATH=/foo/bar

and then run test.py here is the output:

['/local/mnt/workspace/python/tst', '/foo/bar', '/usr/local/lib/python36.zip', 
'/local/mnt/workspace/python/src/Lib', 
'/local/mnt/workspace/python/src/Lib/plat-linux', 
'/local/mnt/workspace/python/build/build/lib.linux-x86_64-3.6-pydebug', 
'/foo/bar']

We see that there are duplicate entries for '/foo/bar'.

As Wolfgang rightly said the issue comes from the check for
"if os.path.isdir(dir)" inside _init_pathinfo() in site.py.
On removing this check I no longer see the duplicate entry for '/foo/bar'.

But since this is the first bug I am looking at I am not sure of the 
implications of removing this check. Can someone please confirm that what I see 
is indeed a failing test case, or is this the intended behavior?

Thanks,
Mandeep

--
nosy: +Mandeep Singh Grang

___
Python tracker 

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



[issue26578] Bad BaseHTTPRequestHandler response when using HTTP/0.9

2016-03-19 Thread Xiang Zhang

Xiang Zhang added the comment:

I think you are right. Simply run http.server.test() and then telnet to send 
"GET /", the client hangs. Or add a timeout to BaseHTTPRequestHandler, you can 
see the timeout error on server output.

--

___
Python tracker 

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



[issue17603] AC_LIBOBJ replacement of fileblocks

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset acbeb33dc76a by Martin Panter in branch '2.7':
Issue #17603: Check for st_blocks field without requiring fileblocks.o
https://hg.python.org/cpython/rev/acbeb33dc76a

New changeset 0774398c3433 by Martin Panter in branch '3.5':
Issue #17603: Check for st_blocks field without requiring fileblocks.o
https://hg.python.org/cpython/rev/0774398c3433

New changeset 628bd1ebfa22 by Martin Panter in branch 'default':
Issue #17603: Merge configure.ac fix from 3.5
https://hg.python.org/cpython/rev/628bd1ebfa22

--
nosy: +python-dev

___
Python tracker 

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



[issue26576] Tweak wording of decorator docos

2016-03-19 Thread Georg Brandl

Georg Brandl added the comment:

(Also, toggled your "is committer" bit so you get the Python logo next to your 
name.)

--

___
Python tracker 

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



[issue26470] Make OpenSSL module compatible with OpenSSL 1.1.0

2016-03-19 Thread Christian Heimes

Christian Heimes added the comment:

Here is a first working patch. It requires 1.1.0-pre4. The failing ALPN test is 
caused by a regression in OpenSSL.

--
keywords: +patch
stage: needs patch -> patch review
versions: +Python 3.6
Added file: 
http://bugs.python.org/file42184/0001-Port-Python-s-SSL-module-to-OpenSSL-1.1.0-WIP.patch

___
Python tracker 

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



[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

It looks like io.FileIO has a strong implementation of the destructor. If the 
object becomes alive again because of random code called in the destructor, the 
object is not removed.

socket and os.scandir have a classical unsafe destructor.

Moreover, I'm no more sure about the chosen design. When 
warnings.catch_warnings() is used and an unclosed io.FileIO is destroyed, the 
object is kept alive because it is stored in the "source" attribute of a 
warnings.WarningMessage.

I don't know if keeping WarningMessaging alive longer than the call to 
showwarning() (or _showarnmsg) is a common use case or not. The issue #26568 
wants to promote the WarningMessage class, so some users may start to keep it 
alive.

An alternative is to format the object traceback and pass the traceback to 
WarningMessage. It requires to decide the format of the traceback (list of ..., 
string, something else?).

--

___
Python tracker 

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



[issue26577] inspect.getclosurevars returns incorrect variable when using class member with the same name as other variable

2016-03-19 Thread Ryan Fox

New submission from Ryan Fox:

If a variable 'x' exists in the global or local scope, and a function (also 
defined in the same scope as 'x', or lower) refers only to a member named 'x' 
of an object, inspect.getclosurevars will include a reference to the variable, 
rather than the member.

Okay, that's kind of confusing to describe, so here's a small example in code 
form:

import inspect

class Foo:
x = int()

x = 1
f = Foo()
assert(f.x != x)

func = lambda: f.x == 0
assert(func())

cv = inspect.getclosurevars(func)
assert(cv.globals['f'] == f)
assert(cv.globals.get('x') != x) # <--- Assertion fails


It is expected that 'x' would not exist in cv.globals, since func does not 
refer to it. Also, there should be a 'f.x' included somewhere in the 
ClosureVariables object returned.

--
components: Library (Lib)
messages: 261897
nosy: Ryan Fox
priority: normal
severity: normal
status: open
title: inspect.getclosurevars returns incorrect variable when using class 
member with the same name as other variable
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue26553] Write HTTP in uppercase

2016-03-19 Thread Aatish Neupane

Changes by Aatish Neupane :


Added file: http://bugs.python.org/file42198/fix_3.5.patch

___
Python tracker 

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



[issue26519] Cython doesn't work anymore on Python 3.6

2016-03-19 Thread Stefan Behnel

Stefan Behnel added the comment:

Our CI build server says it's all fine. The fix will eventually be released, 
certainly before Py3.6 comes out.

--

___
Python tracker 

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



[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

I used this patch to identify a ResourceWarning in test_faulthandler when the 
test is interrupted by CTRL+c: it's really efficient!

I will be very useful to identify all ResourceWarning that I saw in 
test_asyncio, like the ones seen on the AIX buildbot.

--

___
Python tracker 

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



[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

When warnings._showwarnmsg(), the io.FileIO object is not closed yet, so all 
attributes are accessible, which can be useful. Hopefully, the file is closed 
even if it is kept alive by the warning logger. So maybe it's ok to keep the 
Python object alive, if the underlying resource (the file descriptor) is 
released. I mean, it's not a big deal.

--

___
Python tracker 

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



[issue26578] Bad BaseHTTPRequestHandler response when using HTTP/0.9

2016-03-19 Thread Xiang Zhang

Xiang Zhang added the comment:

can should be can not.

And not only HTTPConnection, support for HTTP/0.9 seems to have been totally 
abandoned since Python3.4 in http.client.

--

___
Python tracker 

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



[issue10721] Remove HTTP 0.9 server support

2016-03-19 Thread Martin Panter

Martin Panter added the comment:

Also I guess documentation should be added somewhere, even if there is no 
deprecation step.

--

___
Python tracker 

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



[issue26270] Support for read()/write()/select() on asyncio

2016-03-19 Thread Paulo Costa

Paulo Costa added the comment:

Thanks for the replies.

What I'm actually trying to do is to access from a character file from 
/dev/input/event*.

Streams are pretty much what I want to use but (as far as I can tell) asyncio's 
streams only support network and unix sockets. Files are left behind.

Anyway, despite the existence of streams and protocols, I still believe that 
`asyncio.read()`, `asyncio.write()` and `asyncio.select()` would be 
nice-to-have low-level APIs.

--

___
Python tracker 

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



[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

> Also, Numba allows use of the Numpy API (part thereof, anyway) on GPUs.

Do you mean that Numba requires supporting multiple address spaces to be able 
to use tracemalloc? Or that supporting multiple address spaces would also to 
*also* track GPU memory allocations?

A friend told me that CUDA, OpenGL and OpenCL can (should?) be seen as 3 
different address spaces. These libraries don't expose directly addresses in 
the GPU address space, but may use handles.

--

___
Python tracker 

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



[issue26556] Update expat to 2.2.1

2016-03-19 Thread Christian Heimes

Christian Heimes added the comment:

No, the other problem is CVE-2016-0718. We are still looking into the matter.

--

___
Python tracker 

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



[issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks

2016-03-19 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue26246] Code output toggle button uses removed jQuery method

2016-03-19 Thread Ezio Melotti

Ezio Melotti added the comment:

Thanks both for spotting the bug and fixing it!

--

___
Python tracker 

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



[issue26313] ssl.py _load_windows_store_certs fails if windows cert store is empty

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset eb2c2671e7d6 by Steve Dower in branch '3.5':
Issue #26313: ssl.py _load_windows_store_certs fails if windows cert store is 
empty. Patch by Baji.
https://hg.python.org/cpython/rev/eb2c2671e7d6

New changeset 97cd199944c3 by Steve Dower in branch 'default':
Issue #26313: ssl.py _load_windows_store_certs fails if windows cert store is 
empty. Patch by Baji.
https://hg.python.org/cpython/rev/97cd199944c3

--

___
Python tracker 

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



[issue26530] tracemalloc: add C API to manually track/untrack memory allocations

2016-03-19 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 18/03/2016 04:57, Nathaniel Smith a écrit :
> 
> What I'm talking about is different: I think it should be possible
> to
re-use the tracemalloc infrastructure to track other resources besides
"heap allocations". So for my use case, it's crucial that we index by
(domain, pointer), because the address 0xdeadbeef on the heap is
different from the address 0xdeadbeef on the GPU. We'll never want to
group by pointer alone without the domain, because that would cause us
to actually misinterpret the data (if I do PyMem_Track("gpu",
0xdeadbeef); PyMem_Untrack("heap", 0xdeadbeef), then this should not
cause tracemalloc to forget about the gpu allocation! I think this is
very different than your C backtrace example).

FWIW, LLVM calls the "domain" "address space", and simply uses an
integer for it (0 being the default CPU-addressable address space).  You
can probably restrict yourself to 8-bit address spaces...

--

___
Python tracker 

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



[issue26586] Simple enhancement to BaseHTTPRequestHandler

2016-03-19 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks for your review. I have made some changes according to it.

Status code 431 is returned when the header line is too long or there are too 
many headers. And I think the short message is OK and we can provide the 
exception message in the content message.

As for the style, I don't know why I made that change. Quite sorry for make the 
noise.

--
Added file: http://bugs.python.org/file42200/simple_enhancement_v2.patch

___
Python tracker 

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



[issue26530] tracemalloc: add C API to manually track/untrack memory allocations

2016-03-19 Thread Nathaniel Smith

Nathaniel Smith added the comment:

There are other leakable resources besides heap and GPU memory -- shmem 
segments and file descriptors are two that I thought of earlier, but there are 
probably others too. (Note that not all file descriptors are associated with a 
python file object.) I guess one could hack most of these things into pointer 
bit tricks somehow, but I don't really see the appeal myself :-). It's fine for 
an internal implementation trick, but a very pythonic public api...

> Tracemalloc doesn't give access to pointers in its API, so it shouldn't 
> matter.

This is actually a problem with this scheme... One would like to be able to get 
separate statistical reports for different resources.

Also, tracemalloc is awesome (really), but there are potentially other 
consumers of the hookable allocation scheme too that might choose to expose 
more or less information; we shouldn't forget about them entirely :-)

--

___
Python tracker 

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



[issue26519] Cython doesn't work anymore on Python 3.6

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

> Our CI build server says it's all fine. The fix will eventually be released, 
> certainly before Py3.6 comes out.

Ok, fine :-)

--
resolution:  -> third party
status: open -> closed

___
Python tracker 

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



[issue26563] PyMem_Malloc(): check that the GIL is hold in debug hooks

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ce62df22f3bf by Victor Stinner in branch '3.5':
Py_FatalError: disable faulthandler earlier
https://hg.python.org/cpython/rev/ce62df22f3bf

--

___
Python tracker 

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



[issue26585] Use html.escape to replace _quote_html in http.server

2016-03-19 Thread Xiang Zhang

Xiang Zhang added the comment:

make some change to test for html escape in SimpleHTTPRequestHandler

--
Added file: http://bugs.python.org/file42205/_quote_html_to_html_escape_v3.patch

___
Python tracker 

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



[issue26250] no document for sqlite3.Cursor.connection

2016-03-19 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the report and the patches!

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



[issue26553] Write HTTP in uppercase

2016-03-19 Thread Aatish Neupane

Aatish Neupane added the comment:

I found some other similar errors with the suggestion from the patch review. I 
have uploaded the new patches as 2_fix* .

--

___
Python tracker 

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



[issue26573] Method Parameters can be Accepted as Keyword Arguments?

2016-03-19 Thread G Young

New submission from G Young:

This issue arose as we were making changes to the 'pandas' library. I am not 
sure if this is a bug or feature, but it definitely did not cross anyone's 
minds when discussing the PR at hand. I have attached a code sample to 
illustrate the "bug" that I have run successfully on Python 2.7 and Python 3.4.

--
components: Interpreter Core
files: bug.py
messages: 261862
nosy: G Young
priority: normal
severity: normal
status: open
title: Method Parameters can be Accepted as Keyword Arguments?
type: behavior
versions: Python 2.7, Python 3.4
Added file: http://bugs.python.org/file42178/bug.py

___
Python tracker 

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



[issue23239] SSL match_hostname does not accept IP Address

2016-03-19 Thread Marc Abramowitz

Marc Abramowitz added the comment:

Patch to update the comment to remove "IP addresses are not accepted for 
*hostname*", because supported for IP addresses was added earlier by @pitrou in 
https://hg.python.org/cpython/rev/b15a5f239e8a

--
nosy: +Marc.Abramowitz
Added file: http://bugs.python.org/file42186/ip_certs_comment.patch

___
Python tracker 

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



[issue26252] Add an example to importlib docs on setting up an importer

2016-03-19 Thread Brett Cannon

Brett Cannon added the comment:

I added an example on how to register both a meta path and path entry finder. 
It's a rather simple example, but hopefully using the classes that importlib 
uses will help also point people towards the appropriate classes to learn about 
for their own needs.

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

___
Python tracker 

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



[issue26586] Simple enhancement to BaseHTTPRequestHandler

2016-03-19 Thread Xiang Zhang

New submission from Xiang Zhang:

This patch propose several simple enhancement to BaseHTTPRequestHandler. It 
removes some redundant code and add handler for too many headers.

--
components: Library (Lib)
files: simple_enhancement.patch
keywords: patch
messages: 261946
nosy: xiang.zhang
priority: normal
severity: normal
status: open
title: Simple enhancement to BaseHTTPRequestHandler
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42196/simple_enhancement.patch

___
Python tracker 

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



[issue26570] comma-separated cookies with expires header do not parse properly

2016-03-19 Thread SilentGhost

SilentGhost added the comment:

This is not a regression and you can see that if you do

print(SimpleCookie('A=B; expires=Thu, 01-Jan-1970 00:00:00 GMT, C=D'))

The values of expires and Path attribute were parsed incorrectly, even though 
you got two cookies. The problem as far as I can see is a non-standard 
separator between attributes that you're trying to use, i.e. a comma. If you 
were to use a semi-colon (or a space) there would not be a problem in any of 
the versions.

--
nosy: +SilentGhost
resolution:  -> not a bug
stage:  -> 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



[issue26580] Documentation for ftplib still references ftpmirror.py

2016-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 23ad18068814 by Berker Peksag in branch '3.5':
Issue #26580: Remove outdated reference to ftpmirror
https://hg.python.org/cpython/rev/23ad18068814

New changeset 48e106bf2add by Berker Peksag in branch 'default':
Issue #26580: Remove outdated reference to ftpmirror
https://hg.python.org/cpython/rev/48e106bf2add

--
nosy: +python-dev

___
Python tracker 

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



[issue26585] Use html.escape to replace _quote_html in http.server

2016-03-19 Thread Xiang Zhang

Xiang Zhang added the comment:

The uploaded patch is updated. Hope you have time to review.

--
Added file: http://bugs.python.org/file42218/_quote_html_to_html_escape_v4.patch

___
Python tracker 

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



[issue10721] Remove HTTP 0.9 server support

2016-03-19 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support packages

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

>Hmm. These two should be equivalent:
> if spec.loader.is_package(fullmodule): ...

The problem is that spec.loader is None when test is a package.

It's easy to reproduce the issue:

$ rm -f Lib/test/__init__.py Lib/test/__pycache__/__init__.cpython-36.pyc
$ ./python -m test -v -m test_decorators test_pyclbr
..
==
ERROR: test_decorators (test.test_pyclbr.PyclbrTest)
--
Traceback (most recent call last):
  ...
  File "/home/haypo/prog/python/default/Lib/pyclbr.py", line 145, in _readmodule
fname = spec.loader.get_filename(fullmodule)
AttributeError: 'NoneType' object has no attribute 'get_filename'

--

___
Python tracker 

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



[issue26576] Tweak wording of decorator docos

2016-03-19 Thread Chris Angelico

Chris Angelico added the comment:

The remaining difference that's actually of use, perhaps. But the decoration 
itself happens before the name is bound. It's impossible to describe in Python 
code; but it can be probed - you can monkeypatch a class using a decorator:

def monkeypatch(cls):
orig = globals()[cls.__name__] # Undocumented magic
print("Monkeypatch",id(cls),"into",id(orig))
for attr in dir(cls):
if not attr.startswith("_"):
setattr(orig,attr,getattr(cls,attr))
return orig

class Foo:
def method1(self):
print("I am method 1")

print("Foo is currently",id(Foo))
some_object = Foo()

@monkeypatch
class Foo:
def method2(self):
print("I am method 2")

print("Foo is now",id(Foo))

some_object.method1()
some_object.method2()



Is this undocumented behaviour? Should it be supported? It works on every 
Python I've tried it on (CPython 2.7 and 3.6, PyPy2 and PyPy3, Jython, and 
MicroPython), but it's not something I'd depend on in production code unless 
it's documented.

--

___
Python tracker 

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



[issue26585] Use html.escape to replace _quote_html in http.server

2016-03-19 Thread Xiang Zhang

Xiang Zhang added the comment:

At first I also want to use html.escape(..., quote=False) since the spec only 
asks to escape quote signs in attribute. But after some search on Google, there 
are articles recommends escaping quote in content too: 
https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet

--

___
Python tracker 

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



[issue25609] Add a ContextManager ABC and type

2016-03-19 Thread Guido van Rossum

Guido van Rossum added the comment:

Agreed on all points with Nick.  We can add ContextManager (not 
ContextManagerType) to typing.py in 3.5.2 (it's provisional).

--

___
Python tracker 

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



[issue24959] unittest swallows part of stack trace when raising AssertionError in a TestCase

2016-03-19 Thread Robert Collins

Changes by Robert Collins :


--
stage: needs patch -> test needed

___
Python tracker 

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



[issue26581] Double coding cookie

2016-03-19 Thread Guido van Rossum

Guido van Rossum added the comment:

Right. Please go ahead with both. I am fine with defining the current
behavior correct.

--Guido (mobile)
On Mar 19, 2016 9:37 AM, "Serhiy Storchaka"  wrote:

>
> Serhiy Storchaka added the comment:
>
> Yes, I have. But I were not sure what behavior should be correct in
> Python. On one side, always choosing the first declaration (on the same or
> on different lines) looks more consistent. On other side, current behavior
> was in CPython from the initial implementing PEP 263 in issue526840 and it
> matches Emacs behavior (if I understand this correctly).
>
> I can update the regular expression, but may be this obscure corner case
> needs the verbal explanation.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue26546] Provide translated french translation on docs.python.org

2016-03-19 Thread Julien

Julien added the comment:

You're right Terry, I posted on python ideas in case someone comes with a good 
idea, I also explained my vision in a lot of details to gather the widest 
feedback possible on each point that came to my mind:

https://mail.python.org/pipermail/python-ideas/2016-March/038879.html

--

___
Python tracker 

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



[issue21042] ctypes.util.find_library() should return full pathname instead of filename in linux

2016-03-19 Thread Martin Panter

Martin Panter added the comment:

I reverted the change until we can come up with something more consistent.

--
stage: commit review -> needs patch

___
Python tracker 

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



[issue26581] Double coding cookie

2016-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, I have. But I were not sure what behavior should be correct in Python. On 
one side, always choosing the first declaration (on the same or on different 
lines) looks more consistent. On other side, current behavior was in CPython 
from the initial implementing PEP 263 in issue526840 and it matches Emacs 
behavior (if I understand this correctly).

I can update the regular expression, but may be this obscure corner case needs 
the verbal explanation.

--

___
Python tracker 

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



[issue26240] Docstring of the subprocess module should be cleaned up

2016-03-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +easy
nosy: +ezio.melotti
type:  -> enhancement

___
Python tracker 

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



[issue26581] Double coding cookie

2016-03-19 Thread Guido van Rossum

Guido van Rossum added the comment:

Do you have write permission to the PEP? Just update it.

--

___
Python tracker 

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



[issue25720] Fix curses module compilation with ncurses6

2016-03-19 Thread Ismail Donmez

Ismail Donmez added the comment:

ping?

--

___
Python tracker 

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



[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-19 Thread STINNER Victor

New submission from STINNER Victor:

The tracemalloc module uses a hashtable: pointer (void*) => trace. Some 
embedded devices use multiple address spaces. Each GPU also has its own address 
space. CUDA, OpenCL and OpenGL should also be seen as different address spaces.

In the issue #26530, it was proposed (required?) to support multiple addresses 
spaces to be able to use tracemalloc in numpy.

Attached patch enhances tracemalloc to use (pointer: void*, domain: unsigned 
int) as key in the hashtable. A (pointer, domain) key is stored in a hashtable 
entry.

In the patch, the domain is hardcoded to 0, but the issue #26530 will add new C 
functions to track/untrack memory blocks, and this new functions will have a 
domain parameter.

The patch changes how a key is passed to the hashtable API: pass a *pointer* to 
a key rather than directly the key value. Because of that, the patch is quite 
long.

The patch also removes the unused function _Py_hashtable_hash_int().

_Py_HASHTABLE_ENTRY_DATA() macro now requires the hashtable to get the key 
size, since the offset of data now depends on the key size.

--
components: Extension Modules
files: tracemalloc.patch
keywords: patch
messages: 261997
nosy: haypo, njs, pitrou
priority: normal
severity: normal
status: open
title: _tracemalloc: add support for multiple address spaces (domains)
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42207/tracemalloc.patch

___
Python tracker 

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



[issue17167] python man page contains $Date$ in page footer

2016-03-19 Thread Charalampos Stratakis

Changes by Charalampos Stratakis :


--
versions: +Python 3.5

___
Python tracker 

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



[issue26581] Double coding cookie

2016-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I just tested with Emacs, and it looks that when specify different codings on 
two different lines, the first coding wins, but when specify different codings 
on the same line, the last coding wins.

Therefore current CPython behavior can be correct, and the regular expression 
in PEP 263 should be changed to use greedy repetition.

--
nosy: +lemburg, loewis

___
Python tracker 

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



[issue26584] pyclbr module needs to be more flexible on loader support

2016-03-19 Thread Eric Snow

New submission from Eric Snow:

(see issue26569)

The pyclbr module is showing its age (born 1995).  It assumes there are only 2 
module types (builtin and source-based), particularly in readmodule() and 
readmodule_ex().  Really it should be source-based and "everything else".

For instance, it does not handle namespace packages correctly, since the 
spec.loader is set to None there.  It also doesn't handle frozen modules (e.g. 
"./python Lib/pyclbr.py _frozen_importlib").  This is likewise a problem for 
other/custom loaders that don't match the expectations of pyclbr.

Here are some things that should be done:

* replace custom introspection code with newer tools like 
importlib.util.module_from_spec()
* special-case namespace modules (since their spec.loader is None); this is 
probably a moot point if module_from_spec() gets used
* ignore more than just builtins; explicitly check for 
importlib.abc.SourceLoader?
* make use of similar tools in the inspect module?

--
components: Library (Lib)
messages: 261924
nosy: brett.cannon, eric.snow, ncoghlan
priority: normal
severity: normal
stage: test needed
status: open
title: pyclbr module needs to be more flexible on loader support
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-03-19 Thread Stefan Behnel

Stefan Behnel added the comment:

Ah, thanks. Here's my implementation then:

https://github.com/cython/cython/pull/499/files

It seems that tests for valid complex literals are missing. I've added these to 
the end of the list:

'1_00_00.5j',
'1_00_00.5e5',
'1_00_00j',
'1_00_00e5_1',
'1e1_0',
'.1_4',
'.1_4e1',
'.1_4j',

--

___
Python tracker 

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



[issue26583] test_timestamp_overflow fails

2016-03-19 Thread Ned Deily

Ned Deily added the comment:

Sorry, I am unable to reproduce this on either 10.9.5 or current 10.11.3 OS X 
systems.  Is there something unusual about the working directory you are 
running the tests from, like residing on an NFS or other networked file system? 
 Any special ./configure options?  Does the test always fail?

--

___
Python tracker 

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



[issue26283] zipfile can not handle the path build by os.path.join()

2016-03-19 Thread Ezio Melotti

Ezio Melotti added the comment:

I don't think this is a bug.  The ZIP format specification requires the use of 
forward slashes[0]:

   4.4.17 file name: (Variable)

   4.4.17.1 The name of the file, with optional relative path.
   The path stored MUST not contain a drive or
   device letter, or a leading slash.  All slashes
   MUST be forward slashes '/' as opposed to
   backwards slashes '\' for compatibility with Amiga
   and UNIX file systems etc.

os.path.join() will use different path separators depending on the system.  If 
you don't want to hardcode the slashes in a string literal, you can simply use 
'/'.join(...) instead of os.path.join().

[0]: https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

--
nosy: +ezio.melotti
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



[issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages

2016-03-19 Thread Eric Snow

Eric Snow added the comment:

And thanks for addressing this here. :)

--

___
Python tracker 

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



[issue26592] _warnings.warn_explicit() should try to import the warnings module

2016-03-19 Thread STINNER Victor

New submission from STINNER Victor:

The issue #26567 enhanced the warnings module to pass the destroyed object on 
ResourceWarning. The implementation to log the traceback where the object was 
allocated is non trivial, so I chose to only implement it in Python.

Problem: _warnings.warn_explicit() is lazy, it tries to get the warnings module 
from sys.modules, but it uses its own logger if the warnings is not imported 
yet.

As a consequence, the traceback where the object was allocated is only logged 
if tracemalloc is tracing Python memory allocations *and* if the warnings 
module is already imported.

I suggest to modify _warnings.warn_explicit() to import the warnings if it's 
not imported yet.

There are maybe issues to import a module during Python finalization? A 
comprise is to not try to import when Python finalization has started.

Example:
---
#import warnings
import tracemalloc
tracemalloc.start(10)
f = open("/etc/issue")
f = None
---

Current output:
---
x.py:5: ResourceWarning: unclosed file <_io.TextIOWrapper name='/etc/issue' 
mode='r' encoding='UTF-8'>
  f = None
---

Output if you uncomment the "import warnings":
---
x.py:5: ResourceWarning: unclosed file <_io.TextIOWrapper name='/etc/issue' 
mode='r' encoding='UTF-8'>
  f = None
Object allocated at (most recent call first):
  File "x.py", lineno 4
f = open("/etc/issue")
---

Attached patch tries to import warnings if source object is set but not after 
the Pythin finalization has started.

--
files: warnings_import.patch
keywords: patch
messages: 262049
nosy: haypo
priority: normal
severity: normal
status: open
title: _warnings.warn_explicit() should try to import the warnings module
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42217/warnings_import.patch

___
Python tracker 

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



[issue26590] socket destructor: implement finalizer

2016-03-19 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 19/03/2016 14:07, STINNER Victor a écrit :
> 
> Example:
> ---
> import socket
> s=socket.socket()
> s=None
> ---
> 
> With this code, sock_finalize() is called before sock_dealloc():
> 
> #0  sock_finalize (s=0x70730c28) at
> /home/haypo/prog/python/default/Modules/socketmodule.c:4172
> #1  0x004d8f59 in PyObject_CallFinalizer (self= remote 0x70730c28>) at Objects/object.c:294
> #2  0x004d8fcd in PyObject_CallFinalizerFromDealloc
> (self=) at Objects/object.c:311
> #3  0x004f2c8f in subtype_dealloc (self= 0x70730c28>) at Objects/typeobject.c:1154

Ah, that's probably because socket.socket is a Python subclass.
What happens if you use _socket.socket directly instead?

--

___
Python tracker 

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



[issue26590] socket destructor: implement finalizer

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

Antoine Pitrou added the comment:
> Ah, that's probably because socket.socket is a Python subclass.
> What happens if you use _socket.socket directly instead?

Oh, I forgot this sublte implementation detail, _socket.socket base
class vs socket.socket sublcass.

Example with _socket:
---
import _socket
s=_socket.socket()
s=None
---

Ok, in this case sock_finalize() is called by sock_dealloc().
---
#0  sock_finalize (s=0x77eaad60) at
/home/haypo/prog/python/default/Modules/socketmodule.c:4172
#1  0x004d8f59 in PyObject_CallFinalizer (self=<_socket.socket
at remote 0x77eaad60>) at Objects/object.c:294
#2  0x004d8fcd in PyObject_CallFinalizerFromDealloc
(self=<_socket.socket at remote 0x77eaad60>) at
Objects/object.c:311
#3  0x704e326a in sock_dealloc (s=0x77eaad60) at
/home/haypo/prog/python/default/Modules/socketmodule.c:4192
#4  0x004dc8ae in _Py_Dealloc (op=<_socket.socket at remote
0x77eaad60>) at Objects/object.c:1783
---

--

___
Python tracker 

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



[issue26580] Documentation for ftplib still references ftpmirror.py

2016-03-19 Thread SilentGhost

SilentGhost added the comment:

This patch removes the offending paragraph.

--
keywords: +patch
nosy: +SilentGhost
stage:  -> patch review
type:  -> behavior
versions: +Python 3.6
Added file: http://bugs.python.org/file42187/issue26580.diff

___
Python tracker 

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



[issue13601] sys.stderr should always be line-buffered

2016-03-19 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue26590] socket destructor: implement finalizer

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

@Antoine: Since you wrote the PEP 442, would you reviewing sock_finalize.patch?

I'm only interested to modify Python 3.6, the bug was only trigerred when I 
changed the code to log a warning. Before, the socket object was not passed to 
the warning logger so it worked fine.

--

___
Python tracker 

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



[issue26590] socket destructor: implement finalizer

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

2016-03-19 11:05 GMT+01:00 Antoine Pitrou :
> sock_finalize() is only called explicitly if there is a reference cycle. This 
> is why sock_dealloc() has to call it.

I'm fine with keeping sock_dealloc() to call sock_finalize(), but I
would like to understand.

Example:
---
import socket
s=socket.socket()
s=None
---

With this code, sock_finalize() is called before sock_dealloc():

#0  sock_finalize (s=0x70730c28) at
/home/haypo/prog/python/default/Modules/socketmodule.c:4172
#1  0x004d8f59 in PyObject_CallFinalizer (self=) at Objects/object.c:294
#2  0x004d8fcd in PyObject_CallFinalizerFromDealloc
(self=) at Objects/object.c:311
#3  0x004f2c8f in subtype_dealloc (self=) at Objects/typeobject.c:1154
#4  0x004dc8ae in _Py_Dealloc (op=) at Objects/object.c:1783

--

___
Python tracker 

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



[issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages

2016-03-19 Thread Eric Snow

Eric Snow added the comment:

Well, your patch is correct even if not ideal. :)  Landing it as a short-term 
solution is fine.  Just keep this issue open so we can address the problem more 
completely later.

--
components: +Interpreter Core
stage:  -> commit review
type:  -> behavior

___
Python tracker 

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



[issue25609] Add a ContextManager ABC and type

2016-03-19 Thread Nick Coghlan

Nick Coghlan added the comment:

* the ABC should have a structural __issubclass__ check looking for __enter__ 
and __exit__ methods

* I agree with making __exit__ abstract (if you don't define it, you don't need 
a context manager), but does __enter__ need to be abstract? The "return self" 
default is a good one in many cases where the resource is acquired in __new__ 
or __init__.

* the docs for the ABC are potentially confusing, as they describe what the 
default implementation does, without making it clear that it's only the default 
implementation and *permitted* return behaviour is more flexible than that.

* I'd prefer not to have contextlib depend on typing, so the generic type 
definition should probably be in the typing module (similar to the abc-vs-type 
split for collections). That should also make backporting easier - the ABC can 
go back via contextlib2, while the generic type can go back via the 
comment-based typehinting variant

--

___
Python tracker 

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



[issue26585] Use html.escape to replace _quote_html in http.server

2016-03-19 Thread Xiang Zhang

Xiang Zhang added the comment:

Oops. You have already left new comment. No notify either. :(

I like the idea that extract the actual encoding from response header. I will 
update my patch then.

--

___
Python tracker 

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



[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-03-19 Thread Georg Brandl

Georg Brandl added the comment:

The last patch isn't up to date with the PEP; Serhiy's patch is the closest one.

--

___
Python tracker 

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



[issue26579] Support pickling slots in subclasses of common classes

2016-03-19 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue26583] test_timestamp_overflow of test_importlib fails if PYTHONDONTWRITEBYTECODE is set

2016-03-19 Thread Ned Deily

Ned Deily added the comment:

Pushed for release in 3.5.2 and 3.6.0.

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



[issue26271] freeze.py makefile uses the wrong flags variables

2016-03-19 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for the patch, Daniel! Added you to the ACKS file.

--
stage: commit 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



[issue19265] Increased test coverage for datetime pickling

2016-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

These lines should be removed again after applying the patch for issue26579.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26538] regrtest: setup_tests() must not replace module.__path__ (_NamespacePath) with a simple list // importlib & abspath

2016-03-19 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue26546] Provide translated french translation on docs.python.org

2016-03-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I agree on the url.  It can always redirect to a CCTLD if there is one.

You *might* want to discuss the how on python-ideas list.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue26569] pyclbr.readmodule() and pyclbr.readmodule_ex() don't support namespace packages

2016-03-19 Thread STINNER Victor

STINNER Victor added the comment:

> However, you should be able to leave the is_package() call alone.

I don't really care how the issue is fixed. As I wrote, I don't know well the 
importlib module. Feel free to propose a better patch :-) My main concern is to 
fix test_pyclbr when test becomes a namespace.

--

___
Python tracker 

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



[issue24959] unittest swallows par t of stack trace when raising AssertionError in a TestCase

2016-03-19 Thread Robert Collins

Robert Collins added the comment:

I'm fairly sure its eating the stack frames because the calling frames are 
annotated __unittest__ - its technically a feature :/.

--
title: unittest swallows part of stack trace when raising AssertionError in a 
TestCase -> unittest swallows par t of stack trace when raising AssertionError 
in a TestCase

___
Python tracker 

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



[issue17605] mingw-meta: build interpeter core

2016-03-19 Thread Martin Panter

Changes by Martin Panter :


--
dependencies: +mingw: detect REPARSE_DATA_BUFFER

___
Python tracker 

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



[issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument

2016-03-19 Thread Alexander Mohr

Alexander Mohr added the comment:

any chance if this getting into 3.5.2? I have some gross code to get around it 
(setting global properties)

--
nosy: +thehesiod

___
Python tracker 

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



  1   2   >