[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-12-09 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

Sounds fine.
Just a note to my original intent in #7741:
We were using the InteractiveConsole class to implement a remote web-based 
console for our EVE servers.  Often, as a means to hot-fix certain issues, we 
would paste code snippets into these windows to define functions, execute code, 
etc.  Previously we had our own console like implementation, but the 
interactive features of the InteractiveConsole were _really_ nice, but lacking 
in multi-line support.  We have had the stdlib patched as per my original 
suggestion for the past few years to support it.

--

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



[issue7330] PyUnicode_FromFormat: implement width and precision for %s, %S, %R, %V, %U, %A

2012-12-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I found one bug and add some nitpicks and optimization suggestion on Rietveld.

--
nosy: +serhiy.storchaka

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



[issue16580] Add examples to int.to_bytres and int.from_bytes

2012-12-09 Thread Paddy McCarthy

Paddy McCarthy added the comment:

On 06/12/2012 14:31, Ezio Melotti wrote:
 Ezio Melotti added the comment:

 I agree.  The examples in the doc seem clear to me, whereas the ones you 
 proposed are not as clear.  Do you think there's something that they don't 
 currently cover that should be added?

 --
 nosy: +ezio.melotti

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

First, Thanks Ezio and Andrew for your replies.

My problem was that when working on bitcoin address validation I saw 
code that was shifting and 'ing with 0xFF to convert to multiple bytes 
and half remembered that there might be a Python function to do that. On 
finding the .to_bytes method and its parameter big or little, the 
only way I had of working out which to use was to try each until I found 
out which worked.

I therefore thought that what would have helped me was code that showed 
the equivalent expanded Python for the method in a similar way to what 
is done for some of the itertools functions etc.

If we split my request into two:

 1. Is such extra explanation necessary.
 2. Is my specific code that extra explanation.

I can work on the code a bit more.
Have I persuaded you that an extra explanation is necessary?

Thanks, Paddy.

P.S. I guess what is currently present shows the result of the methods 
but nothing on how it could be generated. I am stating that the 
generation can aid comprehension.

--

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



[issue16580] Add examples to int.to_bytres and int.from_bytes

2012-12-09 Thread Ezio Melotti

Ezio Melotti added the comment:

Usually we add plain Python equivalents when they are simple enough that the 
code equivalent is as understandable as the prose or more (see for example 
http://docs.python.org/3/library/functions.html#all, or the itertools functions 
you mentioned).
For this case I think it would help if you presented an equivalent function, 
e.g.:

def to_bytes(n, length, order):
if order == 'little':
return bytes((n  i*8)  0xff for i in range(length))
elif order == 'big':
return bytes((n  i*8)  0xff for i in reversed(range(length)))

or even:

def to_bytes(n, length, order):
indexes = range(length) if order == 'little' else reversed(range(length))
return bytes((n  i*8)  0xff for i in indexes)

This is also done for 
http://docs.python.org/3.3/library/stdtypes.html#int.bit_length just above 
to/from_bytes, so it might be a good addition.
If this is done, the equivalent function can also be added to the test suite, 
so we can verify that it's indeed equivalent.

--
keywords: +easy
stage:  - needs patch
versions: +Python 2.7, Python 3.2, Python 3.4

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



[issue16326] distutils build_ext fails to set library_dirs in 2.7.2 on Linux

2012-12-09 Thread Vinay Sajip

Vinay Sajip added the comment:

 Vinay, do you think dereferencing sys.executable could lead to trouble with 
 venvs?

It could - the venv code looks for a venv configuration file relative to 
sys.executable, which could be a symlink into a system-wide Python 
installation. Resolving the symlink would mean that the venv can't be found.

--

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



[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-12-09 Thread Nick Coghlan

Nick Coghlan added the comment:

Good to know - I guess in most circumstances copy-and-paste already works, 
because the input will be arriving via a line-buffered IO stream.

I was thinking that with #16649 implemented, it would be possible to simply 
switch from single to exec, without users needing to request the 
multi-statement support explicitly. However, I'm now back to wondering if such 
a change might have a few unforeseen consequences I haven't thought of.

So if that seems like too much of a risk to backwards compatibility, how about 
moving the symbol argument to __init__, rather than needing to supply it with 
each call to push?

--

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



[issue11159] Sax parser crashes if given unicode file name

2012-12-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

However Python doesn't work with bytes filenames (I don't think this is a bug).

The proposed patch allows unicode filenames be used in SAX parser.

--
keywords: +patch
nosy: +serhiy.storchaka
stage:  - patch review
Added file: http://bugs.python.org/file28268/sax_unicode_fn-2.7.patch

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



[issue13512] ~/.pypirc created insecurely

2012-12-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thank you Eric!

--

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



[issue16650] Popen._internal_poll() references errno.ECHILD outside of the local scope

2012-12-09 Thread Antoine Pitrou

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


--
nosy: +gregory.p.smith

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



[issue15955] gzip, bz2, lzma: add option to limit output size

2012-12-09 Thread Nadeem Vawda

Nadeem Vawda added the comment:

 # Using zlib's interface
 while not d.eof:
 compressed = d.unconsumed_tail or f.read(8192)
 if not compressed:
 raise ValueError('End-of-stream marker not found')
 output = d.decompress(compressed, 8192)
 # process output

 This is not usable with bzip2. Bzip2 uses large block size and 
 unconsumed_tail 
 can be non empty but decompress() will return b''. With zlib you possible can 
 see the same effect on some input when read by one byte.

I don't see how this is a problem. If (for some strange reason) the
application-specific processing code can't handle empty blocks properly, you can
just stick if not output: continue before it.


 Actually it should be:

 # Using zlib's interface
 while not d.eof:
 output = d.decompress(d.unconsumed_tail, 8192)
 while not output and not d.eof:
 compressed = f.read(8192)
 if not compressed:
 raise ValueError('End-of-stream marker not found')
 output = d.decompress(d.unconsumed_tail + compressed, 8192)
 # process output

 Note that you should use d.unconsumed_tail + compressed as input, and 
 therefore
 do an unnecessary copy of the data.

Why is this necessary? If unconsumed_tail is b'', then there's no need to
prepend it (and the concatenation would be a no-op anyway). If unconsumed_tail
does contain data, then we don't need to read additional compressed data from
the file until we've finished decompressing the data we already have.


 Without explicit unconsumed_tail you can write input data in the internal
 mutable buffer, it will be more effective for large buffer (handreds of KB)
 and small input chunks (several KB).

Are you proposing that the decompressor object maintain its own buffer, and
copy the input data into it before passing it to the decompression library?
Doesn't that just duplicate work that the library is already doing for us?

--

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



[issue13390] Hunt memory allocations in addition to reference leaks

2012-12-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c40f4c19d20b by Antoine Pitrou in branch 'default':
Issue #13390: New function :func:`sys.getallocatedblocks()` returns the number 
of memory blocks currently allocated.
http://hg.python.org/cpython/rev/c40f4c19d20b

--
nosy: +python-dev

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



[issue13390] Hunt memory allocations in addition to reference leaks

2012-12-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Committed and pushed!

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

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



[issue16632] Enable DEP and ASLR

2012-12-09 Thread Lukas Lueg

Lukas Lueg added the comment:

Only way to be sure: Enable  announce for 3.5 and wait for bug reports

--
nosy: +ebfe

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



[issue16632] Enable DEP and ASLR

2012-12-09 Thread Christian Heimes

Christian Heimes added the comment:

DEP isn't much of an issue. It's automatically disabled for the entire process 
when one library w/o DEP is loaded.

--

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



[issue16248] Security bug in tkinter allows for untrusted, arbitrary code execution.

2012-12-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d8300842a0e9 by Antoine Pitrou in branch '3.2':
Issue #16248: Disable code execution from the user's home directory by tkinter 
when the -E flag is passed to Python.
http://hg.python.org/cpython/rev/d8300842a0e9

New changeset 10d04bdb05ab by Antoine Pitrou in branch '3.3':
Issue #16248: Disable code execution from the user's home directory by tkinter 
when the -E flag is passed to Python.
http://hg.python.org/cpython/rev/10d04bdb05ab

New changeset a4fc52da295b by Antoine Pitrou in branch 'default':
Issue #16248: Disable code execution from the user's home directory by tkinter 
when the -E flag is passed to Python.
http://hg.python.org/cpython/rev/a4fc52da295b

--
nosy: +python-dev

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



[issue16248] Security bug in tkinter allows for untrusted, arbitrary code execution.

2012-12-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 822b472eff13 by Antoine Pitrou in branch '2.7':
Issue #16248: Disable code execution from the user's home directory by tkinter 
when the -E flag is passed to Python.
http://hg.python.org/cpython/rev/822b472eff13

--

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



[issue16248] Security bug in tkinter allows for untrusted, arbitrary code execution.

2012-12-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Fixed. I will let Benjamin and Barry decide whether this deserves backporting 
to security branches. Benjamin, Barry, please do your job :)

--
nosy: +barry, benjamin.peterson
resolution:  - fixed
stage:  - committed/rejected
status: open - pending

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



[issue16490] inspect.getargspec() and inspect.getcallargs() don't work for builtins

2012-12-09 Thread Berker Peksag

Berker Peksag added the comment:

This looks like a duplicate of issue 1748064.

--
nosy: +berker.peksag

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



[issue16248] Security bug in tkinter allows for untrusted, arbitrary code execution.

2012-12-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 03b3124e9ea3 by Antoine Pitrou in branch '3.1':
Issue #16248: Disable code execution from the user's home directory by tkinter 
when the -E flag is passed to Python.
http://hg.python.org/cpython/rev/03b3124e9ea3

--
status: pending - open

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



[issue16649] Add a PyCF_DISPLAY_EXPRESSION_RESULTS flag

2012-12-09 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I'm sort of surprised single doesn't handle that already. Should it not?

--

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



[issue16616] test_poll.PollTests.poll_unit_tests() is dead code

2012-12-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5a022c21ad84 by Richard Oudkerk in branch 'default':
Issue #16616: Enable test in test_poll which was (accidentally?) disabled
http://hg.python.org/cpython/rev/5a022c21ad84

--
nosy: +python-dev

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



[issue16647] LMTP.connect() loses socket error details

2012-12-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch updated. It can be simpler.

--
Added file: 
http://bugs.python.org/file28269/smtplib_LMTP_connect_raise_err_2.patch

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



[issue16647] LMTP.connect() loses socket error details

2012-12-09 Thread Serhiy Storchaka

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


Removed file: 
http://bugs.python.org/file28264/smtplib_LMTP_connect_raise_err.patch

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



[issue16650] Popen._internal_poll() references errno.ECHILD outside of the local scope

2012-12-09 Thread Andrew Svetlov

Andrew Svetlov added the comment:

The patch LGTM.
About _handle_exitstatus: I guess nothing wrong to fix it also.

--

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



[issue16650] Popen._internal_poll() references errno.ECHILD outside of the local scope

2012-12-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm just asking if this is a bug. If using building exceptions is safe, then we 
can get rid of _os_error and _ECHILD in 3.3+, using OSError and 
ChildProcessError instead.

--

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



[issue15955] gzip, bz2, lzma: add option to limit output size

2012-12-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 you can just stick if not output: continue before it.

And then hang. Because d.unconsumed_tail is not empty and no new data will be 
read.

 Why is this necessary? If unconsumed_tail is b'', then there's no need to
 prepend it (and the concatenation would be a no-op anyway). If
 unconsumed_tail does contain data, then we don't need to read additional
 compressed data from the file until we've finished decompressing the data
 we already have.

What if unconsumed_tail is not empty but less than needed to decompress at 
least one byte? We need read more data until unconsumed_tail grow enought to 
be decompressed.

 Are you proposing that the decompressor object maintain its own buffer, and
 copy the input data into it before passing it to the decompression library?
 Doesn't that just duplicate work that the library is already doing for us?

unconsumed_tail is such buffer and when we call decompressor with new chunk of 
data we should allocate buffer of size (len(unconsumed_tail)+len(compressed)) 
and copy len(unconsumed_tail) bytes from unconsumed_tail and len(compressed) 
from gotten data. But when you use internal buffer, you should only copy new 
data.

--

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



[issue16650] Popen._internal_poll() references errno.ECHILD outside of the local scope

2012-12-09 Thread Gregory P. Smith

Gregory P. Smith added the comment:

it's a potential bug.  your patch looks good.

as for _handle_exitstatus referring to SubprocessError, that is fine.  In that 
situation it is trying to raise the exception and the only time that would ever 
be a problem is when called by the gc during a __del__ where such an exception 
for this impossible situation cannot be caught anyways.  It would effectively 
become an uncaught NameError instead of an uncaught SubprocessError; not a big 
deal.

--

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



[issue16651] Find out what stdlib modules lack a pure Python implementation

2012-12-09 Thread Brett Cannon

New submission from Brett Cannon:

I'm wondering which modules in the stdlib lack pure Python implementations (and 
could legitimately have one, e.g. sqlite can't really have a pure Python 
implementation). Once we know how big/small the list is a decision could be 
made as to whether to take on the effort to bring over some pure Python version 
from another VM or something for any of these modules.

To start the list:

csv
itertools

--
components: Library (Lib)
keywords: easy
messages: 177230
nosy: brett.cannon
priority: low
severity: normal
status: open
title: Find out what stdlib modules lack a pure Python implementation
versions: Python 3.4

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



[issue16651] Find out what stdlib modules lack a pure Python implementation

2012-12-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

array
audioop
binascii
random
re
struct
xml.parsers.expat
cjkcodecs

zlib, bz2, lzma and crypts also can be implemented in pure Python.

--
nosy: +serhiy.storchaka

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



[issue16651] Find out what stdlib modules lack a pure Python implementation

2012-12-09 Thread Alex Gaynor

Changes by Alex Gaynor alex.gay...@gmail.com:


--
nosy: +alex

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



[issue16651] Find out what stdlib modules lack a pure Python implementation

2012-12-09 Thread Christian Heimes

Christian Heimes added the comment:

hashlib backends (md5, sha1, sha256 / 384 / 512) either through openssl 
wrappers or implementations based on libtomcrypt.

--
nosy: +christian.heimes

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



[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2012-12-09 Thread Stefan Krah

Stefan Krah added the comment:

Here are some things that I'm interested in right now:

   1) From what kind of data structure are signature objects generated?

   2) Is there an easy way to do this manually?

   3) Can at least part of the verboseness go into header files (virtually
  all compilers support static inline in header files)?

   4) Why don't approaches work that look simpler on the surface, like
  http://mail.python.org/pipermail/python-dev/2012-December/122934.html ?

   5) Are C contributors in general happy (or at least tolerate) the new
  verboseness?


Sure, we can discuss 1) to 3) here. For recording objections or approaches
that don't work (think FAQ Why don't you just do X?) a PEP would be nice
to have.


If I'm the only one who is slightly bothered by the aesthetic and readability
aspects, then 5) obviously need not be discussed. Most people, however, will
probably find out about the change only once Python 3.4 is released.

--

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



[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2012-12-09 Thread Larry Hastings

Larry Hastings added the comment:

I disagree that the Clinic DSL is verbose.  Certainly I find it
more succinct than what we do now.

On the other hand, the syntax you proposed in the python-dev message
you cite is insufficient to the task.  Consider a function that
takes a char *.  How might you want Python to convert the Python
value into that char *?  Should it only accept bytes?  Should it
accept bytes and Unicode?  Should it accept objects exposing the
buffer protocol?  Do you want the length too?  If you want the
length, does that mean that you accept nulls inside the string?
If it's Unicode, do you want to use a default encoding, or do you
want to specify an encoding?  Or do you want to specify your own
conversion function?

My solution for the above is to add flags.  Which is,
semantically, the only important distinction between what you
propose and Clinic's DSL.  (That and the per-argument docstrings,
which I already suggest are negotiable.)  The remaining differences
are that you want to cram everything onto one line, wheras Clinic's
DSL spreads things over multiple lines.  I suggest the latter is
more readable, particularly when the number of arguments grows
large.

To answer 5), you're the only C contributor who comes to mind who
seems unhappy.  Do I understand you correctly that your main pain
point is that you generate scores of identical functions with the
C preprocessor, and you see no way to do that with Clinic?  If we
figured out a way to make that work with Clinic, would that reduce
your concerns?

--

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



[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2012-12-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le dimanche 09 décembre 2012 à 19:20 +, Stefan Krah a écrit :
 
 If I'm the only one who is slightly bothered by the aesthetic and readability
 aspects, then 5) obviously need not be discussed.

You're not the only one. The vertical space argument also resonates with
me, although I'm not sure how easy it would be to put the generated
boilerplate into separate include files.

The DSL is a bit weird, it doesn't seem to have consistent typography
rules, some lines end with a colon, some lines don't, some assignment
signs (=) have spaces around them, some don't.

--

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



[issue16651] Find out what stdlib modules lack a pure Python implementation

2012-12-09 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
nosy: +asvetlov

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



[issue16652] socket.getfqdn docs are not explicit enough about the algorithm.

2012-12-09 Thread R. David Murray

New submission from R. David Murray:

From the docs it isn't quite clear if getfqnd() does the equivalent of:

  gethostbyaddr('127.0.0.1')

or

  gethostbyaddr(gethostbyname(gethostname()))

It matters which it is, when debugging a host's name configuration and DNS 
server problems.

--
assignee: docs@python
components: Documentation
messages: 177236
nosy: docs@python, r.david.murray
priority: normal
severity: normal
status: open
title: socket.getfqdn docs are not explicit enough about the algorithm.
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

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



[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2012-12-09 Thread telmich

telmich added the comment:

Anyone alive at bugs.python.org?

--

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



[issue13211] urllib2.HTTPError does not have 'reason' attribute.

2012-12-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e1ba514ddcd2 by Senthil Kumaran in branch '3.2':
Fix issue13211 - Document the reason attribute for urllib.error.HTTPError
http://hg.python.org/cpython/rev/e1ba514ddcd2

--

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



[issue16634] urllib.error.HTTPError.reason is not documented

2012-12-09 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Thanks for raising the bug and patch,  Berker Peksag.
Fixed in all versions.

--
nosy: +orsenthil
resolution:  - fixed
status: open - closed

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



[issue16653] reference kept in f_locals prevents the tracing/profiling of a destructor

2012-12-09 Thread Xavier de Gaye

New submission from Xavier de Gaye:

The following debugging session, run with python on the default branch, shows
that pdb does not stop in __del__ when it is invoked.

The reason is:

  - The destructor is not called when processing the 'c = 1' statement because
foo frame.f_locals owns a reference to the C instance.
  - When the interpreter is about to invoke the trace function with the ensuing
debug event, the call to PyFrame_LocalsToFast in call_trampoline causes the
destructor to be invoked (as shown by gdb), and the destructor is not traced
because at that time tstate-use_tracing is false.

This is confirmed by the fact that when 'c = 1' is replaced with
'c = 1; locals()' (on one single line so as not to trigger the trace function
before the call to locals()), then pdb stops in __del__.

===   foo.py   
class C:
def __del__(self):
print(Calling C destructor.)

def foo():
c = C()
import pdb; pdb.set_trace()
c = 1

foo()
===
$ ./python /tmp/foo.py
 /tmp/foo.py(8)foo()
- c = 1
(Pdb) step
Calling C destructor.
--Return--
 /tmp/foo.py(8)foo()-None
- c = 1
(Pdb)
===

--
components: Interpreter Core
messages: 177240
nosy: xdegaye
priority: normal
severity: normal
status: open
title: reference kept in f_locals prevents the tracing/profiling of a destructor
type: behavior
versions: Python 3.4

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



[issue11122] bdist_rpm should use rpmbuild, not rpm

2012-12-09 Thread Eric V. Smith

Eric V. Smith added the comment:

I agree on just switching to rpmbuild, at least for 3.4.

--

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



[issue16582] Tkinter calls SystemExit with string

2012-12-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fed68e0bce53 by Andrew Svetlov in branch '3.2':
Issue #16582: use int exit code in tkinter._exit
http://hg.python.org/cpython/rev/fed68e0bce53

New changeset e39677feabe0 by Andrew Svetlov in branch '3.3':
Issue #16582: use int exit code in tkinter._exit
http://hg.python.org/cpython/rev/e39677feabe0

New changeset 5ad5efc847c7 by Andrew Svetlov in branch 'default':
Issue #16582: use int exit code in tkinter._exit
http://hg.python.org/cpython/rev/5ad5efc847c7

New changeset 37c1d20facd7 by Andrew Svetlov in branch '2.7':
Issue #16582: use int exit code in tkinter._exit
http://hg.python.org/cpython/rev/37c1d20facd7

--
nosy: +python-dev

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



[issue16582] Tkinter calls SystemExit with string

2012-12-09 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Fixed. Thanks.

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

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



[issue16653] reference kept in f_locals prevents the tracing/profiling of a destructor

2012-12-09 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Tracing/profiling is disabled when tstate-tracing is true or
tstate-use_tracing is false. The proposed patch fixes the problem by reducing
the scope where this condition is true.

As a consequence call_trace, profile_trampoline, trace_trampoline and
call_trampoline may now be called recursively.

The patch includes a test case.

--
keywords: +patch
Added file: http://bugs.python.org/file28270/issue_16653.diff

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



[issue16653] reference kept in f_locals prevents the tracing/profiling of a destructor

2012-12-09 Thread Antoine Pitrou

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


--
nosy: +georg.brandl
versions: +Python 3.2, Python 3.3

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



[issue16649] Add a PyCF_DISPLAY_EXPRESSION_RESULTS flag

2012-12-09 Thread Nick Coghlan

Nick Coghlan added the comment:

Not when the string is provided as one big block of text. I haven't checked
yet if including a blank line after compound statements makes a difference,
though.

--

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



[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-12-09 Thread Chris Withers

Changes by Chris Withers ch...@simplistix.co.uk:


--
nosy:  -cjw296

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



[issue16654] IDLE problems with Mac OS 10.6.8 (print syntax)

2012-12-09 Thread stephenhohs

New submission from stephenhohs:

Numerous attempts were made to install (and deinstall) IDLE along with getting 
the recommended version of ActiveTCL.  IDLE will always give a print syntax 
error with one liners print hello, world.  This is occurring for Mac OS 10.6.8

--
components: IDLE
messages: 177246
nosy: stephenhohs
priority: normal
severity: normal
status: open
title: IDLE problems with Mac OS 10.6.8 (print syntax)
versions: Python 3.3

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



[issue16651] Find out what stdlib modules lack a pure Python implementation

2012-12-09 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Would it make sense for this list to be somehow reflected in or be 
reconstructible from the documentation?

--
nosy: +chris.jerdonek

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



[issue16049] Create abstract base classes by inheritance rather than a direct invocation of __metaclass__

2012-12-09 Thread Raymond Hettinger

Raymond Hettinger added the comment:

+1 The patch looks fine.

Éric do you want to apply it?

--

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



[issue16629] IDLE: Calltips test fails due to int docstring change

2012-12-09 Thread Chris Jerdonek

Chris Jerdonek added the comment:

FYI, in the 3.2 branch I get 4 failures rather than just the one due to int:

$ ./python.exe Lib/idlelib/CallTips.py
int - expected
'int(x[, base]) - integer'
 - but got
'int(x=0) - integer'
list.append - expected
'L.append(object) - None -- append object to end'
 - but got
'L.append(object) -- append object to end'
[].append - expected
'L.append(object) - None -- append object to end'
 - but got
'L.append(object) -- append object to end'
List.append - expected
'L.append(object) - None -- append object to end'
 - but got
'L.append(object) -- append object to end'
4 of 41 tests failed

Also, what is the recommended way to run IDLE tests?  It doesn't seem to be a 
part of regrtest, and I didn't see this information in the devguide.

--

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



[issue14783] Make int() and str() docstrings correct

2012-12-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 181c170c6270 by Chris Jerdonek in branch '3.2':
Issue #16629: Fix IDLE idlelib.CallTips test.  Patch by Roger Serwy.
http://hg.python.org/cpython/rev/181c170c6270

--

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



[issue16629] IDLE: Calltips test fails due to int docstring change

2012-12-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 181c170c6270 by Chris Jerdonek in branch '3.2':
Issue #16629: Fix IDLE idlelib.CallTips test.  Patch by Roger Serwy.
http://hg.python.org/cpython/rev/181c170c6270

New changeset 5182cc18b7b4 by Chris Jerdonek in branch '3.3':
Issue #16629: Merge IDLE test fix from 3.2.
http://hg.python.org/cpython/rev/5182cc18b7b4

New changeset db17a49395c2 by Chris Jerdonek in branch 'default':
Issue #16629: Merge IDLE test fix from 3.3.
http://hg.python.org/cpython/rev/db17a49395c2

--
nosy: +python-dev

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



[issue16629] IDLE: Calltips test fails due to int docstring change

2012-12-09 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks a lot, Roger!

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

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



[issue16655] IDLE list.append calltips test failures

2012-12-09 Thread Chris Jerdonek

New submission from Chris Jerdonek:

There are three IDLE test failures in the 3.2 branch:

$ ./python.exe Lib/idlelib/CallTips.py
list.append - expected
'L.append(object) - None -- append object to end'
 - but got
'L.append(object) -- append object to end'
[].append - expected
'L.append(object) - None -- append object to end'
 - but got
'L.append(object) -- append object to end'
List.append - expected
'L.append(object) - None -- append object to end'
 - but got
'L.append(object) -- append object to end'
3 of 41 tests failed

--
components: IDLE
messages: 177253
nosy: chris.jerdonek, kbk
priority: normal
severity: normal
status: open
title: IDLE list.append calltips test failures
type: behavior
versions: Python 3.2

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



[issue16629] IDLE: Calltips test fails due to int docstring change

2012-12-09 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I created issue 16655 for the three test failures I observed above.

--

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



[issue16654] IDLE problems with Mac OS 10.6.8 (print syntax)

2012-12-09 Thread R. David Murray

R. David Murray added the comment:

The statement

print hello world 

is indeed invalid syntax in Python3.

--
nosy: +r.david.murray
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue16654] IDLE problems with Mac OS 10.6.8 (print syntax)

2012-12-09 Thread stephenhohs

stephenhohs added the comment:

You are right.

Thanks

Stephen M. Hohs

smh...@aol.com

--

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



[issue15207] mimetypes.read_windows_registry() uses the wrong regkey, creates wrong mappings

2012-12-09 Thread Ben Hoyt

Ben Hoyt added the comment:

Either way -- this needs to be reverted or fixed. It's a nasty gotcha for folks 
writing Python web services at the moment. I'm still for reverting, per my 
reasons above.

Dave Chambers, I'm not for faster but broken but for faster and fixed -- 
from what I've shown above, it's the Windows registry that's broken, so 
removing read_windows_registry() entirely would fix this (and as a bonus, be 
faster and simplify the code :-).

Per your suggestion http://bugs.python.org/issue15207#msg177092 -- I don't 
understand how mimetypes.py would know the types that aren't hardcoded.

R. David Murray, I don't understand the advantage of trying to maintain a list 
of Windows fixes. What if this list was wrong, or there was a Windows update 
which broke more mime types? Why can't we just avoid the complication and go 
back to the hardcoded types for Windows?

--

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



[issue8109] Server-side support for TLS Server Name Indication extension

2012-12-09 Thread danblack

danblack added the comment:

I've added a full set of alert descriptions and cleaned up the doco some more.

The reference counting when the SNI callback comes in is my greatest worry.

--
Added file: http://bugs.python.org/file28271/issue-8109-sni-serverside.patch

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



[issue15207] mimetypes.read_windows_registry() uses the wrong regkey, creates wrong mappings

2012-12-09 Thread Dave Chambers

Dave Chambers added the comment:

 removing read_windows_registry()
If you're suggesting hardcoding *ALL* the mimetypes for *ALL* OSes, I think 
that's probably the best overall solution.
No variability, as fast as can be.
The downside is that there would occasionally be an unrecognized type, thus 
there'd need to be diligence to keep the hardcoded list up to date, but overall 
I think Ben Hoyt's suggestion is best.

--

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



[issue15207] mimetypes.read_windows_registry() uses the wrong regkey, creates wrong mappings

2012-12-09 Thread Ben Hoyt

Ben Hoyt added the comment:

Actually, I was suggesting using the hardcoded types for Windows only (i.e., 
only removing read_windows_registry). Several bugs have been opened on problems 
with the Windows registry mimetypes, but as far as I know this isn't an issue 
on Linux -- in other words, if Linux/other systems ain't broke, no need to fix 
them.

--

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



[issue10852] SSL/TLS sni use in smtp, pop, imap, nntp, ftp client libs by default

2012-12-09 Thread danblack

danblack added the comment:

the one error in the previous review corrected.

--

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



[issue16580] Add examples to int.to_bytres and int.from_bytes

2012-12-09 Thread Paddy McCarthy

Paddy McCarthy added the comment:

On 09/12/2012 10:55, Ezio Melotti wrote:
 Ezio Melotti added the comment:

 Usually we add plain Python equivalents when they are simple enough that the 
 code equivalent is as understandable as the prose or more (see for example 
 http://docs.python.org/3/library/functions.html#all, or the itertools 
 functions you mentioned).
 For this case I think it would help if you presented an equivalent function, 
 e.g.:

 def to_bytes(n, length, order):
  if order == 'little':
  return bytes((n  i*8)  0xff for i in range(length))
  elif order == 'big':
  return bytes((n  i*8)  0xff for i in reversed(range(length)))

 or even:

 def to_bytes(n, length, order):
  indexes = range(length) if order == 'little' else reversed(range(length))
  return bytes((n  i*8)  0xff for i in indexes)

 This is also done for 
 http://docs.python.org/3.3/library/stdtypes.html#int.bit_length just above 
 to/from_bytes, so it might be a good addition.
 If this is done, the equivalent function can also be added to the test suite, 
 so we can verify that it's indeed equivalent.

 --
 keywords: +easy
 stage:  - needs patch
 versions: +Python 2.7, Python 3.2, Python 3.4

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

The second example looks great. I like the dual use for testing too and 
will try and remember both the next time I find I have ireas about the 
documentation.

Thanks guys. It's appreciated!

--

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



[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2012-12-09 Thread Larry Hastings

Larry Hastings added the comment:

What lines end with a colon?

--

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



[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2012-12-09 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 What lines end with a colon?

He probably means semicolon, for example:

+int dir_fd = DEFAULT_DIR_FD;
+default=None

--

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



[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2012-12-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

  What lines end with a colon?
 
 He probably means semicolon, for example:
 
 +int dir_fd = DEFAULT_DIR_FD;
 +default=None

Oops, yes, sorry. Semicolon indeed.

--

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