[issue26617] Assertion failed in gc with __del__ and weakref

2016-03-22 Thread Guo Jiahua

Changes by Guo Jiahua :


--
nosy: +Guo Jiahua

___
Python tracker 

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



[issue26617] Assertion failed in gc with __del__ and weakref

2016-03-22 Thread Yang Ke

Yang Ke added the comment:

The crash may be raised on both Windows OS and Linux. We got crashed under 
Ubuntu 14.04, while a similar issue was found 
https://bugs.python.org/issue23187#msg238139 last year under Windows OS.

We actually raise such bug working on a program with asyncio and 
multithread(use asyncio.BaseEventLoop.run_in_executor with its default 
threadpool).
The asyncio.Task class creates a 
weakref.WeakSet(https://hg.python.org/cpython/file/3.5/Lib/asyncio/tasks.py#l38)
 containing alive tasks. WeakSet is implemented as a list containing 
weakref.ref with CALLBACK 
function(https://hg.python.org/cpython/file/3.5/Lib/_weakrefset.py#l84). And 
that may lead to the situation described in sample crash code:
Once a asyncio.Task.__del__ function is called, and callback of the weakref is 
called, then the interpreter switches to other thread, which may trigger 
gc.collect(the thread allocate a huge number of objects, for example), and 
leaves the task object in gc_list with refcount==0.

--
nosy: +Yang Ke -Guo. Jiahua

___
Python tracker 

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



[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2016-03-22 Thread Rian Hunter

Changes by Rian Hunter :


Added file: http://bugs.python.org/file42251/test_sqlite.py

___
Python tracker 

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



[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2016-03-22 Thread Rian Hunter

Changes by Rian Hunter :


Removed file: http://bugs.python.org/file42250/test_sqlite.py

___
Python tracker 

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



[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2016-03-22 Thread Rian Hunter

Changes by Rian Hunter :


Added file: http://bugs.python.org/file42250/test_sqlite.py

___
Python tracker 

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



[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2016-03-22 Thread Rian Hunter

Changes by Rian Hunter :


Removed file: http://bugs.python.org/file42249/test_sqlite.py

___
Python tracker 

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



[issue26617] Assertion failed in gc with __del__ and weakref

2016-03-22 Thread Guo, Jiahua

New submission from Guo, Jiahua:

$ python3.5-dbg crash.py
python3.5-dbg: ../Modules/gcmodule.c:364: update_refs: Assertion 
`((gc)->gc.gc_refs >> (1)) != 0' failed.


$ python3.5-dbg crash-multithread.py
python3.5-dbg: ../Modules/gcmodule.c:364: update_refs: Assertion 
`((gc)->gc.gc_refs >> (1)) != 0' failed.


 crash.py ==
import weakref
import gc


def callback(o):
gc.collect()


class C:
def __del__(self):
pass

def main():
c = C()
cref = weakref.ref(c, callback)
del c


main()


 crash-multithread.py ==
import threading
import weakref
import gc


ei = threading.Event()
eo = threading.Event()


def gc_worker():
ei.wait()
gc.collect()
eo.set()


def callback(o):
ei.set()
eo.wait()


class C:
def __del__(self):
pass


def main():
t = threading.Thread(target=gc_worker)
t.start()
c = C()
cref = weakref.ref(c, callback)
del c
t.join()


main()

--
components: Interpreter Core
messages: 262242
nosy: Guo, Jiahua
priority: normal
severity: normal
status: open
title: Assertion failed in gc with __del__ and weakref
type: crash
versions: 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



[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2016-03-22 Thread Rian Hunter

Rian Hunter added the comment:

Implicit transactions can also cause mysterious "database is locked" bugs, even 
when a large timeout is set on the connection. Many, many people are affected 
by this bug (search the web for "python sqlite database is locked").

The attached code demonstrates this bug and possible (unintuitive) fixes.

If there won't be a fix soon, then at least the documentation should note this 
quirky behavior.

--
nosy: +rhunter
Added file: http://bugs.python.org/file42249/test_sqlite.py

___
Python tracker 

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



[issue26616] A bug in datetime.astimezone() method

2016-03-22 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

See also #9527.

--

___
Python tracker 

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



[issue26616] A bug in datetime.astimezone() method

2016-03-22 Thread Alexander Belopolsky

New submission from Alexander Belopolsky:

With TZ=America/New_York,

>>> from datetime import *
>>> u = datetime(2015, 11, 1, 5, tzinfo=timezone.utc)
>>> t = u.astimezone()
>>> print(t)
2015-11-01 01:00:00-04:00
>>> print(t.astimezone())
2015-11-01 00:00:00-05:00

which is wrong - the second call to astimezone() should not change the 
timezone.  Note that pure python code does not have this bug.  (Try setiing 
sys.module['_datetime'] = None before running the code above.)

--
components: Extension Modules
messages: 262239
nosy: belopolsky
priority: normal
severity: normal
stage: needs patch
status: open
title: A bug in datetime.astimezone() method
type: behavior
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



[issue26602] argparse doc introduction is inappropriately targeted

2016-03-22 Thread Brian Guo

Brian Guo added the comment:

Hi,

I agree with your observation about the unnecessarily complicated 
documentation. I feel that there is not a real necessity to include an example 
that uses (metavar='N', nargs='+') or even (const='sum', default='max') inside 
the parameters of the add_argument method, as they are not explained in the 
beginning section and simply appear to contribute clutter.

For this reason, I have written an easier document to understand (still keeping 
the sidebar tutorial, because it is a helpful reference). I use instead a 
method that accepts a string and returns the first letter. I hope this will add 
to the clarity of the document.

--
keywords: +patch
nosy: +BGuo1
Added file: http://bugs.python.org/file42248/bguo.patch

___
Python tracker 

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



[issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers

2016-03-22 Thread Robert Siemer

Changes by Robert Siemer :


--
nosy: +siemer

___
Python tracker 

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



[issue26615] Missing entry in WRAPPER_ASSIGNMENTS in update_wrapper's doc

2016-03-22 Thread Xiang Zhang

New submission from Xiang Zhang:

WRAPPER_ASSIGNMENTS now contains __qualname__ but the documentation doesn't 
mention it.

--
assignee: docs@python
components: Documentation
files: functools_doc.patch
keywords: patch
messages: 262237
nosy: docs@python, xiang.zhang
priority: normal
severity: normal
status: open
title: Missing entry in WRAPPER_ASSIGNMENTS in update_wrapper's doc
versions: Python 3.6
Added file: http://bugs.python.org/file42247/functools_doc.patch

___
Python tracker 

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



[issue1346874] httplib simply ignores CONTINUE

2016-03-22 Thread Patrick J McNerthney

Patrick J McNerthney added the comment:

I believe this is actually a bug, because it causes the posting of messages 
whose length is greater then the Apache HTTPD SSLRenegBufferSize setting to 
fail, whereas other http clients that first wait to receive the 100 response 
before sending the body do work.

The situation I am encountering is an Apache server that uses client 
certificates to authorize calls to it's rest apis, whereas the rest of the same 
site do not require it. See the documentation about the SSLRegenBufferSize 
here: https://httpd.apache.org/docs/trunk/mod/mod_ssl.html#sslrenegbuffersize

By sending just the headers first with the "Expect: 100-continue" header and 
then waiting for the "100" response, Apache only has to buffer the headers. But 
the way HTTPConnection currently works, the headers and the body will be sent 
immediately, causing the SSLRenegBuffer to be exceed, causing the request to 
fail.

Also, I do not think the submitted patch is the best fix for this. The 
HTTPConnection.putheader method should be the place that checks to see if there 
is an Expect header sent.

--
nosy: +IcicleSpider

___
Python tracker 

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



[issue23735] Readline not adjusting width after resize with 6.3

2016-03-22 Thread Eric Price

Eric Price added the comment:

(To be clear, it now works in general for Python signal handlers, and when C 
handlers are inserted but not deleted.)

For a conditional ifdef, does that mean I should add another test/variable in 
configure.ac?

--

___
Python tracker 

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



[issue26614] False/0 and True/1 collision when used as dict keys?

2016-03-22 Thread Ethan Furman

Ethan Furman added the comment:

False and True are subtypes of int, so the behaviour you are seeing is known 
and expected.

https://docs.python.org/2/reference/datamodel.html?highlight=bool

In the future feel free to ask on Python-List about behaviour -- you'll be sure 
to get a plethora of answers.

--
nosy: +ethan.furman
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



[issue23735] Readline not adjusting width after resize with 6.3

2016-03-22 Thread Eric Price

Eric Price added the comment:

Hmm, OK.  I've made a new version of the patch that chains signal handlers.  I 
think that should make it match previous functionality, and work with basic 
combined usage or python signal handlers.

It probably still won't work if you, say, want to start and then stop a signal 
handler installed in C, but that's basically Issue 13285.

--
Added file: 
http://bugs.python.org/file42246/rl_sigwinch_calling_old_handler.patch

___
Python tracker 

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



[issue26614] False/0 and True/1 collision when used as dict keys?

2016-03-22 Thread nickeubank

New submission from nickeubank:

Found an odd behavior I'd never known about today, not sure if it's a bug or 
known. Python 3.4.4 (anaconda)

True, False, 0, 1 can all be used as dictionary keys.

But

Apparently True and 1 hash to the same item and False and 0 hash to the same 
item, so they can easily overwrite (which I spent a while banging my head over 
today). In other words:

In[1]:
d = {True: 'a', False: 'b'}
d[0] = 'z'
d[False]

Out[1]:
'z'

--
messages: 262232
nosy: nickeubank
priority: normal
severity: normal
status: open
title: False/0 and True/1 collision when used as dict keys?
versions: Python 3.4

___
Python tracker 

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



[issue26608] RLock undocumented behavior in case of multiple acquire

2016-03-22 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Per the docs ( https://docs.python.org/3/library/threading.html#rlock-objects ):

"To unlock the lock, a thread calls its release() method. acquire()/release() 
call pairs may be nested; only the final release() (the release() of the 
outermost pair) resets the lock to unlocked and allows another thread blocked 
in acquire() to proceed."

The docs aren't super clear on the return type, but they aren't so overly 
specified as to make returning either True or 1 incorrect; they use lowercase 
"true" to describe the return value, which doesn't *have* to mean True, just 
something that evaluates as truthy.

In 3.5 at least, it looks like both initial and subsequent acquires are all 
returning True, even when called without passing an argument; this actually 
violates the docs, which claim that not passing an argument means "There is no 
return value" (possibly only when there is contended acquisition, the wording 
is odd), when in fact a no-argument call returns True just like explicitly 
passing blocking as True.

--
nosy: +josh.r

___
Python tracker 

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



[issue23735] Readline not adjusting width after resize with 6.3

2016-03-22 Thread Martin Panter

Martin Panter added the comment:

Issue 13285 is open about tracking non-Python signal handlers.

I also found Issue 2675 about curses SIGWINCH handling in the interactive 
interpreter or when the readline module is imported, and Issue 3948 about 
someone trying to use both readline and SIGWINCH.

--

___
Python tracker 

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



[issue13285] signal module ignores external signal changes

2016-03-22 Thread Martin Panter

Martin Panter added the comment:

Also, the documentation currently suggests it returns None in these cases, but 
it actually returns SIG_DFL in at least one case (noticed in Issue 23735).

FWIW Vilya’s opaque object sounds fairly sensible to me. Yes, it is ugly, but 
one does not look at Unix signals expecting to find beauty :)

--
nosy: +martin.panter

___
Python tracker 

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



[issue26612] test_ssl: use context manager (with) to fix ResourceWarning

2016-03-22 Thread Martin Panter

Martin Panter added the comment:

Also remember that sockets don’t do context management in Python 2, so this 
would bring more incompatibilies when merging tests between the two branches.

--

___
Python tracker 

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



[issue26612] test_ssl: use context manager (with) to fix ResourceWarning

2016-03-22 Thread Martin Panter

Martin Panter added the comment:

Wouldn’t it be better to fix the underlying problem with the test cases? As I 
understand it, that would also avoid the warnings :)

Also, you can often use self.addCleanup(s.close), which saves a level of 
indentation (and associated noise in the annotate history). I used this 
technique in my remaining patch for Issue 25940.

--
nosy: +martin.panter

___
Python tracker 

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



[issue23735] Readline not adjusting width after resize with 6.3

2016-03-22 Thread Martin Panter

Martin Panter added the comment:

In configure.ac there are explicit checks for pre-2.1 Readline versions (and 
later versions). Maybe it is reasonable to require 4.0 these days. But I think 
this should only be done in the next Python version (3.6+).

To support Editline (and pre-4.0 Readline versions), I agree some conditional 
#ifdef thing would probably be best. My version of Editline claims to support 
4.2, but doesn’t have rl_resize_terminal().

I played with Readline 6.2 where this resize bug is not present. Getsignal() 
also returns SIG_DFL there, so I won’t worry too much about that :)

But it seems everything else worked fairly smoothly with 6.2. If you register 
your own SIGWINCH handler, it seems to be chain called by Readline. However 
with the current patch there are three differences that I can see to the 6.2 
behaviour:

* it overrides the SIGWINCH handler at import
* it does not chain to the old SIGWINCH handler
* the handler in “readline” is lost if another handler is set after import

You say it didn’t work before 6.3; what did you try? Also, I think a custom 
SIGWINCH handler does currently work with 6.3, and the patch would break that. 
How do you mean that doesn’t work now?

So I am still a bit concerned that in some circumstances the current patch 
could break working programs.

Maybe there is a solution that doesn’t need an API change: Only register 
SIGWINCH in readline_until_enter_or_signal(), and chain call to the original 
handler as well.

FWIW I am not a fan of signals, because they are hard to handle robustly. But 
in this case I don’t know of a good alternative. Perhaps we could call 
pselect() instead of select(), and mask SIGWINCH, but I doubt it is worth the 
effort (portablility problems?). Or maybe something similar to 
signal.set_wakeup_fd() would be better.

--

___
Python tracker 

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



[issue26613] Descriptor HowTo Guide - Typo

2016-03-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The last line is not a typo, it shows how to call the pure python version of 
the classmethod described above it.

FWIW, I'm working a revision to this how-to guide that it easier to read.  At 
the time it was written, it was the *only* documentation for the descriptors in 
that language and much of it was a direct translation from the underlying C 
code as an authoritative reference to that code.  It was not really a newbie 
document (descriptors aren't a newbie topic) and was moved to the how-to guides 
because it was so popular.

Since you're already "sorted", I'll close this tracker item.

--
assignee: docs@python -> rhettinger
nosy: +rhettinger
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



[issue10894] Making stdlib APIs private

2016-03-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Much of this is already in PEP 8 and doesn't need repeating.  Also, the tone is 
somewhat judgmental, heavy handed, restrictive, and over-broad for my tastes.

The last part seems to imply that we're going to change existing code in a way 
that may break user code.  Our whole goal is to make migrating to Python 3 
easier.  The next to last part may create a pressure to document and promise 
some things that may be implementation specific details.

I think we should let PEP 8 serve as the primary guideline.  For new code, try 
to be as clear as possible on public versus private.  For existing code, any 
changes should be considered on a case by case basis to strike the best balance 
between useful documentation versus over-specification versus breaking existing 
code by privatizing that which was unintentionally made public.  

Also, when it comes to documentation, there are many things which are public 
(such as pickling support, every magic method available, etc) which aren't 
discussed for every single class.  The reason for this is that it tends to fill 
the documentation with clutter, making it hard for the more useful information 
to stand out.

--

___
Python tracker 

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



[issue26613] Descriptor HowTo Guide - Typo

2016-03-22 Thread Stubz

New submission from Stubz:

The last line has a typo ... Dict.fromkeys -> dict.fromkeys

I am a newbie, but that was just a pain in the ass ...

Worked my way thru this How to and spent an hour+ trying to sort a circular 
argument error...

Was this intentional ¿
In as much as it was a pain in the ass, I think I got the concept sorted ...


https://docs.python.org/3.5/howto/descriptor.html

Static Methods and Class Methods

This behavior is useful whenever the function only needs to have a class 
reference and does not care about any underlying data. One use for classmethods 
is to create alternate class constructors. In Python 2.3, the classmethod 
dict.fromkeys() creates a new dictionary from a list of keys. The pure Python 
equivalent is:

class Dict(object):
. . .
def fromkeys(klass, iterable, value=None):
"Emulate dict_fromkeys() in Objects/dictobject.c"
d = klass()
for key in iterable:
d[key] = value
return d
fromkeys = classmethod(fromkeys)

Now a new dictionary of unique keys can be constructed like this:

>>>
Dict.fromkeys('abracadabra')

--
assignee: docs@python
components: Documentation
messages: 262223
nosy: docs@python, stubzpub
priority: normal
severity: normal
status: open
title: Descriptor HowTo Guide - Typo
type: behavior
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



[issue26612] test_ssl: use context manager (with) to fix ResourceWarning

2016-03-22 Thread STINNER Victor

New submission from STINNER Victor:

Attached patch modifies Lib/test/test_ssl.py to use "with socket:" instead of 
"try: ... finally: socket.close()" or similar patterns.

Our PPC64 AIX 3.x buildbot has a broken ssl module. A lot of tests logs 
ResourceWarning on unclosed sockets, because errors occur before the test 
closes a socket.

http://buildbot.python.org/all/builders/PPC64%20AIX%203.x/builds/4714/steps/test/logs/stdio

test_connect_ex_error (test.test_ssl.NetworkedTests) ... ok
test_connect_with_context (test.test_ssl.NetworkedTests) ... FAIL
/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/case.py:628:
 ResourceWarning: unclosed 
  outcome.errors.clear()

--
files: test_ssl_with.patch
keywords: patch
messages: 26
nosy: haypo
priority: normal
severity: normal
status: open
title: test_ssl: use context manager (with) to fix ResourceWarning
versions: Python 3.6
Added file: http://bugs.python.org/file42245/test_ssl_with.patch

___
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-22 Thread STINNER Victor

STINNER Victor added the comment:

(Ooops, I closed the bug by mistake.)

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

___
Python tracker 

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



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

2016-03-22 Thread STINNER Victor

STINNER Victor added the comment:

TODO for this issue: smart storage in _tracemalloc for trace keys. Use compact 
void* key until the first domain != 0 is used.

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



[issue26604] Add optional source parameter to warnings.warn()

2016-03-22 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



[issue26603] os.scandir: implement finalizer (for ResourceWarning)

2016-03-22 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



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

2016-03-22 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



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

2016-03-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 53343d095f78 by Victor Stinner in branch 'default':
_warnings.warn_explicit(): try to import warnings
https://hg.python.org/cpython/rev/53343d095f78

--
nosy: +python-dev

___
Python tracker 

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



[issue26603] os.scandir: implement finalizer (for ResourceWarning)

2016-03-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b65d783cfe3b by Victor Stinner in branch 'default':
Implement finalizer for os.scandir() iterator
https://hg.python.org/cpython/rev/b65d783cfe3b

--
nosy: +python-dev

___
Python tracker 

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



[issue26604] Add optional source parameter to warnings.warn()

2016-03-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3a57ced47459 by Victor Stinner in branch 'default':
Add a source parameter to warnings.warn()
https://hg.python.org/cpython/rev/3a57ced47459

--
nosy: +python-dev

___
Python tracker 

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



[issue26610] test_venv.test_with_pip() fails when ctypes is missing

2016-03-22 Thread STINNER Victor

STINNER Victor added the comment:

> It shouldn't be hard to make ctypes optional in pip, it's only used to check 
> if the OS we're running on is "manylinux" compatible, roughly checking the 
> glibc version number.

These checks look low level, so it makes sense to use ctypes for that.

> Worst case we can just conditon that check on ctypes existing.

Do you mean skipping the new "manylinux" thing if ctypes is missing? If yes, I 
agree with this option. In practice, types is only missing in very rare cases.

--

___
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-22 Thread STINNER Victor

STINNER Victor added the comment:

Ooook, I think that I found and fixed the random failures in the change  
af1c1149784a.

--

___
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-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c6f30e2731af by Victor Stinner in branch 'default':
Issue #26588: remove debug traces from _tracemalloc.
https://hg.python.org/cpython/rev/c6f30e2731af

New changeset af1c1149784a by Victor Stinner in branch '3.5':
Fix _tracemalloc start/stop
https://hg.python.org/cpython/rev/af1c1149784a

New changeset 2b4731e22df8 by Victor Stinner in branch '3.5':
Enhance _tracemalloc debug mode
https://hg.python.org/cpython/rev/2b4731e22df8

--

___
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-22 Thread John O'Connor

Changes by John O'Connor :


--
nosy: +jcon

___
Python tracker 

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



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2016-03-22 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thanks for fixing this!

--

___
Python tracker 

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



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2016-03-22 Thread Martin Panter

Changes by Martin Panter :


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



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

2016-03-22 Thread STINNER Victor

STINNER Victor added the comment:

The bug was seen on 5 buildbots yet:

* http://buildbot.python.org/all/builders/PPC64%20Fedora%203.x/
* http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.x/
* http://buildbot.python.org/all/builders/s390x%20RHEL%203.x/
* http://buildbot.python.org/all/builders/AMD64%20Windows10%203.x/
* http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/

--

___
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-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 708beeb65026 by Victor Stinner in branch 'default':
Issue #26588: skip test_warnings.test_tracemalloc()
https://hg.python.org/cpython/rev/708beeb65026

--

___
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-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f2d64f91d992 by Victor Stinner in branch 'default':
Issue #26588: Don't call tracemalloc_init() at module initilization
https://hg.python.org/cpython/rev/f2d64f91d992

New changeset d0b2f70731fb by Victor Stinner in branch 'default':
Issue #26588: more debug traces
https://hg.python.org/cpython/rev/d0b2f70731fb

--

___
Python tracker 

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



[issue26607] Rename a parameter in the function PyFile_FromFile

2016-03-22 Thread SilentGhost

Changes by SilentGhost :


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



[issue26607] Rename a parameter in the function PyFile_FromFile

2016-03-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I would say this is an issue of a static analysis tool, not Python sources.

--
resolution:  -> not a bug

___
Python tracker 

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



[issue26607] Rename a parameter in the function PyFile_FromFile

2016-03-22 Thread SilentGhost

Changes by SilentGhost :


--
components: +Interpreter Core
nosy: +benjamin.peterson, serhiy.storchaka
stage:  -> patch review

___
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-22 Thread Brett Cannon

Brett Cannon added the comment:

Based on conversations in https://github.com/python/typing/issues/182 I'm 
closing this as rejected.

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

___
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-22 Thread STINNER Victor

STINNER Victor added the comment:

Failure on "x86 Ubuntu Shared 3.x" at revision 
af388201c9976aebc4a8a433c95bfc4a1abe014b.

I added an assertion in tracemalloc_init() to ensure that the reeentrant flag 
is set at the end of the function.

The reentrant flag was no more set at tracemalloc_start() entry for an unknown 
reason.

http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/12905/steps/test/logs/stdio
---
0:08:50 [183/400] test_tracemalloc
[pid 14926, tid 1437466048] tracemalloc_start()
[pid 14926, tid 1437466048] tracemalloc_init()
[pid 14926, tid 1437466048] tracemalloc_init(): exit (already initialized)
python: ./Modules/_tracemalloc.c:1058: tracemalloc_start: Assertion 
`get_reentrant()' failed.
Fatal Python error: Aborted

Current thread 0x55adfdc0 (most recent call first):
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_tracemalloc.py", 
line 97 in setUp
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", 
line 596 in run
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", 
line 648 in __call__
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", 
line 122 in run
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", 
line 84 in __call__
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", 
line 122 in run
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", 
line 84 in __call__
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/runner.py", 
line 176 in run
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/support/__init__.py", 
line 1802 in _run_suite
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/support/__init__.py", 
line 1836 in run_unittest
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_tracemalloc.py", 
line 999 in test_main
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py",
 line 162 in runtest_inner
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py",
 line 115 in runtest
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", 
line 306 in run_tests_sequential
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", 
line 367 in run_tests
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", 
line 405 in main
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", 
line 446 in main
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", 
line 468 in main_in_temp_cwd
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/__main__.py", 
line 3 in 
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/runpy.py", line 85 
in _run_code
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/runpy.py", line 184 
in _run_module_as_main
---

--

___
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-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset af388201c997 by Victor Stinner in branch 'default':
Issue #26588: one more assertion
https://hg.python.org/cpython/rev/af388201c997

--

___
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-22 Thread STINNER Victor

STINNER Victor added the comment:

Failure at revision 636fa01842f597bedff7054616c65a4784c92b4a on AMD64 Windows10 
3.x (regrtest runs without the -j option, so all tests are run in the same 
thread).

http://buildbot.python.org/all/builders/AMD64%20Windows10%203.x/builds/763/steps/test/logs/stdio
-
0:12:37 [ 87/400/1] test_tracemalloc
[pid 2864, tid 2624] tracemalloc_start()
[pid 2864, tid 2624] tracemalloc_init()
[pid 2864, tid 2624] tracemalloc_init(): exit (already initialized)
Assertion failed: get_reentrant(), file ..\Modules\_tracemalloc.c, line 1057
Fatal Python error: Aborted

Current thread 0x0a40 (most recent call first):
  File "D:\buildarea\3.x.bolen-windows10\build\lib\test\test_tracemalloc.py", 
line 97 in setUp
  File "D:\buildarea\3.x.bolen-windows10\build\lib\unittest\case.py", line 596 
in run
  File "D:\buildarea\3.x.bolen-windows10\build\lib\unittest\case.py", line 648 
in __call__
  File "D:\buildarea\3.x.bolen-windows10\build\lib\unittest\suite.py", line 122 
in run
  File "D:\buildarea\3.x.bolen-windows10\build\lib\unittest\suite.py", line 84 
in __call__
  File "D:\buildarea\3.x.bolen-windows10\build\lib\unittest\suite.py", line 122 
in run
  File "D:\buildarea\3.x.bolen-windows10\build\lib\unittest\suite.py", line 84 
in __call__
  File "D:\buildarea\3.x.bolen-windows10\build\lib\unittest\runner.py", line 
176 in run
  File "D:\buildarea\3.x.bolen-windows10\build\lib\test\support\__init__.py", 
line 1802 in _run_suite
  File "D:\buildarea\3.x.bolen-windows10\build\lib\test\support\__init__.py", 
line 1836 in run_unittest
  File "D:\buildarea\3.x.bolen-windows10\build\lib\test\test_tracemalloc.py", 
line 999 in test_main
  File 
"D:\buildarea\3.x.bolen-windows10\build\lib\test\libregrtest\runtest.py", line 
162 in runtest_inner
  File 
"D:\buildarea\3.x.bolen-windows10\build\lib\test\libregrtest\runtest.py", line 
115 in runtest
  File "D:\buildarea\3.x.bolen-windows10\build\lib\test\libregrtest\main.py", 
line 306 in run_tests_sequential
  File "D:\buildarea\3.x.bolen-windows10\build\lib\test\libregrtest\main.py", 
line 367 in run_tests
  File "D:\buildarea\3.x.bolen-windows10\build\lib\test\libregrtest\main.py", 
line 405 in main
  File "D:\buildarea\3.x.bolen-windows10\build\lib\test\libregrtest\main.py", 
line 446 in main
  File "D:\buildarea\3.x.bolen-windows10\build\lib\test\libregrtest\main.py", 
line 468 in main_in_temp_cwd
  File 
"D:\buildarea\3.x.bolen-windows10\build\PCbuild\..\lib\test\regrtest.py", line 
39 in 
-

I understand that tracemalloc_start() was called with the first time and that 
get_reentrant() returns 0 at tracemalloc_start() entry, whereas 
tracemalloc_init() is supposed to set the reentrant flag to 1.

--

___
Python tracker 

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



[issue26200] SETREF adds unnecessary work in some cases

2016-03-22 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I am late to this discussion, but FWIW, I would like to back Raymond up.  For 
me, Py_XDECREF is usually a sign of lazy programming and an optimization 
opportunity.  In many cases I've seen, Py_XDECREF is used under a "done:" label 
and can be optimized by strategically placing Py_DECREFs before (error) returns 
while keeping track of what is and what is not initialized. In addition to an 
extra null check, Py_XDECREF typically requires a NULL initialization which can 
be avoided with a more thoughtful code structure.

All in all, Py_XDECREF rightfully stands out with an "X" spelling.  I don't 
want to see it hidden behind an innocent-looking convenience macro.

I am ±0 on the XSETREF variant, but I think SETREF should use DECREF.

--

___
Python tracker 

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



[issue10894] Making stdlib APIs private

2016-03-22 Thread SilentGhost

SilentGhost added the comment:

I wonder if the devguide would be a more suitable place for these guidelines. 
Here is the patch that adds them to stdblibchanges.rst

--
keywords: +patch
stage: needs patch -> patch review
versions: +Python 3.5, Python 3.6 -Python 3.4
Added file: http://bugs.python.org/file42244/issue10894.diff

___
Python tracker 

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



[issue26200] SETREF adds unnecessary work in some cases

2016-03-22 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
nosy: +belopolsky

___
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-22 Thread STINNER Victor

STINNER Victor added the comment:

Oh, "s390x RHEL 3.x" and "AMD64 Debian root 3.x" buildbots use "-j 1" command 
line option. In practice, tests are not run in subprocesses, -j1 option is 
ignored (issue #25285).

--

___
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-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 636fa01842f5 by Victor Stinner in branch 'default':
Add assertions on tracemalloc_reentrant_key
https://hg.python.org/cpython/rev/636fa01842f5

--

___
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-22 Thread SilentGhost

SilentGhost added the comment:

I still think my fix is more appropriate as it ensures that known_paths and 
sys.path stay connected somehow.

--

___
Python tracker 

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



[issue25251] Unknown MS Compiler version 1900

2016-03-22 Thread Steve Dower

Steve Dower added the comment:

Please test your extensions thoroughly when building with MinGW, especially if 
you're planning on distributing wheels on PyPI.

CPython assumes an ABI compatible with what MSVC would have built, and mixing 
ABIs will lead to crashes or data corruption. (I'm not just trying to be scary 
here, this is basically guaranteed to occur when you mix C Runtime libraries.)

Currently the only fully compatible MinGW I'm aware of (mingwpy - 
https://bitbucket.org/carlkl/mingw-w64-for-python) is still in development, 
though it appears to be ready for numpy and scipy, which is awesome. But just 
because "compiler=mingw32" appears to work, it doesn't make it inherently a 
good idea.

(As an aside, you can get the right version of MSVC for Python 3.5 and later 
from https://www.microsoft.com/en-us/download/details.aspx?id=49983 - you'll 
need to build inside the SDK's command line and set DISTUTILS_USE_SDK=1, but 
otherwise it is the right tools. We've already suggested that they should 
install in a way that setuptools can automatically detect and use them.)

--

___
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-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bbdb24611294 by Victor Stinner in branch 'default':
Issue #26588: more assertions
https://hg.python.org/cpython/rev/bbdb24611294

--

___
Python tracker 

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



[issue26598] Embbedable zip does not import modules in (zip)subdirectory

2016-03-22 Thread Steve Dower

Steve Dower added the comment:

Unless you're working on CPython itself, I'd suggest just installing the debug 
binaries through the installer.

I've made a note to write a blog post on how to use the embeddable distro, so 
when that comes out (in a few weeks, probably) hopefully it will help answer 
these questions. Then I'll look at merging the parts of that which would be 
good documentation into the Doc/using/windows.rst page.

--

___
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-22 Thread Brett Cannon

Brett Cannon added the comment:

And the code under discussion can be found at 
https://hg.python.org/cpython/file/default/Lib/site.py#l133

--

___
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-22 Thread Brett Cannon

Brett Cannon added the comment:

Unfortunately you can't simply remove that directory check because you don't 
want to blindly normalize case. If someone put some token value on sys.path for 
their use that was case-sensitive even on a case-insensitive OS then the 
proposed change would break those semantics (e.g. if someone put a URL in 
sys.path for a REST-based importer).

The possibilities I see are:

1. Don't change anything; duplicate entries don't really hurt anything
2. Remove duplicate entries, but only normalize case for directories
3. Remove duplicate entries, but normalize case for anything that points to 
something on the filesystem (i.e. both directories and files)

--

___
Python tracker 

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



[issue26598] Embbedable zip does not import modules in (zip)subdirectory

2016-03-22 Thread Zachary Ware

Zachary Ware added the comment:

Each of the .pyd files has its own .vcxproj in PCbuild.  You might be able to 
make use of pcbuild.sln or pcbuild.proj, each of which include all of the 
various project files.

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



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

2016-03-22 Thread Wolfgang Langner

Wolfgang Langner added the comment:

I think a fix for 3.6 only is ok, because it changes behaviour.
But this is only an internal function with a "_".

Should I add a test with a temporary created pth file?

--

___
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-22 Thread Brett Cannon

Brett Cannon added the comment:

I'll add some tests and a note that this was added in Python 3.6 and is 
provisional along with the typing module.

--

___
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-22 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm fine with the patch here. Go for it!

--

___
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-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 340ed3ff2656 by Victor Stinner in branch 'default':
Issue #26588: fix compilation on Windows
https://hg.python.org/cpython/rev/340ed3ff2656

--

___
Python tracker 

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



[issue26598] Embbedable zip does not import modules in (zip)subdirectory

2016-03-22 Thread Simon

Simon added the comment:

Not sure if I should be closing the issue or if you should.
I think it is not an issue.

--

___
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-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4ec81b497a84 by Victor Stinner in branch 'default':
Issue #26588: add debug traces
https://hg.python.org/cpython/rev/4ec81b497a84

--

___
Python tracker 

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



[issue16151] Deferred KeyboardInterrupt in interactive mode

2016-03-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> out of date
stage: test needed -> resolved
status: open -> closed

___
Python tracker 

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



[issue15660] Clarify 0 prefix for width specifier in str.format doc,

2016-03-22 Thread py.user

py.user added the comment:

Terry J. Reedy (terry.reedy) wrote:
> You example says to left justify '1'

Nope.

The fill character goes before alignment in the specification (grammatics).

>>> format(1, '0<2')
'10'
>>>

This is right. But 02 - is zero padding of a number which can be done only from 
the left side.

'<02' means "justify to the left zero padded number"

--

___
Python tracker 

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



[issue26598] Embbedable zip does not import modules in (zip)subdirectory

2016-03-22 Thread Simon

Simon added the comment:

Yes, it was a debug build, I didn't know it only works in release, that's the 
part I was clearly missing.

It would be great if we could have a debug embeddable zip file, but I 
understand that it might be asking for a bit much.

Is the project that builds all the pyds available? Maybe I could create my own 
embeddable debug zip.

Thanks

--

___
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-22 Thread STINNER Victor

STINNER Victor added the comment:

Crap. I expected the set_reentrant() bug to be fixed, but I saw it one more 
time on the latest build (revision 0da4532a893389bd1ee1ddfe8227750d968023ba):

http://buildbot.python.org/all/builders/s390x%20RHEL%203.x/builds/817/steps/test/logs/stdio

0:02:54 [103/400] test_tracemalloc
python: ./Modules/_tracemalloc.c:194: set_reentrant: Assertion 
`PyThread_get_key_value(tracemalloc_reentrant_key) == ((PyObject *) 
&_Py_TrueStruct)' failed.
Fatal Python error: Aborted

Current thread 0x03fffcd7b6f0 (most recent call first):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/test_tracemalloc.py",
 line 94 in setUp
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/unittest/case.py", 
line 596 in run
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/unittest/case.py", 
line 648 in __call__
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/unittest/suite.py", 
line 122 in run
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/unittest/suite.py", 
line 84 in __call__
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/unittest/suite.py", 
line 122 in run
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/unittest/suite.py", 
line 84 in __call__
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/unittest/runner.py", 
line 176 in run
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/support/__init__.py",
 line 1802 in _run_suite
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/support/__init__.py",
 line 1836 in run_unittest
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/test_tracemalloc.py",
 line 989 in test_main
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/libregrtest/runtest.py",
 line 162 in runtest_inner
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/libregrtest/runtest.py",
 line 115 in runtest
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/libregrtest/main.py",
 line 306 in run_tests_sequential
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/libregrtest/main.py",
 line 367 in run_tests
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/libregrtest/main.py",
 line 405 in main
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/libregrtest/main.py",
 line 446 in main
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/libregrtest/main.py",
 line 468 in main_in_temp_cwd
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/__main__.py", 
line 3 in 
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/runpy.py", 
line 85 in _run_code
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/runpy.py", 
line 184 in _run_module_as_main
make: *** [buildbottest] Aborted

--

___
Python tracker 

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



[issue26611] assertRaises callableObj cannot be used as a keyword with args

2016-03-22 Thread SilentGhost

SilentGhost added the comment:

Documentation [0] has callable listed as a positional argument, and this is how 
it should be used.

[0] 
https://docs.python.org/2.7/library/unittest.html#unittest.TestCase.assertRaises

--
nosy: +SilentGhost
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: crash -> behavior

___
Python tracker 

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



[issue26611] assertRaises callableObj cannot be used as a keyword with args

2016-03-22 Thread Chris Mitchell

New submission from Chris Mitchell:

assertRaises has callableObj listed as a keyword, though it is not possible to 
use it as a keyword when the callableObj takes arguments. 

The function definition is:
def assertRaises(self, excClass, callableObj=None, *args, **kwargs):

Therefore, using it with a keyword such as:

self.assertRaises(Exception, callableObj=my_function, args_to_function)

will fail due to passing arguments after a keyword.

--
components: Tests
messages: 262183
nosy: Chris Mitchell
priority: normal
severity: normal
status: open
title: assertRaises callableObj cannot be used as a keyword with args
type: crash
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



[issue26598] Embbedable zip does not import modules in (zip)subdirectory

2016-03-22 Thread Steve Dower

Steve Dower added the comment:

Are you making a debug build? It might be looking for _ctypes_d.pyd in that 
case. You'll need a release build for the embeddable distro, as well as 
including the pyds from the zip in sys.path - they need to be standalone files.

The embeddable release is meant only for redistribution, so you should build 
and test against a full install (including debug binaries if you want) and do 
integration testing with the embeddable package and a release build. (So Zach, 
yes, it's deliberate.)

--

___
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-22 Thread STINNER Victor

STINNER Victor added the comment:

> New changeset b86cdebe0e97 by Victor Stinner in branch 'default':
> tracemalloc now supports domains
> https://hg.python.org/cpython/rev/b86cdebe0e97

I hate working on huge patches, it's a pain to rebase them. I chose to push a 
first implementation to unblock the issue #26530 "tracemalloc: add C API to 
manually track/untrack memory allocations".

I'm interested by your feedback on the C API.

The C implementation can still be changed later.

For example, I chose to push a first implementation which *always* store 
domain_t in traces keys. Later, I will write a patch to switch from the compact 
key (Py_uintptr_t) to key using domain (pointer_t) dynamically.

--

___
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-22 Thread STINNER Victor

STINNER Victor added the comment:

Ok, I added the following C functions:

  int _PyTraceMalloc_Track(_PyTraceMalloc_domain_t domain, Py_uintptr_t ptr, 
size_t size);
  int _PyTraceMalloc_Untrack(_PyTraceMalloc_domain_t domain, Py_uintptr_t ptr);

Antoine, Nathaniel: Please play with it, I'm waiting for your feedback on the 
API.


_PyTraceMalloc_Track() acquires the GIL for you if it was released.

I suggest to not call it from a C thread. If you want to use it from a C 
thread, it's better to initialize manually the Python thread state on this 
thread (see issue #20891) before using _PyTraceMalloc_Track().

--

_PyTraceMalloc_domain_t is an unsigned int. The type name is annoying (too 
long). Maybe "unsigned int" would be more readable :-) What do you think? Maybe 
an unsigned short is enough? _tracemalloc.c tries to use a packed structure to 
limit the memory footprint.

--

I chose to use the Py_uintptr_t type for the pointer instead of void*, but 
there is a problem with that. It gives a false hint on the expected type. In 
fact, the hashtable is really optimized for pointers, the hash function uses 
_Py_HashPointer():

/* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid
   excessive hash collisions for dicts and sets */

It means that tracking file descriptor (int fd) may create a lot of a hash 
collisions. Well, if you handle a few file descriptors (less than 100?), it's 
maybe ok. If you handle tons of file descriptors, we should maybe make the hash 
function more configurable. Maybe even per domain?

Do you think that void* would be less a lie? :-) What do you prefer?

--

I also added a function to get the traceback where a memory block was allocated:

PyObject* _PyTraceMalloc_GetTraceback(_PyTraceMalloc_domain_t domain, 
Py_uintptr_t ptr);

But you should not use it, it's written for unit tests. You have to wrap the 
result into a tracemalloc.Traceback object:

def get_traceback(self):
frames = _testcapi.tracemalloc_get_traceback(self.domain, self.ptr)
if frames is not None:
return tracemalloc.Traceback(frames)
else:
return None

If this feature is useful, it should be added to the official Python API, the 
tracemalloc.py module. Currently, there is a 
tracemalloc.get_object_traceback(obj) function which is restricted to the 
domain 0 and expects a Python object, not a raw pointer.

--

___
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-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 60655e543d8a by Victor Stinner in branch 'default':
Add C functions _PyTraceMalloc_Track()
https://hg.python.org/cpython/rev/60655e543d8a

--
nosy: +python-dev

___
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-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b86cdebe0e97 by Victor Stinner in branch 'default':
tracemalloc now supports domains
https://hg.python.org/cpython/rev/b86cdebe0e97

--

___
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-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7c894911eb59 by Victor Stinner in branch 'default':
Simplify implementation of hashtable.c
https://hg.python.org/cpython/rev/7c894911eb59

New changeset cd9a40a5ea90 by Victor Stinner in branch 'default':
Remove _Py_hashtable_delete()
https://hg.python.org/cpython/rev/cd9a40a5ea90

--

___
Python tracker 

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



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2016-03-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset af6e8e1d15fa by Martin Panter in branch '3.5':
Issue #24266: Cancel history search mode with Ctrl+C in Readline 7
https://hg.python.org/cpython/rev/af6e8e1d15fa

New changeset 322d30816d36 by Martin Panter in branch 'default':
Issue #24266: Merge readline Ctrl+C handling from 3.5
https://hg.python.org/cpython/rev/322d30816d36

New changeset 1c0b29441116 by Martin Panter in branch '2.7':
Issue #24266: Cancel history search mode with Ctrl+C in Readline 7
https://hg.python.org/cpython/rev/1c0b29441116

--
nosy: +python-dev

___
Python tracker 

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



[issue26610] test_venv.test_with_pip() fails when ctypes is missing

2016-03-22 Thread Donald Stufft

Donald Stufft added the comment:

It shouldn't be hard to make ctypes optional in pip, it's only used to check if 
the OS we're running on is "manylinux" compatible, roughly checking the glibc 
version number. Worst case we can just conditon that check on ctypes existing.

--

___
Python tracker 

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



[issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows

2016-03-22 Thread STINNER Victor

STINNER Victor added the comment:

Windows buildbots still fail (sometimes?) because of this issue :-/

http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x/builds/1874/steps/test/logs/stdio

--

___
Python tracker 

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



[issue26610] test_venv.test_with_pip() fails when ctypes is missing

2016-03-22 Thread STINNER Victor

New submission from STINNER Victor:

pip/pep425tags.py requires ctypes, but it's not available on the OpenIndiana 
buildbot. I suggest to skip the test if ctypes is missing.

I don't know if it's possible to modify pip to make ctypes optional again.

http://buildbot.python.org/all/builders/AMD64%20OpenIndiana%203.x/builds/10407/steps/test/logs/stdio

==
FAIL: test_with_pip (test.test_venv.EnsurePipTest)
--
Traceback (most recent call last):
  File 
"/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/test/test_venv.py",
 line 364, in test_with_pip
with_pip=True)
subprocess.CalledProcessError: Command '['/tmp/tmpl3s6nv31/bin/python', '-Im', 
'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/test/test_venv.py",
 line 370, in test_with_pip
self.fail(msg.format(exc, details))
AssertionError: Command '['/tmp/tmpl3s6nv31/bin/python', '-Im', 'ensurepip', 
'--upgrade', '--default-pip']' returned non-zero exit status 1

**Subprocess Output**
Traceback (most recent call last):
  File "/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/runpy.py", 
line 184, in _run_module_as_main
"__main__", mod_spec)
  File "/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/runpy.py", 
line 85, in _run_code
exec(code, run_globals)
  File 
"/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/ensurepip/__main__.py",
 line 4, in 
ensurepip._main()
  File 
"/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/ensurepip/__init__.py",
 line 209, in _main
default_pip=args.default_pip,
  File 
"/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/ensurepip/__init__.py",
 line 116, in bootstrap
_run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File 
"/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/ensurepip/__init__.py",
 line 40, in _run_pip
import pip
  File "/tmp/tmpbfnwxnn2/pip-8.1.1-py2.py3-none-any.whl/pip/__init__.py", line 
16, in 
  File "/tmp/tmpbfnwxnn2/pip-8.1.1-py2.py3-none-any.whl/pip/vcs/subversion.py", 
line 9, in 
  File "/tmp/tmpbfnwxnn2/pip-8.1.1-py2.py3-none-any.whl/pip/index.py", line 30, 
in 
  File "/tmp/tmpbfnwxnn2/pip-8.1.1-py2.py3-none-any.whl/pip/wheel.py", line 32, 
in 
  File "/tmp/tmpbfnwxnn2/pip-8.1.1-py2.py3-none-any.whl/pip/pep425tags.py", 
line 9, in 
  File 
"/export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/ctypes/__init__.py",
 line 7, in 
from _ctypes import Union, Structure, Array
ImportError: No module named '_ctypes'

--
messages: 262173
nosy: dstufft, haypo
priority: normal
severity: normal
status: open
title: test_venv.test_with_pip() fails when ctypes is missing
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



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

2016-03-22 Thread STINNER Victor

STINNER Victor added the comment:

Hi,

> - How do you anticipate the integers naming domains will be allocated? Is it 
> like port numbers, and you'll maintain a registry somewhere ("domains 0-100 
> are reserved for the interpreter, pycuda has reserved 100-110, ...")?

I simply have no idea at all :-) I guess that the best is to
collaborate. It's not like we plan to have 1000 different users of the
API. Today, I only know two users: you and Antoine :-D

unsigned int is large: at least 32 bits. I understood that we will
only need something like 10 or maybe 20 domains.

> - You have it configurable at run-time whether the domain gets included in 
> the trace key, and if this is set to false (the default) then all the 
> different domains just get collapsed together. How is some downstream user 
> like pycuda expected to get sensible behavior out of this? Is the idea that 
> pycuda should be guarding all trace/untrace calls with if (use_domain) { ... 
> }, or...?

In my first implementation, support for domains was always enabled.
But I don't like that since it increases the memory footprint even if
you don't use domains, which is the case for *all* users today.

I added a flag, but I'm not happy with the API. For example, it's not
possible to set the flag using PYTHONTRACEMALLOC=nframe env var nor -X
tracemalloc[=nframe] command line option, whereas I'm a big fan of -X
tracemalloc=5 command line option.

Instead of having to enable the flag early and don't allow to change
the flag later, I should try to implement a dynamic flag: start
without domain, and convert the whole table to support domain as soon
as you start to trace at least one trace with domain != 0. I pushed
the first part of my patch (support key bigger than sizeof(void*)) to
be able to focus on the second part.

If fact, converting a table is no more complex than the regular
"rehash" operation when the table becomes too big. This operation is
part of the hashtable design.

> (I guess it could be sensible to support disabling domain stuff -- though if 
> I were writing it I probably wouldn't bother just because it increases the 
> number of configurations that need to be tested etc. -- but if you're doing 
> this then IMO it should discard all trace/untrace calls that refer to 
> non-default domains, i.e. domain=False shouldn't mean "discard domain 
> information", it should mean "trace only the heap domain".)

The design of tracemalloc is more to collect everything, but filter
later. That's why I added an optional domain parameter to
tracemalloc.Filter an a new tracemalloc.DomainFilter filter.

> - Is all this messing about with possibly-unaligned pointers etc. really 
> easier than having one-hashtable-per-domain? You could easily get away with a 
> linearly scanned array, even...

Having one hash table per domain requires to allocate a new hashtable
when we start to use a domain, then decide when it's time to release
it. We also need a "registry" for all trace hashtables: a simple short
array, or maybe even another hashtable?

But I think that we disagree on how traces will used. It looks like
you only care of statistics *per domain*. IMHO it's worth to get the
*total* memory (ex: CPU+GPU memory) per filename or per line number.
But also give the ability to filter domains. For example, exclude CPU
to get statistics of all GPU domains, or get CPU+shmem statistics.

I know that technically, the storage doesn't matter much: we can still
get traces of all domains at once. I like the idea of having all
traces in the same structure, even I have to agree that the new C
macros to get a key are more ugly than the previous simple direct
"void* key" pointer.

Domains are quite strange. They are part of the key in the hashtable,
but _tracemalloc._get_traces() now returns them as part of the "value"
(with my patch) :-)

--

___
Python tracker 

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



[issue26606] logging.baseConfig is missing the encoding parameter

2016-03-22 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +vinay.sajip
stage:  -> patch review

___
Python tracker 

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



[issue26609] Wrong request target in test_httpservers.py

2016-03-22 Thread Xiang Zhang

New submission from Xiang Zhang:

When requesting a resource from an origin server, the request-target in request 
line should always starts with a back slash. But in SimpleHTTPServerTestCase in 
test_httpservers.py, almost all the requests are sent without the back slash 
though the handler handles it well. The request lines are like 'GET tmpX 
HTTP/1.1'. I add the back slashes.

Maybe in SimpleHTTPRequestHandler, we should reject such invalid 
request-targets and then return BAD_REQUEST. And then issue2254 won't happen.

--
components: Library (Lib)
files: request_target_in_test_httpservers.patch
keywords: patch
messages: 262171
nosy: martin.panter, xiang.zhang
priority: normal
severity: normal
status: open
title: Wrong request target in test_httpservers.py
versions: Python 3.6
Added file: 
http://bugs.python.org/file42243/request_target_in_test_httpservers.patch

___
Python tracker 

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



[issue23735] Readline not adjusting width after resize with 6.3

2016-03-22 Thread Eric Price

Eric Price added the comment:

rl_resize_terminal was added in readline 4.0, released in 1999.  I think we can 
rely on it. =)

I don't know editline, but it probably doesn't include the readline 6.3 change 
that makes this necessary, so your patch for it could just IFDEF out that line.

I think SIG_DFL is a pretty reasonable return value, actually.  It's clearly 
not SIG_IGN or a python handle, it's not really "unknown", and it can be 
described as default behavior: it is the default way readline is supposed to 
work.

Finally, while I agree that it is conceivable that one could try to use 
readline + other terminal mucking with SIGWINCH, (a) this didn't work before 
the 6.3 change, (b) it doesn't work now, (c) it's far less common than the 
standard case of using readline normally, and (d) supporting such usage would 
be complicated and require a readline module API change.  Let's start by 
supporting normal usage.

--

___
Python tracker 

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



[issue26605] Feature request: string method `to_file`

2016-03-22 Thread SilentGhost

SilentGhost added the comment:

Those methods were added in 3.5, so no wonder many people would be unaware of 
them. I would suggest first taking such a proposal to python-ideas, since bug 
tracker is not a venue for proposing/advocating such sweeping changes to the 
language.

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



[issue26506] hex() documentation: mention "%x" % int

2016-03-22 Thread Manvi B

Manvi B added the comment:

Considered the reviews from STINNER Victor (haypo) and comments, the patch is 
modified.

--
Added file: http://bugs.python.org/file42242/issue26506.diff

___
Python tracker 

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



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2016-03-22 Thread Martin Panter

Martin Panter added the comment:

I’m getting ready to commit my patch to support the new Readline 7 function. Is 
there anything else to be done? The other options don’t sound worth it to me 
(e.g. incomplete, depending on internal details, etc).

--
stage: patch review -> commit review
versions:  -Python 3.4

___
Python tracker 

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



[issue23735] Readline not adjusting width after resize with 6.3

2016-03-22 Thread Martin Panter

Martin Panter added the comment:

I think it is conceivable that people could use Readline _and_ do their own 
stuff with the terminal. Consider someone playing with terminal stuff in the 
interactive interpreter (which happens to use Readline). I understand Readline 
returns the terminal to a sensible state after it returns you a line.

Another concern with the patch is that signal.getsignal(SIGWINCH) returns 
SIG_DFL, although according to the documentation it should probably return None 
(meaning a signal handler was not installed by Python). Not sure if that is a 
bug with the patch or with the signal module though :)

Also it looks like this patch will fail with Editline (Gnu Readline substitute 
used on OS X), and therefore probably also older versions of Gnu Readline. With 
my patch from Issue 13501 to enable Editline on Linux, I get these errors:

/media/disk/home/proj/python/cpython/Modules/readline.c: In function 
‘readline_until_enter_or_signal’:
/media/disk/home/proj/python/cpython/Modules/readline.c:1116:17: warning: 
implicit declaration of function ‘rl_resize_terminal’ 
[-Wimplicit-function-declaration]
 rl_resize_terminal();
 ^
*** WARNING: renaming "readline" since importing it failed: 
build/lib.linux-x86_64-3.6-pydebug/readline.cpython-36dm-x86_64-linux-gnu.so: 
undefined symbol: rl_resize_terminal

Following modules built successfully but were removed because they could not be 
imported:
readline

--

___
Python tracker 

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