[issue17845] Clarify successful build message

2013-04-26 Thread Ezio Melotti

Ezio Melotti added the comment:

See also #13472 for a related discussion.

--
keywords: +easy
stage:  - needs patch
type:  - enhancement

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-04-26 Thread Charles-François Natali

Charles-François Natali added the comment:

 I would like to see Proto4 include an option for compression
 (zlib,bz2) or somesuch and become self-decompressing upon unpickling.

I don't see what this would bring over explicit compression:
- depending on the use case, you may want to use different compression 
algorithms, e.g. for disk you may want higher compression ratio like 
bzip2/lzma, but for wire you'd prefer something fast like snappy
- supporting multiple compression algorithms and levels would complicate the API
- this would probably complicate the code, since you'd have to support optional 
compression, and have a way to indicate which format is used
- that's really mixing two entirely different concepts (serialization vs 
compression)

--
nosy: +neologix

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-04-26 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 I don't see what this would bring over explicit compression:
 - depending on the use case, you may want to use different compression 
 algorithms, e.g. for disk you may want higher compression ratio like 
 bzip2/lzma, but for wire you'd prefer something fast like snappy
 - supporting multiple compression algorithms and levels would complicate the 
 API
 - this would probably complicate the code, since you'd have to support 
 optional compression, and have a way to indicate which format is used
 - that's really mixing two entirely different concepts (serialization vs 
 compression)

I agree with Charles-François.
A feature that may be actually nice to have in the pickle protocol would
be some framing, to help with streaming unpickling (right now unpickling
a stream can read almost one byte at a time, IIRC).
However, that would also make the protocol and the pickler significantly
more complex.

--

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



[issue6028] Interpreter aborts when chaining an infinite number of exceptions

2013-04-26 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Closing as won't fix. There is no sane way around the current behaviour.

--
resolution:  - wont fix
status: open - closed

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



[issue17794] Priority Queue

2013-04-26 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


Removed file: http://bugs.python.org/file30019/issue17794.patch

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



[issue17794] Priority Queue

2013-04-26 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
nosy:  -mark.dickinson

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



[issue13355] random.triangular error when low = high=mode

2013-04-26 Thread Mark Dickinson

Mark Dickinson added the comment:

Raymond:  have you had time to look at this yet?

--

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



[issue17839] base64 module should use memoryview

2013-04-26 Thread Kushal Das

Kushal Das added the comment:

A patch with tests update to use memoryview in base64 module.

--
keywords: +patch
Added file: http://bugs.python.org/file30022/issue17839_v1.patch

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-04-26 Thread Arfrever Frehtes Taifersar Arahesis

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


--
nosy: +Arfrever

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



[issue17848] issue about compile with clang and build a shared lib

2013-04-26 Thread leon zheng

New submission from leon zheng:

build with prefix point to a arbitrary path, can't find the dynamic lib,
and libffi upstream bug:
./configure --prefix=xxx --enable-shared --enable-ipv6 --with-threads CC=clang

--
components: Build
files: mywork.pitch
messages: 187838
nosy: matrixsystem
priority: normal
severity: normal
status: open
title: issue about compile with clang and build a shared lib
type: compile error
versions: Python 3.4
Added file: http://bugs.python.org/file30023/mywork.pitch

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



[issue13355] random.triangular error when low = high=mode

2013-04-26 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Soonish

--
priority: normal - low

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



[issue17826] Setting a side_effect on mock from create_autospec doesn't work

2013-04-26 Thread Michael Foord

Michael Foord added the comment:

This illustrates the difference:

 from mock import Mock, create_autospec
 some_list = [1, 2, 3]
 m = Mock()
 m.side_effect = some_list
 m.side_effect
listiterator object at 0x1004ab7d0
 m2 = create_autospec(lambda: None)
 m2.side_effect = some_list
 m2.side_effect
[1, 2, 3]


When setting a side_effect on a function (created by create_autospec) the 
side_effect setter is not used - so turning the list into an iterator needs to 
be done on first use instead.

--

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



[issue17839] base64 module should use memoryview

2013-04-26 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti
stage: needs patch - patch review

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



[issue15693] expose glossary link on hover

2013-04-26 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2013-04-26 Thread Miroslav Stampar

New submission from Miroslav Stampar:

httplib module's auxiliary class LineAndFileWrapper contains a readline() 
method having no arguments (than self). It's being used in code where commented 
with assume it's a Simple-Response from an 0.9 server as a wrapper for 
response stream (self.fp = LineAndFileWrapper(line, self.fp)).

In some cases readline() method requires a size argument (e.g. used with size 
argument inside HTTPMessage/readheaders(), HTTPResponse/begin(), 
HTTPResponse/_read_chunked, HTTPConnection/_tunnel, at least in Python 2.7.1+ 
(r271:86832, Sep 27 2012, 21:12:17)).

This bug is hard to be reproduced as it requires a little help of divine 
intervention.

One such exception looks like (reproduced on one user machine):
...
conn = urllib2.urlopen(req)
File /usr/lib/python2.7/urllib2.py, line 127, in urlopen
return _opener.open(url, data, timeout)
File /usr/lib/python2.7/urllib2.py, line 401, in open
response = self._open(req, data)
File /usr/lib/python2.7/urllib2.py, line 419, in _open
'_open', req)
File /usr/lib/python2.7/urllib2.py, line 379, in _call_chain
result = func(*args)
File /usr/share/sqlmap/lib/request/httpshandler.py, line 64, in https_open
return self.do_open(HTTPSConnection if ssl else httplib.HTTPSConnection, req)
File /usr/lib/python2.7/urllib2.py, line 1178, in do_open
h.request(req.get_method(), req.get_selector(), req.data, headers)
File /usr/lib/python2.7/httplib.py, line 962, in request
self._send_request(method, url, body, headers)
File /usr/lib/python2.7/httplib.py, line 996, in _send_request
self.endheaders(body)
File /usr/lib/python2.7/httplib.py, line 958, in endheaders
self._send_output(message_body)
File /usr/lib/python2.7/httplib.py, line 818, in _send_output
self.send(msg)
File /usr/lib/python2.7/httplib.py, line 780, in send
self.connect()
File /usr/share/sqlmap/lib/request/httpshandler.py, line 46, in connect
sock = create_sock()
File /usr/share/sqlmap/lib/request/httpshandler.py, line 39, in create_sock
self._tunnel()
File /usr/lib/python2.7/httplib.py, line 748, in _tunnel
line = response.fp.readline(_MAXLINE + 1)
TypeError: readline() takes exactly 1 argument (2 given)

--
components: Library (Lib)
messages: 187841
nosy: stamparm
priority: normal
severity: normal
status: open
title: Missing size argument in readline() method for httplib's class 
LineAndFileWrapper
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4, Python 3.5

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



[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2013-04-26 Thread Miroslav Stampar

Miroslav Stampar added the comment:

Mentioned divine intervention could be:

1) Argument strict should be set to 0/False when instantiating HTTPResponse
2) No status should be returned from the backend server (hence the # assume 
it's a Simple-Response from an 0.9 server)
3) Any part of response should be read (body, headers, etc.) as HTTPResponse's 
method begin() uses self.fp.readline(_MAXLINE + 1)

--

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



[issue17721] Help button on preference window doesn't work

2013-04-26 Thread Guilherme Simões

Guilherme Simões added the comment:

Attached is a patch that removes the Help button from the Preferences window.

Maybe it would be nice to have the Help button open a text file describing 
every possible option, but while this doesn't happen it is better to remove 
this button.

--
keywords: +patch
Added file: http://bugs.python.org/file30024/Issue17721.patch

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



[issue17826] Setting a side_effect on mock from create_autospec doesn't work

2013-04-26 Thread Kushal Das

Kushal Das added the comment:

Working on this.

--
nosy: +kushaldas

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



[issue17826] Setting a side_effect on mock from create_autospec doesn't work

2013-04-26 Thread Kushal Das

Kushal Das added the comment:

Patch along with a test for the same.

--
keywords: +patch
Added file: http://bugs.python.org/file30025/issue17826_v1.patch

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



[issue16133] asyncore.dispatcher.recv doesn't handle EAGAIN / EWOULDBLOCK

2013-04-26 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

I confirm I can reproduce this issue also in pyftpdlib:
https://code.google.com/p/pyftpdlib/issues/detail?id=255
Current proposed patch returning '' is not ideal as for asynchat '' is an alias 
for 'connection lost'.
In summary recv() in case of EAGAIN should return None and 
asynchat.handle_read() should take that into account.
Will provide a patch later.

--
assignee:  - giampaolo.rodola

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



[issue17837] Support for building on ppc64p7

2013-04-26 Thread David Edelsohn

David Edelsohn added the comment:

If you look at the top of config.sub it says:

# Please send patches with a ChangeLog entry to config-patc...@gnu.org.

# You can get the latest version of this script from:
# 
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD

I do not know Python's policy on merging these types of patches, but most 
projects want the patch in the upstream repository from which they import.  
They do not need to update to the latest, but at least backport the patch from 
config.sub HEAD instead of diverging and potentially losing the patch with the 
next update.

I do not see your patch there now. I'm surprised that it's not there already if 
needed for Fedora.

--

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



[issue16133] asyncore.dispatcher.recv doesn't handle EAGAIN / EWOULDBLOCK

2013-04-26 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Patch is in attachment.
I'm a bit worried about Python versions  3.4 because this kinds of breaks 
backward compatibility as recv() is not expected to return None but I see no 
other saner solution.

--
keywords: +patch
Added file: http://bugs.python.org/file30026/issue16133.patch

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



[issue17837] Support for building on ppc64p7

2013-04-26 Thread Bohuslav Slavek Kabrda

Bohuslav Slavek Kabrda added the comment:

Hmm, good point. I'll try to discuss with Fedora people who work on secondary 
arches. Thanks.

--

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



[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2013-04-26 Thread R. David Murray

R. David Murray added the comment:

Thanks for the report.  Looks like it is a fairly rare case, which I suppose is 
why it hasn't been reported before.

If the could be turns out to be sufficient, that should be enough for someone 
to write a test for this.  The patch itself should be even easier.

--
keywords: +easy
nosy: +r.david.murray
stage:  - needs patch
type:  - behavior
versions:  -Python 2.6, Python 3.1, Python 3.2, Python 3.5

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



[issue17837] Support for building on ppc64p7

2013-04-26 Thread David Edelsohn

David Edelsohn added the comment:

I meant I don't see the equivalent of your patch in the upstream repository, so 
no one from the Fedora community appears to have contributed something 
equivalent yet.

--

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



[issue17850] unicode_escape encoding fails for '\\Upsilon'

2013-04-26 Thread Edward K. Ream

New submission from Edward K. Ream:

On both windows and Linux the following fails on Python 2.7:

   s = '\\Upsilon'
   unicode(s,unicode_escape)

UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in position 0-7: 
end of string in escape sequence

BTW, the six.py package uses this call.  If this call doesn't work, six is 
broken.

--
components: Library (Lib)
messages: 187852
nosy: Edward.K..Ream
priority: normal
severity: normal
status: open
title: unicode_escape encoding fails for '\\Upsilon'
type: crash
versions: Python 2.7

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



[issue17850] unicode_escape encoding fails for '\\Upsilon'

2013-04-26 Thread Ezio Melotti

Ezio Melotti added the comment:

This is not a bug, \U should be followed by 8 hex digits and it indicates a 
Unicode codepoint:
 '\\u0065'.decode('unicode_escape')
u'e'
 '\\U0065'.decode('unicode_escape')
u'e'
 '\\Upsilon'.decode('unicode_escape')
Traceback (most recent call last):
  File stdin, line 1, in module
UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in position 0-7: 
end of string in escape sequence
 u'\Upsilon'
  File stdin, line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in 
position 0-7: end of string in escape sequence
 u'\U0065'
u'e'

--
nosy: +ezio.melotti
resolution:  - invalid
stage:  - committed/rejected
status: open - closed
type: crash - behavior

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



[issue17850] unicode_escape encoding fails for '\\Upsilon'

2013-04-26 Thread Edward K. Ream

Edward K. Ream added the comment:

Thanks for your quick reply.

If this is not a bug, why does six define six.u as unicode(s,unicode_escape) 
for *all* u constants??

--

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



[issue17850] unicode_escape encoding fails for '\\Upsilon'

2013-04-26 Thread R. David Murray

R. David Murray added the comment:

Because as Ezio demonstrated, it produces the same result as using the 'u' 
prefix on the same string.

--
nosy: +r.david.murray

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



[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2013-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Python 3.3 doesn't support HTTP/0.9 and doesn't have LineAndFileWrapper class.

--
nosy: +christian.heimes, serhiy.storchaka
versions:  -Python 3.3, Python 3.4

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



[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-04-26 Thread Roger Serwy

Roger Serwy added the comment:

If we remove .close() then we'll need to then have an alternative way to allow 
exit() and quit() to actually close IDLE. The RPC proxy already transfers 
exceptions between the subprocess and the front-end, so we could catch the 
SystemExit exception and handle it by calling close(). That's perfectably 
doable, and likely the right way to do it. If anyone wants to write that patch, 
I'll gladly offer guidance if necessary.

Here's a dirty hack that also solves the issue. Garbage collection on the 
PseudoInputFile for sys.stdin calls .close(). As long as we hold an extra 
reference to it, it won't close. The attached patch holds an extra reference to 
sys.stdin in Lib/idlelib/run.py.

--
keywords: +patch
Added file: http://bugs.python.org/file30027/hold_stdin.patch

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



[issue17850] unicode_escape encoding fails for '\\Upsilon'

2013-04-26 Thread Edward K Ream

Edward K Ream added the comment:

On Fri, Apr 26, 2013 at 8:51 AM, Edward K. Ream rep...@bugs.python.orgwrote:


 If this is not a bug, why does six define six.u as
 unicode(s,unicode_escape) for *all* u constants??


Oops.  The following works::

s = r'\\Upsilon'
unicode(s,unicode_escape)

My apologies for the noise.

Edward

--
nosy: +edreamleo

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



[issue17721] Help button on preference window doesn't work

2013-04-26 Thread Roger Serwy

Changes by Roger Serwy roger.se...@gmail.com:


--
nosy: +terry.reedy

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



[issue17842] Add base64 module tests for a bytearray argument

2013-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Needed tests for decoders.

--

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



[issue11218] pattern=None when following documentation for load_tests and unittest.main()

2013-04-26 Thread vila

Changes by vila v.ladeuil+bugs-pyt...@free.fr:


--
nosy: +vila

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



[issue16662] load_tests not invoked in package/__init__.py

2013-04-26 Thread vila

Changes by vila v.ladeuil+bugs-pyt...@free.fr:


--
nosy: +vila

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



[issue17839] base64 module should use memoryview

2013-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Not only memoryview should be supported, but any class which supports the 
buffer protocol and is C-contiguous (i.e. array.array).

--
nosy: +serhiy.storchaka

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



[issue16316] Support xz compression in mimetypes module

2013-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Xz-related mimetypes was added because Python 3.3+ supports xz compression. 
Backporting them to 3.3 makes sense. But backporting to 2.7 is more 
questionable.

--

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



[issue15535] Fix pickling efficiency of named tuples in 2.7.3

2013-04-26 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I would like to call this a critical regression.
Under 2.7 and 3.2, all pickle protocols are affected.
Under 3.3 and 3.4, pickle protocols 0 and 1 are affected.

(unfortunately, 3.2 doesn't receive bugfixes anymore)

--
nosy: +benjamin.peterson, pitrou
priority: high - release blocker

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



[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-26 Thread Antoine Pitrou

Antoine Pitrou added the comment:

queue.PriorityQueue is a locked class for use in multi-threaded code. That's 
like saying Queue is a good substitute for list :-)

OTOH, the proposed patch raises a lot of warning signs for me. I will wait for 
a decision on the feature's desirability before making a review.

--
nosy: +pitrou

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



[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This issue is not important enough. We can defer fixing until a better patch 
will be proposed.

In any case please add an explaining comment to your patch when committing it. 
Otherwise some future code will depend on self.stdin.

--

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



[issue15535] Fix pickling efficiency of named tuples in 2.7.3

2013-04-26 Thread Antoine Pitrou

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


--
nosy: +georg.brandl, larry
stage:  - needs patch
versions: +Python 3.3, Python 3.4

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



[issue17834] Add Heap (and DynamicHeap) classes to heapq module

2013-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

From my multilingual experience I can say that priority queue is very rarely 
used type of collections (but if it needed it is very usefull). On one hand, 
Python stdlib already contains one such type, and this type will be good 
enough in non-performance-critical applications. On other hand, a non-locked 
implementation using heapq is trivial (just encapsulate a list inside a 
class), no one will implement it wrong (if do not over-complicate the 
interface). I don't see the need for yet one priority queue. The presence of 
two very similar types in the stdlib will lead to confusion.

--

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



[issue17827] Document codecs.encode and codecs.decode

2013-04-26 Thread Tshepang Lekhonkhobe

Tshepang Lekhonkhobe added the comment:

So, why place them in What's New?

--
nosy: +tshepang

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



[issue17827] Document codecs.encode and codecs.decode

2013-04-26 Thread Ezio Melotti

Ezio Melotti added the comment:

To advertise them?  It should be explained that they are not new, but that now 
they are documented and can/should be used.

--

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



[issue17842] Add base64 module tests for a bytearray argument

2013-04-26 Thread Kushal Das

Kushal Das added the comment:

All the decoders create bytes as result, not sure how to assume if the result 
should be bytes or bytearray.

--

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



[issue16316] Support xz compression in mimetypes module

2013-04-26 Thread Éric Araujo

Éric Araujo added the comment:

In my opinion supporting xz in the standard library is totally separate from 
keeping the mime types registry up to date.

--

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



[issue16316] Support xz compression in mimetypes module

2013-04-26 Thread R. David Murray

R. David Murray added the comment:

I agree with Éric.

--

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



[issue17827] Document codecs.encode and codecs.decode

2013-04-26 Thread Tshepang Lekhonkhobe

Tshepang Lekhonkhobe added the comment:

I was not aware that such things are placed in What's New. I just looked at 
such a document for 3.3... makes a lot of sense.

--

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




[issue17803] Calling Tkinter.Tk() with a baseName keyword argument throws UnboundLocalError

2013-04-26 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Line 35 is import sys so sys imports within functions are superfluous, as 
well as contrary to current guidelines. There is another on 1033. Both were 
removed before 3.3, so this amounts to a 2.7 backport.

It took me a moment to see that the unneeded conditional import is not 
innocuous, as it localizes 'sys' while sometimes leaving it unbound. Good catch.

Yashuhiro, can you sign a PSF contributor license agreement? The electronic 
version is easy.
  http://www.python.org/psf/contrib/contrib-form/
We don't really need it for this patch, but we hope to see more from you.

A minimal test would be a unittest version of
  assert isinstance(Tk(baseName=test), Tk)
This mainly tests that no exceptions are raised when the arg is present. The 
doc may suggest that baseName should have a visible effect on the instance that 
could be tested. If there is already a 3.x test, it should be backported. If 
not, anything added to 2.7 should be added to 3.x also.

--
nosy: +terry.reedy

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



[issue17842] Add base64 module tests for a bytearray argument

2013-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The argument should be tested, not the result.

--

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-04-26 Thread Antoine Pitrou

Antoine Pitrou added the comment:

A proof of concept hack to enable framing on pickle showed a massive 
performance increase on streaming unpickling (up to 5x faster with a C file 
object such as io.BytesIO, up to 150x faster with a pure Python file object 
such as _pyio.BytesIO). There is a slight slowdown on non-streaming operation, 
but that could probably be optimized.

--

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



[issue17804] streaming struct unpacking

2013-04-26 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I think 'iter_unpack' is deceptive and wrong for the following reason. Up to 
now, 'ixyz' or 'iterxyz' or 'iter_xyz' has meant a version of 'xyz' that 
presents items one at a time rather than all at once in a collection object 
(usually in a list). Unpack returns a tuple, but the new function would *not* 
present the members of the tuple one at time. Instead, it would apply unpack 
multiple times, yielding multiple tuples. I would call the new thing 
'unpack_all' or 'unpacker' (the latter works especially well for an iterator 
class). An unpacker is a person or machine that repeatedly unpacks. (I was once 
a bottle unpacker for a college summer job ;-).

struct.unpacker(fmt, buffer)
Return an iterator that repeatedly unpacks successive buffer slices of size 
calcsize(fmt) into tuples according to the format string fmt. The buffer length 
must be an exact multiple of calcsize(fmt)). (? Not clear from text 
description. Add param to allow remainder?)

--
nosy: +terry.reedy

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-04-26 Thread Antoine Pitrou

Antoine Pitrou added the comment:

(note: I've updated PEP 3154 with framing and GLOBAL_STACK)

--

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 A feature that may be actually nice to have in the pickle protocol would
be some framing, to help with streaming unpickling (right now unpickling
a stream can read almost one byte at a time, IIRC).
 However, that would also make the protocol and the pickler significantly
more complex.

What if just use io.BufferedReader?

if not isinstance(file, io.BufferedReader):
file = io.BufferedReader(file)

(at start of _Unpickler.__init__)

--

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-04-26 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 What if just use io.BufferedReader?
 
 if not isinstance(file, io.BufferedReader):
 file = io.BufferedReader(file)
 
 (at start of _Unpickler.__init__)

Two problems:

1. semantically, it is wrong; the BufferedReader will read bytes beyond
the pickle end, so the underlying stream will be desynchronized

2. performance-wise, it doesn't solve the issue either: read() method
calls are costly, even on an optimized C object

--

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



[issue17825] Indentation.offset and SyntaxError.offset mismatch

2013-04-26 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Perhaps Florent is pointing to the fact that for 'except X:', the syntax error 
is detected at the ' ' at offset 6 but the caret is backed up under the 't' at 
offset 5*, whereas it is not backed up to the space before 'open'. Which 
behavior do you propose to change?

Since these details of presentation are not documented, I do not consider the 
current difference a bug. I would not change them in current versions since 
change could confuse people or software. I suspect there is also danger of 
making some cases worse. For the same reasons, I would not change in future 
versions either without good offsetting reason. So I also think this should be 
closed.

On python-list, we tell people that the caret is a starting point for detecting 
the error, not an absolute pointer.

For syntax errors, Idle omits the traceback and highlights in red the presumed 
error. For the first, it marks the entire word 'except'. For the second, it 
marks the last whitespace before open. This is equivalent to backing up the 
caret.

* I suspect this backup is special to keywords. For 'except+', both systems 
also mark the keyword, not the '+'. Either the keyword is misused or is a 
regular name misspelled. In either case, someone thought it better to point to 
the keyword than the space or other character after. I agree. So did the Idle 
author who decided to highlight the keyword rather than the character after it.

--
nosy: +terry.reedy

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



[issue17804] streaming struct unpacking

2013-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d232cff25bbd by Antoine Pitrou in branch 'default':
Issue #17804: New function ``struct.iter_unpack`` allows for streaming struct 
unpacking.
http://hg.python.org/cpython/rev/d232cff25bbd

--
nosy: +python-dev

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



[issue17804] streaming struct unpacking

2013-04-26 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, I don't want the bikeshedding to last too long, so I committed the patch 
with docs. Thanks everyone!

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue17838] Can't assign a different value for sys.stdin in IDLE

2013-04-26 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I think PseudoXxxFile should have close methods, but that the methods should 
not be called when they should not be. Rebinding sys.stdin should not close 
command line input.

My perhaps naive thought is that initializing sys.__stdin__ to the original 
sys.stdin, as in the standard interpreter and as specified in the docs, is the 
proper place for the extra reference to keep PseudoInputFile alive. (I presume 
we are talking about the object in the user process.) While the sys module doc 
says that any of sys.std** and sys.__std**__ can be None on Windows pythonw gui 
apps, that does not make None a good idea ;-).

--

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



[issue17846] Building Python on Windows - Supplementary info

2013-04-26 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I have also had problems, and I think the devguide needs a chapter on the 
subject. I have additional info from Steve Dower of MS to add. There are also 
proposed rewrites of the .bat files to be factored it to any doc. Thank you for 
your writeup.

--
components: +Devguide
nosy: +ezio.melotti, terry.reedy
type:  - enhancement

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



[issue17846] Building Python on Windows - Supplementary info

2013-04-26 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
stage:  - needs patch
versions:  -Python 3.4

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



[issue9682] socket.create_connection error message for domain subpart with invalid length is very confusing

2013-04-26 Thread R. David Murray

R. David Murray added the comment:

As I said in the review, thanks for working more on this.

For the reason for (3), look at the test just before the ones you added.

--

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



[issue17818] aifc.Aifc_read/Aifc_write.getparams can return a namedtuple

2013-04-26 Thread R. David Murray

R. David Murray added the comment:

I made review comments: patch looks good, tests need a bit of work.  Would you 
be interested in adding the What's New entry as well? (Doc/whatsnew/3.4).

--
stage:  - patch review

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



[issue17818] aifc.Aifc_read/Aifc_write.getparams can return a namedtuple

2013-04-26 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Hello. I changed the patch according to your review comments. Here is the new 
version.

--
Added file: http://bugs.python.org/file30028/aifc_2.patch

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



[issue17851] Grammar errors in threading.Lock documentation

2013-04-26 Thread Andriy Mysyk

New submission from Andriy Mysyk:

No need for comma in which one of the waiting threads proceeds is not defined, 
and may vary across implementations.

Once a thread has acquired a lock, subsequent attempts to acquire it block, 
until it is released; any thread may release it should read are blocked 
instead of block.


/Documents/python/cpython/Doc/build/html/library/threading.html

--
messages: 187887
nosy: amysyk
priority: normal
severity: normal
status: open
title: Grammar errors in threading.Lock documentation
type: enhancement
versions: Python 3.4

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



[issue17851] Grammar errors in threading.Lock documentation

2013-04-26 Thread Andriy Mysyk

Andriy Mysyk added the comment:

submitting a patch for both grammar errors

--
assignee:  - docs@python
components: +Documentation
keywords: +patch
nosy: +docs@python
Added file: http://bugs.python.org/file30029/issue17851.patch

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



[issue17794] Priority Queue

2013-04-26 Thread Daniel Wong

Daniel Wong added the comment:

btw, I have a related patch: http://bugs.python.org/issue17834 Chances of it 
being accepted aren't looking good right now though.

--

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