[issue14134] xmlrpc.client.ServerProxy needs timeout parameter

2014-12-04 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
nosy: +berker.peksag

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



[issue16837] Number ABC can be instantiated

2014-12-04 Thread Berker Peksag

Berker Peksag added the comment:

I left a couple of comments on Rietveld.

--
nosy: +berker.peksag

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



[issue22993] Plistlib fails on certain valid plist values

2014-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Another limitation is that on 32-bit platform it is impossible to load date 
before datetime.datetime(1901, 12, 13, 20, 45, 52) from binary plist.

 plistlib.loads(b'bplist003'+struct.pack('d', -2**31 - (31 * 365 + 8) * 
 86400)+b'\x08\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11')
datetime.datetime(1901, 12, 13, 20, 45, 52)
 plistlib.loads(b'bplist003'+struct.pack('d', -2**31 - (31 * 365 + 8) * 
 86400 - 
 1)+b'\x08\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11')
Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/serhiy/py/cpython/Lib/plistlib.py, line 1006, in loads
fp, fmt=fmt, use_builtin_types=use_builtin_types, dict_type=dict_type)
  File /home/serhiy/py/cpython/Lib/plistlib.py, line 997, in load
return p.parse(fp)
  File /home/serhiy/py/cpython/Lib/plistlib.py, line 623, in parse
return self._read_object(self._object_offsets[top_object])
  File /home/serhiy/py/cpython/Lib/plistlib.py, line 688, in _read_object
return datetime.datetime.utcfromtimestamp(f + (31 * 365 + 8) * 86400)
OverflowError: timestamp out of range for platform time_t

Can second example be loaded by Apple tools on 32-bit?

--
nosy: +serhiy.storchaka

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Armin Rigo

Armin Rigo added the comment:

I hate to repeat myself, but if the C standard says files are flushed at 
exit; if Python 2 follows this standard; and if Python 3 follows it most of 
the time but *not always*...  then it seems to me that something is very, very 
buggy in the worst possible way (rare data loss).

--

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Do you have working in 3.4+ example?

--
stage:  - test needed
versions: +Python 3.5 -Python 3.3

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



[issue22993] Plistlib fails on certain valid plist values

2014-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Related issue is issue10733. Not all plists produced by Apple's tools can be 
proceeded by plistlib.

--

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Armin Rigo

Armin Rigo added the comment:

If I understood correctly, Python 3.4 tries harder to find cycles and call 
destructors at the end of the program, but that's not a full guarantee.  For 
example you can have a reference from a random C extension module.

While trying to come up with an example, I found one that I don't fully 
understand, but the point is that it shows how easy it is to defeats it:

import sys
f = open('foo.txt', 'w')
f.write('abc')
def func(*args):
return func
sys.settrace(func)

--

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Armin Rigo

Armin Rigo added the comment:

(Ah, it's probably a reference from the trace function - func_globals - f).

--

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Here is an example.

--
stage: test needed - needs patch

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


Added file: http://bugs.python.org/file37357/gcio.py

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



[issue22994] datetime buggy

2014-12-04 Thread santhosh

New submission from santhosh:

val=datetime.datetime.strptime(2015-02-01,'%Y-%m-%d').date()
zon=pytz.timezone('US/Pacific')
dt=datetime.datetime(val.year,val.month,val.day, tzinfo=zon)
print dt,zon


output:
2015-02-01 00:00:00-07:53 US/Pacific

output should be
2015-02-01 00:00:00-08:00 US/Pacific

--
messages: 232119
nosy: santhoshch
priority: normal
severity: normal
status: open
title: datetime buggy
type: behavior
versions: Python 2.7

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Note the example I posted doesn't involve the shutdown sequence. It calls 
gc.collect() explicitly.

--

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Armin Rigo

Armin Rigo added the comment:

To add to the confusion: Antoine's example produces an empty file on the 
current trunk cd282dd0cfe8.  When I first tried it on a slightly older trunk 
(157 changesets ago), it correctly emitted a file with barXXX , but only if 
gc.collect() was present.  Without gc.collect() it didn't.  This seems at 
odds with the explanation that gc.collect() should be what occurs at 
shut-down now.

--

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The problem is that the order of tp_finalize calls is arbitrary when there is a 
reference cycle (same thing, of course, with tp_clear). So depending on the 
exact layout of the garbage list, the TextIOWrapper could be collected before 
the BufferedWriter and the FileIO (good), or after (bad).

I don't see an easy way to solve this. Either _io should provide hints to the 
GC (which kind of hints?), or the tp_finalize should be customized to somehow 
call a dependent wrapper's tp_finalize (how? by keeping a weakref?).

--
nosy: +tim.peters

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Armin Rigo

Armin Rigo added the comment:

Maybe accepting the fact that relying on finalizers is a bad idea here?

--

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



[issue22994] datetime buggy

2014-12-04 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +belopolsky

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

You mean encourage people to explicitly use with or call close()? Yes, that's 
the simplest answer. It's why we added ResourceWarning.

--

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



[issue22994] datetime buggy

2014-12-04 Thread Simeon Visser

Simeon Visser added the comment:

Datetimes in local timezones should be created using localize():

 zon.localize(datetime.datetime(2015, 2, 1)).isoformat()
'2015-02-01T00:00:00-08:00'

See the two supported methods of creating local datetimes at: 
http://pytz.sourceforge.net

--
nosy: +simeon.visser

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread STINNER Victor

STINNER Victor added the comment:

 The problem is that the order of tp_finalize calls is arbitrary when there is 
 a reference cycle

If we want to guaranty that all files are properly flushed at exit, the best 
option is to maintain a list of open files.

I'm not interested to implement that, it sounds too complex. For example, 
open(text.txt, w) creates 3 objects: FileIO, BufferedWriter, TextIOWrapper. 
You have to register these 3 objects and flush them in the right order. Python 
is dynamic, you are free to modify objects, for example using the detach() 
method or by modifying the buffer attribute of the TextIOWrapper.

How do you decide which object should be flushed? In which order? We have to 
take care of signals, threads and forks, stay portable, etc.

--

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 04/12/2014 12:05, STINNER Victor a écrit :
 
 The problem is that the order of tp_finalize calls is arbitrary
 when
there is a reference cycle
 
 If we want to guaranty that all files are properly flushed at exit,
the best option is to maintain a list of open files.

I am not talking about files flushing at exit.

--

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



[issue22994] datetime buggy

2014-12-04 Thread santhosh

santhosh added the comment:

i dont need local timezone
i need other timezones like: (US/Pacific)

--

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 How do you decide which object should be flushed? In which order? We have to
 take care of signals, threads and forks, stay portable, etc.

The order doesn't matter. If you call flush() of TextIOWrapper, flushes of 
buffered writer and raw file will be called automatically. And flush() can be 
called multiple times.

--

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



[issue22994] datetime buggy

2014-12-04 Thread santhosh

santhosh added the comment:

zon=pytz.timezone('America/New_York')
dt=datetime.datetime(2014,02,01, tzinfo=zon)
print dt,zon

= 2015-02-01 00:00:00-04:56 America/New_York

zon=pytz.timezone('Asia/Kolkata')
dt=datetime.datetime(2014,02,01, tzinfo=zon)
print dt,zon

=2015-02-01 00:00:00+05:53 Asia/Kolkata

all most for all timezones it is giving erroronous outputs
we are dealing many timezones

--

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Armin Rigo

Armin Rigo added the comment:

Antoine: sorry if I wasn't clear enough.  Obviously you want to encourage 
people to close their files, but I think personally that it is very bad for the 
implementation to *most of the time* work anyway and only rarely fail to flush 
the files.  So, speaking only about the implementation, it is (imho) a bad idea 
to rely on finalizers to flush the files, and something else should be done.

Victor: it does not sound complicated to me to keep the BufferedWriter objects 
in a doubly-chained list.  You're overthinking the issue: there are no 
multithread issue (we have a GIL) and you don't have to keep track of all 3 
objects created by open.

--

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 04/12/2014 13:53, Armin Rigo a écrit :
 
 So, speaking only about the
implementation, it is (imho) a bad idea to rely on finalizers to flush
the files, and something else should be done.

But what else?

--

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Armin Rigo

Armin Rigo added the comment:

Antoine: I'm trying to explain what in the three lines that follow the parts 
you quoted.  I already tried to explain it a few times above.  Now I feel that 
I'm not going anywhere, so I'll quote back myself from 2013-04-27: Feel free 
to close anyway as not-a-bug; I won't fight the Python 3 behavior, because 
Python 2 works as expected.

--

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Armin: I don't see how linked lists would help.

--

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



[issue22995] Restrict default picleability

2014-12-04 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

When no efforts were spent to support pickling of instances of Python class, in 
most cases the class will be pickleable. Default implementation just saves all 
attributes and this works if all attributes are pickleable. Exceptional special 
cases:

1) Classes with __slot__. In this case an attempt to pickle will raise an 
exception with explaining message.

2) Classes with __new__ wish mandatory parameters. In this case the pickling 
will be silently successful, but actually data will be not saved and 
unpickling will fail. See for example issue21975, issue22955.

But when the class is implemented in C and doesn't expose its attribute in 
__dict__, in most cases it is variant (2) -- silent incorrect pickling.

I think we should prevent incorrect pickling by default. It is better to fail 
loudly. Default reduce could inspect the __new__ method and raise an exception 
if it has non-optional parameters and the class doesn't implement 
__getnewargs_ex__ or __getnewargs__ methods. And fail on all classes 
implemented in C if they don't implement any pickle-related methods.

--
messages: 232135
nosy: alexandre.vassalotti, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Restrict default picleability

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



[issue22994] datetime buggy

2014-12-04 Thread R. David Murray

R. David Murray added the comment:

pytz is not a part of the python standard library, it is a 3rd party product.  
Please reread Simeon's message (he's talking about any timezone), and if you 
have further questions ask on whatever support forum pytz has, or on the 
python-list mailing list.

--
nosy: +r.david.murray
resolution:  - third party
stage:  - resolved
status: open - closed

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

How it looks to me. Should be global collection of weak references (WeakSet?). 
Every instance of TextIOWrapper, BufferedWriter and BufferedRandom add itself 
to 
this collection on create and remove on close. A function registered with 
atexit calls flush() for all methods in the collection.

This solution doesn't require changes to finalization machinery, only to the io 
module.

I'm not particularly interested to implement that because I'm not convinced 
that Python should provide such guaranties. But the implementation shouldn't 
be too complex.

More general solution could be to introduce special method (__predel__) which 
should be called before breaking reference loops (or just before __del__ if 
there is no loop). In case of output streams it will call flush() (but not 
close()!).

--

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



[issue22995] Restrict default pickleability

2014-12-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
title: Restrict default picleability - Restrict default pickleability

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



[issue22996] Order of _io objects finalization can lose data in reference cycles

2014-12-04 Thread Antoine Pitrou

New submission from Antoine Pitrou:

Spun off from issue #17852, which sticks to interpreter shutdown issue. There 
is a more general issue when e.g. a BufferedWriter can be finalized 
(tp_finalize) before the TextIOWrapper wrapping it if they belong to a 
reference chain, losing unflushed data.

Reproducer attached.

--
components: IO
files: gcio.py
messages: 232138
nosy: pitrou
priority: normal
severity: normal
status: open
title: Order of _io objects finalization can lose data in reference cycles
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file37358/gcio.py

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy:  -pitrou

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



[issue22996] Order of _io objects finalization can lose data in reference cycles

2014-12-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +serhiy.storchaka

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Armin Rigo

Armin Rigo added the comment:

Here is a proof-of-concept.  It changes both _pyio.py and bufferedio.c and was 
tested with the examples here.  (See what I meant with linked lists.)  The 
change in textio.c is still missing, but should be very similar to 
bufferedio.c.  This is similar to the implementation in PyPy.

--

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Armin Rigo

Changes by Armin Rigo ar...@users.sourceforge.net:


--
keywords: +patch
Added file: http://bugs.python.org/file37359/pyio.diff

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



[issue22995] Restrict default pickleability

2014-12-04 Thread Barry A. Warsaw

Changes by Barry A. Warsaw ba...@python.org:


--
nosy: +barry

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



[issue22992] Adding a git developer's guide to Mercurial to devguide

2014-12-04 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
nosy: +brett.cannon

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread STINNER Victor

STINNER Victor added the comment:

By the way, I fixed various issues to ensure that ResourceWarning are
displayed at Python exit. There are still corner cases when the
warnings are not emited. For example, when a daemon thread is used. Or
when the warning comes very late during Python finalization.

Recent example of tricky issue related to this warning: #22898. IMO
it's a bug, it must be fixed and it should be possible to emit the
warning.

--

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



[issue22992] Adding a git developer's guide to Mercurial to devguide

2014-12-04 Thread Demian Brecht

Demian Brecht added the comment:

Thanks for the comments, will try to have an updated patch today.

 Trying to learn usual hg workflows might also be easier than trying to use a 
 git-like workflow on mercurial, so you could suggest considering them too (I 
 don't remember if we have anything about it in the devguide though).

(For other as we briefly chatted about this over IM:) The intention of this 
guide was to minimize the cognitive load of context switching between git and 
mercurial projects for git developers just beginning to use mercurial. As their 
experience with mercurial increases, their workflow may change to be more of an 
out of the box type flow.

Git developers (myself included) will likely spend a good deal of time trying 
to figure out how to do X as I would in git using Mercurial. This is simply 
to try and lower the initial cost of development for new contributors.

--

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



[issue22997] Minor improvements to Functional API section of Enum documentation

2014-12-04 Thread Simeon Visser

New submission from Simeon Visser:

This patch contributes two changes to the Functional API section of the Enum 
documentation:

- Early in the section it mentions four different ways of creating an Enum but 
later it only lists three different ways (the sequence of names approach 
wasn't listed anymore).

- The use of Animal and Animals wasn't consistent.

This issue is mainly to test my ability to make a (trivial) patch.

--
assignee: docs@python
components: Documentation
messages: 232142
nosy: docs@python, simeon.visser
priority: normal
severity: normal
status: open
title: Minor improvements to Functional API section of Enum documentation
type: enhancement
versions: Python 3.5

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



[issue22997] Minor improvements to Functional API section of Enum documentation

2014-12-04 Thread Simeon Visser

Changes by Simeon Visser simeo...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file37360/issue22997.patch

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



[issue22997] Minor improvements to Functional API section of Enum documentation

2014-12-04 Thread Ethan Furman

Changes by Ethan Furman et...@stoneleaf.us:


--
nosy: +ethan.furman

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



[issue22997] Minor improvements to Functional API section of Enum documentation

2014-12-04 Thread Ethan Furman

Ethan Furman added the comment:

Simeon, the patch looks decent; I'll review it more carefully later.

If you are going to contribute non-trivial patches, you'll need to sign the 
CLA:  https://www.python.org/psf/contrib/contrib-form/ .

Thanks for helping!

--

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



[issue22987] ssl module documentation: incorrect compatibility matrix

2014-12-04 Thread Kali Kaneko

Kali Kaneko added the comment:

my bad, I had not actually tested the sslv2 and sslv3 options, since they were 
not available in the python in debian sid.

thanks for the quick fix!

--

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



[issue21114] wsgiref.simple_server doesn't handle multi-line headers correctly

2014-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Tom. This was made in issue4718. But tests are passed without them. 
So 3.x needs tests too.

--
assignee: serhiy.storchaka - 
nosy: +pitrou

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2014-12-04 Thread Nikolaus Rath

Nikolaus Rath added the comment:

This will probably be too radial, but I think it should at least be mentioned 
as a possible option.
 
We could just not attempt to implicitly flush buffers in the finalizer at all. 
This means scripts relying on this will break, but in contrast to the current 
behavior they will break consistently so it's easy to find and fix the problem.

I think this is still preferable to any solution that does not guarantee 
flushing in 100% of the cases.

--

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



[issue22991] test_gdb leaves the terminal in raw mode with gdb 7.8.1

2014-12-04 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The previous patch failed many tests, sorry.
The attached patch runs successfully test_gdb using gdb/mi.
All the changes that were made in the test cases themselves, remove either a 
terminating new line or terminating white spaces in the assertion check.

--
Added file: http://bugs.python.org/file37361/gdbmi_2.patch

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



[issue22994] datetime buggy

2014-12-04 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

santhosh,

I would be interested to know how this gets resolved.  I find it strange that 
zon gets fractional UTC offset:

 zon
DstTzInfo 'US/Pacific' LMT-1 day, 16:07:00 STD

If you ask on a pytz-related forum, please post a link here.

Some other cases:

 pytz.timezone('US/Eastern')
DstTzInfo 'US/Eastern' LMT-1 day, 19:04:00 STD

 pytz.timezone('US/Central')
DstTzInfo 'US/Central' LMT-1 day, 18:09:00 STD

 pytz.timezone('Asia/Kolkata')
DstTzInfo 'Asia/Kolkata' LMT+5:53:00 STD

but

 pytz.timezone('Europe/Paris')
DstTzInfo 'Europe/Paris' LMT+0:09:00 STD

--

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



[issue22994] datetime buggy

2014-12-04 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

It looks like pytz documentation [1] specifically warns about this kind of 
usage:


Unfortunately using the tzinfo argument of the standard datetime constructors 
‘’does not work’’ with pytz for many timezones.



[1] http://pytz.sourceforge.net/#localized-times-and-date-arithmetic

--

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



[issue19834] Unpickling exceptions pickled by Python 2

2014-12-04 Thread Walter Dörwald

Changes by Walter Dörwald wal...@livinglogic.de:


--
status: open - closed

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



[issue22998] inspect.Signature and default arguments

2014-12-04 Thread Walter Dörwald

New submission from Walter Dörwald:

inspect.Signature.bind() doesn't add values for parameters that are unspecified 
but have a default value. The documentation at 
https://docs.python.org/3/library/inspect.html#inspect.BoundArguments.arguments 
includes an example how to add default values, but that example doesn't work 
for the * and ** parameters.

This patch adds a new method Signature.bind_with_defaults() that works like 
Signature.bind(), but includes parameters with a default value (and can handle 
values for the * and ** parameters).

--
components: Library (Lib)
files: signature-bind.diff
keywords: patch
messages: 232150
nosy: doerwalter
priority: normal
severity: normal
status: open
title: inspect.Signature and default arguments
type: enhancement
Added file: http://bugs.python.org/file37362/signature-bind.diff

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



[issue22998] inspect.Signature and default arguments

2014-12-04 Thread R. David Murray

R. David Murray added the comment:

Can you give an example of what you say doesn't work?

IIRC the reason this method isn't part of the API is because normally it isn't 
needed (the defaults are filled in when you do the actual call).  What is your 
use case for needing the defaults to be pre-bound?

--
nosy: +r.david.murray

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



[issue22998] inspect.Signature and default arguments

2014-12-04 Thread Walter Dörwald

Walter Dörwald added the comment:

The following doesn't work::

   import inspect

   def foo(*args, **kwargs):
  return (args, kwargs)

   # Code from 
https://docs.python.org/3/library/inspect.html#inspect.BoundArguments.arguments 
to fill in the defaults

   sig = inspect.signature(foo)
   ba = sig.bind()

   for param in sig.parameters.values():
  if param.name not in ba.arguments:
 ba.arguments[param.name] = param.default

   print(foo(*ba.args, **ba.kwargs))

instead it gives the following traceback::

   Traceback (most recent call last):
 File sig_test.py, line 16, in module
   print(foo(*ba.args, **ba.kwargs))
 File /Users/walter/.local/lib/python3.4/inspect.py, line 2246,in args
   args.extend(arg)
   TypeError: 'type' object is not iterable

In my use case there isn't a call to a function implemented in Python. Instead 
I'm implementing a templating languages that supports defining a signature for 
a template. Calling the template binds the arguments and inside the template 
the variables simply are a dictionary.

I.e. define the template like this:

   t = Template(?print a+b?, signature=a, b=23)

Then you can call it like this:

   t(17)

and inside the template the variables will be {a: 17, b: 23}.

The signature argument in the Template constructor will be parsed into an 
inspect.Signature object and I'd like to use Signature.bind() to get the final 
variables dictionary.

--

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



[issue22685] memory leak: no transport for pipes by create_subprocess_exec/shell

2014-12-04 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
status: open - closed

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



[issue22998] inspect.Signature and default arguments

2014-12-04 Thread R. David Murray

R. David Murray added the comment:

This is indeed a bit tricky.  Your use case is pretty specialized (it doesn't 
involve any actual python functions), so I don't think by itself it argues for 
the inclusion of a _with_defaults method.  The example fill-in in the docs 
fails because args and kwargs don't check for _empty as a possible value for 
the VAR_POSITIONAL (resp VAR_KEYWORD).

So I think either we add that check to args and kwargs, or we add a 
_with_defaults method because filling in the defaults would no longer be a 
simple loop (and thus easy to get wrong).

Let's see what Yury thinks.

--
nosy: +yselivanov
versions: +Python 3.4, Python 3.5

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



[issue22998] inspect.Signature and default arguments

2014-12-04 Thread Yury Selivanov

Yury Selivanov added the comment:

I think we should just fix the documentation, and update the code in example 
with a proper check:

  for param in sig.parameters.values():
if (param.name not in ba.arguments 
 and param.default is not param.empty):
   ba.arguments[param.name] = param.default

I'm -1 on adding '_with_defaults' method, because usually you don't need this 
(at least in my experience).

--

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



[issue22922] asyncio: call_soon() should raise an exception if the event loop is closed

2014-12-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 226f870b387d by Victor Stinner in branch '3.4':
Closes #22922: More EventLoop methods fail if the loop is closed. Initial patch
https://hg.python.org/cpython/rev/226f870b387d

--
nosy: +python-dev
resolution:  - fixed
stage:  - resolved
status: open - closed

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



[issue22685] memory leak: no transport for pipes by create_subprocess_exec/shell

2014-12-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2c18dd99829c by Victor Stinner in branch '3.4':
Issue #22685: Fix test_pause_reading() of asyncio test_subprocess
https://hg.python.org/cpython/rev/2c18dd99829c

--

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



[issue22922] asyncio: call_soon() should raise an exception if the event loop is closed

2014-12-04 Thread STINNER Victor

STINNER Victor added the comment:

I didn't change subprocess_exec() nor subprocess_shell() because they are 
coroutine. A coroutine object can only raise an exception when they are 
executed, whereas a closed loop cannot execute a coroutine object. I modified 
create_task() to fail if the event loop is closed, it should be enough.

Thanks Torsten Landschoff for your fix.

--

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



[issue22922] asyncio: call_soon() should raise an exception if the event loop is closed

2014-12-04 Thread STINNER Victor

STINNER Victor added the comment:

Windows buildbots are not happy:

http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/5385/steps/test/logs/stdio


==
ERROR: test_close (test.test_asyncio.test_windows_events.ProactorTests)
--
Traceback (most recent call last):
  File 
C:\buildbot.python.org\3.x.kloth-win64\build\lib\asyncio\proactor_events.py, 
line 394, in close
self._close_self_pipe()
  File 
C:\buildbot.python.org\3.x.kloth-win64\build\lib\asyncio\proactor_events.py, 
line 423, in _close_self_pipe
self._self_reading_future.cancel()
  File 
C:\buildbot.python.org\3.x.kloth-win64\build\lib\asyncio\windows_events.py, 
line 70, in cancel
return super().cancel()
  File C:\buildbot.python.org\3.x.kloth-win64\build\lib\asyncio\futures.py, 
line 230, in cancel
self._schedule_callbacks()
  File C:\buildbot.python.org\3.x.kloth-win64\build\lib\asyncio\futures.py, 
line 245, in _schedule_callbacks
self._loop.call_soon(callback, self)
  File 
C:\buildbot.python.org\3.x.kloth-win64\build\lib\asyncio\base_events.py, line 
384, in call_soon
handle = self._call_soon(callback, args, check_loop=True)
  File 
C:\buildbot.python.org\3.x.kloth-win64\build\lib\asyncio\base_events.py, line 
395, in _call_soon
self._check_closed()
  File 
C:\buildbot.python.org\3.x.kloth-win64\build\lib\asyncio\base_events.py, line 
234, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

--
resolution: fixed - 
status: closed - open

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



[issue20220] TarFile.list() outputs wrong time

2014-12-04 Thread STINNER Victor

STINNER Victor added the comment:

The bug still occurs on the System Z buildbot:

http://buildbot.python.org/all/builders/System%20Z%20Linux%203.x/builds/2375/steps/test/logs/stdio

==
FAIL: test_list_command_verbose (test.test_tarfile.CommandLineTest)
--
Traceback (most recent call last):
  File 
/mnt/9707/edelsohn/cpython-buildarea/3.x.edelsohn-zlinux-z/build/Lib/test/test_tarfile.py,
 line 1953, in test_list_command_verbose
self.assertEqual(out, expected)
AssertionError: b'?rw[39 chars]-01-05 18:19:43 ustar/conttype \n?rw-r--r-- 
ta[6470 chars]f \n' != b'?rw[39 chars]-01-06 00:19:43 ustar/conttype 
\n?rw-r--r-- ta[6470 chars]f \n'

--
nosy: +haypo

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



[issue22995] Restrict default pickleability

2014-12-04 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Minor note: Python classes with __slots__ pickle and unpickle just fine under 
protocol 2 and higher. Only protocols 0 and 1 have this problem, and they are 
no longer used by default on Py3, and not necessary to communicate with Py2, 
where protocol 2 is supported and generally more efficient.

I understand that you're not suggesting any changes to address issue #1, just 
wanted to mention this.

--
nosy: +josh.r

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



[issue22996] Order of _io objects finalization can lose data in reference cycles

2014-12-04 Thread Josh Rosenberg

Josh Rosenberg added the comment:

What is the proposal? Global registration of file objects that should be 
flushed before cleanup when they participate in a reference cycle? Adding a 
special __predel__ method as suggested in the linked bug? Weak backrefs for 
file objects that allow a child being destroyed to flush/close its parent 
(recursively) such that the top of the I/O wrapping chain is always 
flushed/closed first? Something else?

The underlying problem is that people don't use with statements or otherwise 
explicitly close their objects, and 99.9% of the time, they get away with it in 
CPython because of the deterministic reference counting for non-cycles and the 
finalizers. I'm not sure it's worth adding new complexity (to the interpreter 
or the I/O hierarchy) to address an issue that can be fixed by closing your 
files properly, which is already recommended practice.

--
nosy: +josh.r

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



[issue22996] Order of _io objects finalization can lose data in reference cycles

2014-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I was thinking about weak backrefs. It's specialized for the io module but it 
would be fairly reliable, and not too complicated to implement.

--

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



[issue22922] asyncio: call_soon() should raise an exception if the event loop is closed

2014-12-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6a955db1f78f by Victor Stinner in branch 'default':
Issue #22922: Fix ProactorEventLoop.close()
https://hg.python.org/cpython/rev/6a955db1f78f

--

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



[issue22429] asyncio: pending call to loop.stop() if a coroutine raises a BaseException

2014-12-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 83bddbfbd3a4 by Victor Stinner in branch '3.4':
Closes #22429, asyncio: Fix EventLoop.run_until_complete(), don't stop the
https://hg.python.org/cpython/rev/83bddbfbd3a4

--
nosy: +python-dev
resolution:  - fixed
stage:  - resolved
status: open - closed

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



[issue22922] asyncio: call_soon() should raise an exception if the event loop is closed

2014-12-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0a7d956a2f2d by Victor Stinner in branch '3.4':
Issue #22922: Fix ProactorEventLoop.close()
https://hg.python.org/cpython/rev/0a7d956a2f2d

--

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



[issue22926] asyncio: raise an exception when called from the wrong thread

2014-12-04 Thread STINNER Victor

STINNER Victor added the comment:

Guido, Yury: What do you think? Does it sound reasonable to raise an exception 
if an event loop is used from the wrong thread?

--

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



[issue22768] Add a way to get the peer certificate of a SSL Transport

2014-12-04 Thread STINNER Victor

STINNER Victor added the comment:

 Thanks, that indeed works; I don't know why I missed it while reading the 
 source.

Ok, it looks like we can close the issue.

 That will be problematic with issue22560.

In this case, it should be discussed there.

--
resolution:  - not a bug
status: open - closed

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



[issue22599] traceback: errors in the linecache module at exit

2014-12-04 Thread STINNER Victor

STINNER Victor added the comment:

Can I apply traceback_at_exit-2.patch? I know that my change on tokenize is not 
perfect, but it doesn't look like an hack, and it adds a new unit test.

The linecache module can be enhanced in the issue #22696.

--

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



[issue22560] Add loop-agnostic SSL implementation to asyncio

2014-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

From issue 22768:


 Maybe
 transport.get_extra_info('socket').getpeercert(True)
 would be okay, no patch needed?

That will be problematic with issue22560. The clear-text socket object and the 
SSL object become unrelated, and it would be logical for 
get_extra_info('socket') to return the clear-text socket, so either a 
get_extra_info('ssl') would be needed, or we should expose the SSL properties 
directly as extra info members.


--

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



[issue22984] test_json.test_endless_recursion(): Fatal Python error: Cannot recover from stack overflow. on x86 XP-4 3.x buildbot

2014-12-04 Thread STINNER Victor

STINNER Victor added the comment:

Here is a patch to use a lower recursion limit to no stress the C stack.

--
keywords: +patch
Added file: http://bugs.python.org/file37363/test_endless_recursion.patch

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



[issue21793] httplib client/server status refactor

2014-12-04 Thread Demian Brecht

Demian Brecht added the comment:

Bump (again) for hopeful merge.

--

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



[issue22926] asyncio: raise an exception when called from the wrong thread

2014-12-04 Thread Guido van Rossum

Guido van Rossum added the comment:

Maybe only in debug mode? Getting thread ID or current thread may be
expensive. Also it is conceivable that run... is called first from one
thread and then from another. Maybe.
On Dec 4, 2014 4:47 PM, STINNER Victor rep...@bugs.python.org wrote:


 STINNER Victor added the comment:

 Guido, Yury: What do you think? Does it sound reasonable to raise an
 exception if an event loop is used from the wrong thread?

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue22926
 ___


--

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



[issue21793] httplib client/server status refactor

2014-12-04 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
stage: patch review - commit review

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



[issue22926] asyncio: raise an exception when called from the wrong thread

2014-12-04 Thread Yury Selivanov

Yury Selivanov added the comment:

 - modify tests to set the event loop to the newly created event loop, instead 
 of setting it to None

I'm not sure that this particular change is a great idea. I kind of liked that 
unittests ensure that loop is passed everywhere explicitly in asyncio.


 - modify get_event_loop() to always raise a RuntimeError if the thread has no 
 event loop. Before an AssertionError was not raised if python runs with -O 
 option

+1.


 - modify BaseEventLoop._assert_is_current_event_loop() to fail if the thread 
 has an event loop

Hm, I think I don't understand why this function doesn't to anything when there 
is no loop in the thread... Let's fix it. In your patch, you should also 
replace 'except AsserionError' with 'except RuntimeError'.


 Does it sound reasonable to raise an exception if an event loop is used from 
 the wrong thread?

I think we should in debug mode at least.


 Getting thread ID or current thread may be expensive.

Victor, can you benchmark this?  I'm pretty sure that Guido is right about 
this, but sometimes syscalls are pretty fast.  I doubt that a lot of people 
know about debug mode, so if it has a negligible cost I'd do the check every 
time.

--

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



[issue22926] asyncio: raise an exception when called from the wrong thread

2014-12-04 Thread Guido van Rossum

Guido van Rossum added the comment:

On Thu, Dec 4, 2014 at 7:21 PM, Yury Selivanov rep...@bugs.python.org
wrote:


 Yury Selivanov added the comment:

  - modify tests to set the event loop to the newly created event loop,
 instead of setting it to None

 I'm not sure that this particular change is a great idea. I kind of liked
 that unittests ensure that loop is passed everywhere explicitly in asyncio.


Indeed, don't break that.


  - modify get_event_loop() to always raise a RuntimeError if the thread
 has no event loop. Before an AssertionError was not raised if python runs
 with -O option

 +1.


+1


  - modify BaseEventLoop._assert_is_current_event_loop() to fail if the
 thread has an event loop

 Hm, I think I don't understand why this function doesn't to anything when
 there is no loop in the thread... Let's fix it. In your patch, you should
 also replace 'except AsserionError' with 'except RuntimeError'.


  Does it sound reasonable to raise an exception if an event loop is used
 from the wrong thread?

 I think we should in debug mode at least.


  Getting thread ID or current thread may be expensive.

 Victor, can you benchmark this?  I'm pretty sure that Guido is right about
 this, but sometimes syscalls are pretty fast.  I doubt that a lot of people
 know about debug mode, so if it has a negligible cost I'd do the check
 every time.


I take it back, it's only 250 nsec to call threading.current_thread(), and
300 nsec to acquire and release a lock.

I still think you shouldn't set the thread when the loop is created but
only when run*() is active. (Using call_later() from another thread when
the loop is inactive should not be an error IMO -- there's nothing against
passing a selector instance to another thread as long as only one thread at
a time waits for it.)

--

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



[issue22998] inspect.Signature and default arguments

2014-12-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 71c38c233e5c by Yury Selivanov in branch '3.4':
docs.inspect: Fix BoundArguments example. Issue #22998.
https://hg.python.org/cpython/rev/71c38c233e5c

New changeset 697adefaba6b by Yury Selivanov in branch 'default':
docs.inspect: Fix BoundArguments example. Issue #22998.
https://hg.python.org/cpython/rev/697adefaba6b

--
nosy: +python-dev

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



[issue19834] Unpickling exceptions pickled by Python 2

2014-12-04 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
stage: needs patch - resolved

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



[issue21793] httplib client/server status refactor

2014-12-04 Thread Berker Peksag

Berker Peksag added the comment:

I left a couple of comments on Rietveld. Thanks for the patch, Demian.

--

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



[issue22768] Add a way to get the peer certificate of a SSL Transport

2014-12-04 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
stage: patch review - resolved

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



[issue22599] traceback: errors in the linecache module at exit

2014-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, please do this.

--
versions: +Python 3.4

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



[issue22696] Add a function to know about interpreter shutdown

2014-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

After solving this issue we should reconsider the 
traceback_ignore_linecache_error.patch patch in issue22599.

--

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



[issue22996] Order of _io objects finalization can lose data in reference cycles

2014-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think that reference loop breaker should be smarter. If we have a loop

A ⇄ B → C → D

then the order of the finalization of A and B is not defined, but B should be 
finalized before C and C before D. This should fix unintentional issues with 
chained io classes because they have no back references.

--

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