[issue16220] wsgiref does not call close() on iterable response

2012-10-17 Thread Brent Tubbs

Brent Tubbs added the comment:

Updated patch with test attached.

--
Added file: http://bugs.python.org/file27608/wsgiref_close_plus_test.patch

___
Python tracker 

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



[issue16273] f.tell() returning negative number on Windows build

2012-10-17 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +pitrou
priority: normal -> high

___
Python tracker 

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



[issue1723038] Curses Menu

2012-10-17 Thread Benjamin Trofatter

Benjamin Trofatter added the comment:

I took the curses.panel module as a starting point as well but have made rather 
a bit more progress with the extension.  The attached patch includes a full 
wrapper around the curses menu extension, tests, documentation, and the 
necessary additions to setup.py.  Feedback would be much appreciated as I'm 
also most of the way through a wrapper for the curses form extension and would 
like to get it finished up shortly.

--
nosy: +bentrofatter
versions: +Python 3.4 -Python 3.2
Added file: http://bugs.python.org/file27607/curses_menu.patch

___
Python tracker 

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



[issue16257] test_socket.test_create_connection tests for wrong errno on Solaris

2012-10-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8599036d9140 by Trent Nelson in branch '2.7':
Issue #16257: make test_create_connection() handle ENETUNREACH.
http://hg.python.org/cpython/rev/8599036d9140

--

___
Python tracker 

___
___
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-10-17 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Apparently when replying by email my old account name is shown ("mani and ram") 
Just so you know that "mani and ram" is me.

--

___
Python tracker 

___
___
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-10-17 Thread mani and ram

mani and ram added the comment:

On 17 October 2012 23:46, Guilherme Polo  wrote:

>
> Guilherme Polo added the comment:
>
> It is a well known fact that the readprofile function uses exec, and it
> has been like that for more than 18 years. The parameters baseName and
> className defines the execution of the files $HOME/.{className}.tcl,
> $HOME/.{className}.py, $HOME/.{baseName}.tcl, and $HOME/.{baseName}.py. The
> function's docstring actually say that.
>
> Said that, I never needed to load custom code during the creation of a Tk
> instance. To me the existence of readprofile is unneeded.
>
> But what is your proposal to the issue ?
>
> --
>
> ___
> Python tracker 
> 
> ___
>

Simply remove the readprofile code (it is not documented and I never had to
use it)

--
nosy: +maniandram

___
Python tracker 

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



[issue15032] Provide a select.select implemented using select.poll

2012-10-17 Thread Gregory P. Smith

Gregory P. Smith added the comment:

indeed, i don't know that there is any point to this idea.

i'm all for just getting rid of all uses of select in the stdlib and making 
them poll only in 3.4 unless someone can point to a modern system that does not 
support poll.

--

___
Python tracker 

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



[issue16266] Rephrase sentence in tutorial about universal newlines

2012-10-17 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Committed.  Thanks for the report!

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type: behavior -> enhancement

___
Python tracker 

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



[issue16266] Rephrase sentence in tutorial about universal newlines

2012-10-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7b2a13b20b33 by Chris Jerdonek in branch '3.2':
Clarify universal-newline wording in tutorial (issue #16266).
http://hg.python.org/cpython/rev/7b2a13b20b33

New changeset b5439bca219f by Chris Jerdonek in branch '3.3':
Merge from 3.2: clarify universal-newline wording in tutorial (issue #16266).
http://hg.python.org/cpython/rev/b5439bca219f

New changeset a45cb181e4d0 by Chris Jerdonek in branch 'default':
Merge from 3.3: clarify universal-newline wording in tutorial (issue #16266).
http://hg.python.org/cpython/rev/a45cb181e4d0

--
nosy: +python-dev

___
Python tracker 

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



[issue16273] f.tell() returning negative number on Windows build

2012-10-17 Thread Raymond Hettinger

New submission from Raymond Hettinger:

On a fresh 64-bit install of Windows 2.7.3 running on Windows 7, f.tell() is 
producing unexpected (and unusable) results:

>>> f = open('sample.txt')
>>> f.read(3)
>>> f.read(3)
>>> f.tell()
-5L

--
components: Interpreter Core
messages: 173226
nosy: rhettinger
priority: normal
severity: normal
status: open
title: f.tell() returning negative number on Windows build
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue16268] dir(closure) does not find __dir__

2012-10-17 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Here is a somewhat simpler way to reproduce (following the same definition of 
x):

>>> dir(x)
  ...
TypeError: object does not provide __dir__
>>> x.__dir__

>>> dir(x)
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', 
'__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', 
'__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', 
'__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'cell_contents']

The dir() documentation says, "If the object has a method named __dir__(), this 
method will be called and must return the list of attributes."

(from http://docs.python.org/py3k/library/functions.html#dir )

--
nosy: +chris.jerdonek
title: dir(closure) claims that a closure has no __dir__, only to work later 
after manually invoking __dir__ from its type -> dir(closure) does not find 
__dir__
versions: +Python 3.4

___
Python tracker 

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



[issue16270] urllib hangs when closing connection

2012-10-17 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
title: ftplib hangs when closing connection -> urllib hangs when closing 
connection

___
Python tracker 

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



[issue16270] ftplib hangs when closing connection

2012-10-17 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

I can reproduce the issue on python 3.3.
To have a clearer understanding on what's going on use:

import urllib.request
import ftplib
ftplib.FTP.debugging = 4
url = "ftp://ftp.fu-berlin.de/pub/misc/movies/database/ratings.list.gz";
with urllib.request.urlopen(url):
pass

The problem appears to be endtransfer() erroneously calling ftp.voidresp() (it 
just shouldn't):
http://hg.python.org/cpython/file/f6fcff683866/Lib/urllib/request.py#l2328
Patch in attachment fixes the issue.

--
keywords: +patch
Added file: http://bugs.python.org/file27606/urllib.patch

___
Python tracker 

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



[issue16270] ftplib hangs when closing connection

2012-10-17 Thread R. David Murray

R. David Murray added the comment:

Well, urllib calls ftplib for ftp urls, so it might be about ftplib.  But in 
that case it would be better to have a reproducer that *just* uses ftplib.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue15032] Provide a select.select implemented using select.poll

2012-10-17 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

It's not clear to me how you intend to provide this exactly. 
To me it looks like a good candidate for a recipe, otherwise I don't see it as 
a good fit for the stdlib.

--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue16269] multiprocessing.Queue uses select()

2012-10-17 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
resolution:  -> duplicate
status: open -> closed

___
Python tracker 

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



[issue16272] C-API documentation clarification for tp_dictoffset

2012-10-17 Thread Chris Colbert

New submission from Chris Colbert:

The documentation of the tp_dictoffset is a bit unclear when describing the 
responsibilities of a base type with a nonzero tp_dictoffset.
http://docs.python.org/c-api/typeobj.html

I feel there should some statement to the effect of:

"""

If a type defines a nonzero tp_dictoffset, that type is responsible for 
defining a `__dict__` slot as part of the tp_getset structures. Failure to do 
so will result in the dict being inaccesible from Python via `obj.__dict__` 
from instances of the type or subtypes.

"""

The reasoning is twofold:

1) `PyType_Ready` does not add the default getset members like `type_new` does. 
This prevents the instances of the type itself from retrieving `obj.__dict__`

2) `type_new` will provide the default `subtype_dict` getset member for 
subclasses, but this calls `get_builtin_base_with_dict` which will resolve to 
the most base type which is not heap allocated; in this case, the C type. Since 
this type has no `__dict__` getset member, the lookup fails.


Adding a bit of verbage about this "gotcha" would likely save some headaches in 
the future.

--
assignee: docs@python
components: Documentation
messages: 173222
nosy: Chris.Colbert, docs@python
priority: normal
severity: normal
status: open
title: C-API documentation clarification for tp_dictoffset
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4, Python 3.5

___
Python tracker 

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



[issue1283110] Give __len__() advice for "don't know"

2012-10-17 Thread Todd Rovito

Todd Rovito added the comment:

New patch with a better reference to the source for the test case.  This was 
suggested by PythonMentors list.  I think the patch improves the documentation. 
 This works on Python 3.4.

--
Added file: http://bugs.python.org/file27605/DataModel__len__.patch

___
Python tracker 

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



[issue10527] multiprocessing.Pipe problem: "handle out of range in select()"

2012-10-17 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue16269] multiprocessing.Queue uses select()

2012-10-17 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Speaking of which, it seems this is a duplicate of issue 10527.

--

___
Python tracker 

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



[issue16269] multiprocessing.Queue uses select()

2012-10-17 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

> Do you mean at the C level?

No, Python of course.

> poll(), unlike select(), does not have to scan an fd_set 
> (of 1024 bits?) so I would have expected it to be faster if anything.

That might be true in a continuous loop (e.g. a reactor).
Judging from where this is supposed to take place 
(http://hg.python.org/cpython/file/f6fcff683866/Lib/multiprocessing/connection.py#l865)
 what you would end up doing within the wait() function is:

- init_pollster()
- register(fd) * num of fds
- unregister(fd) * num of fds
- close_pollster()

...and I suspect that's likely to be slower than just using select(), even if 
you cache the poll object. Anyway, I might be wrong, and figuring that out with 
a simple benchmark is easy.
Other than that I'm not sure how often wait() gets called usually so even if a 
slowdown is introduced that might not even be a problem.

--

___
Python tracker 

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



[issue16271] weird dual behavior with changing __qualname__; different values observed through attribute and descriptor

2012-10-17 Thread Christopher the Magnificent

New submission from Christopher the Magnificent:

The output below is NOT typed at the Python interactive interpeter.  The ">>> " 
shows what is being evaluated and the line below it shows what the result it.

The output gets generated here:  (lines 418-449 of the attached file)

def name_globalize_class(name, second=None):
def decorator(cls):

def printval(source, value=None):
print(">>> " + source)
if value is not None:
print(repr(value))
print("in decorator: new name is:", repr(name))
print()
printval("cls", cls)
printval("cls.__name__", cls.__name__)
printval("cls.__qualname__", cls.__qualname__)
printval('type.__dict__["__qualname__"].__get__(cls)',
 type.__dict__["__qualname__"].__get__(cls))
print()

cls.__name__ = name
cls.__qualname__ = name

stuff = ">>> cls.__name__ = {0}\n>>> cls.__qualname__ = {0}\n"
print(stuff.format(repr(name)))

printval("cls.__name__", cls.__name__)
printval("cls.__qualname__", cls.__qualname__)
printval('type.__dict__["__qualname__"].__get__(cls)',
 type.__dict__["__qualname__"].__get__(cls))
printval("cls", cls)
print()
globals()[name] = cls
pdb.set_trace()
return cls
return decorator

HERE IS THE OUTPUT:

>>> cls
._TokenClass'>
>>> cls.__name__
'_TokenClass'
>>> cls.__qualname__
'_maketokensnodes.._TokenClass'
>>> type.__dict__["__qualname__"].__get__(cls)
'_maketokensnodes.._TokenClass'

>>> cls.__name__ = 'KEYWORD'
>>> cls.__qualname__ = 'KEYWORD'

>>> cls.__name__
'KEYWORD'
>>> cls.__qualname__
'KEYWORD'
>>> type.__dict__["__qualname__"].__get__(cls)
'_maketokensnodes.._TokenClass'
>>> cls
._TokenClass'>

END OF OUTPUT

Note how after assigning to cls.__qualname__ it looks like the class's 
dictionary object has been assigned into, masking the class's C-level type 
attribute-level ht_qualname!

My gut feeling is that this has to be some kind of a bug.  Let me know if it is.

--
components: Interpreter Core
files: parser_BUGGY2.py
messages: 173217
nosy: christopherthemagnificent
priority: normal
severity: normal
status: open
title: weird dual behavior with changing __qualname__; different values 
observed through attribute and descriptor
versions: Python 3.3
Added file: http://bugs.python.org/file27604/parser_BUGGY2.py

___
Python tracker 

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



[issue16269] multiprocessing.Queue uses select()

2012-10-17 Thread Richard Oudkerk

Richard Oudkerk added the comment:

> select() other than being supported on all platforms has the advantage of 
> being simple and quick to use (you just call it once by passing a set of fds 
> and then you're done).

Do you mean at the C level?  Wouldn't you just do

  struct pollfd pfd = {fd, POLLIN, 0};
  if (poll(&pfd, 1, timeout) < 0) {...}
  ready = pfd.revents != 0;

That does not look any less simple and quick.

> on the other hand you introduce a considerable slowdown given the amount 
> of operations involved and described above.

poll(), unlike select(), does not have to scan an fd_set (of 1024 bits?) so I 
would have expected it to be faster if anything.

At the python level creating a new poll object each time might indeed be 
slower, but one could always cache it on the queue object.

BTW, are there any non-Windows platforms which support multiprocessing but 
don't have poll()?  (On Windows WaitForSingleObject() is used instead.)

--

___
Python tracker 

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



[issue1283110] Give __len__() advice for "don't know"

2012-10-17 Thread Todd Rovito

Changes by Todd Rovito :


Removed file: http://bugs.python.org/file27589/DataModel__len__.patch

___
Python tracker 

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



[issue16269] multiprocessing.Queue uses select()

2012-10-17 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

On one hand this seems reasonable to me, on the other hand I'm not sure.
select() other than being supported on all platforms has the advantage of being 
simple and quick to use (you just call it once by passing a set of fds and then 
you're done).

poll() / epoll() aren't as simple as they require:

- e/poll() object initialization
- fds registration 
- fds unregistration
- e/poll() object destruction

Given the exact point where this is supposed to take place (here: 
http://hg.python.org/cpython/file/f6fcff683866/Lib/multiprocessing/connection.py#l865)
 I'm not sure it's really worth the effort as on one hand you fix a pretty rare 
scalability issue, on the other hand you introduce a considerable slowdown 
given the amount of operations involved and described above.

--

___
Python tracker 

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



[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-17 Thread Christian Heimes

Changes by Christian Heimes :


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

___
Python tracker 

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



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-10-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1250498db562 by Trent Nelson in branch '3.3':
Issue #15298: refactor previous fix from 66959d419369.
http://hg.python.org/cpython/rev/1250498db562

New changeset a0614e041bc8 by Trent Nelson in branch 'default':
Merge issue #15298.
http://hg.python.org/cpython/rev/a0614e041bc8

--

___
Python tracker 

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



[issue16269] multiprocessing.Queue uses select()

2012-10-17 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d2127cdec10e by Christian Heimes in branch 'default':
Issue #16166: Add PY_LITTLE_ENDIAN and PY_BIG_ENDIAN macros and unified
http://hg.python.org/cpython/rev/d2127cdec10e

--
nosy: +python-dev

___
Python tracker 

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



[issue16270] ftplib hangs when closing connection

2012-10-17 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

I guess this is about urllib, not ftplib.

--

___
Python tracker 

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



[issue16269] multiprocessing.Queue uses select()

2012-10-17 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +sbt
versions: +Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-17 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Looks fine to me. I suppose you'll have to check the big endian buildbots.

--
stage: needs patch -> commit review

___
Python tracker 

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



[issue16270] ftplib hangs when closing connection

2012-10-17 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
keywords: +3.3regression
nosy: +giampaolo.rodola, orsenthil
versions: +Python 3.4

___
Python tracker 

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



[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-17 Thread Christian Heimes

Christian Heimes added the comment:

I've replaced the macros with PY_BIG_ENDIAN or PY_LITTLE_ENDIAN. Both are 
always defined and exactly one is set to 1, the other to 0.

--
Added file: http://bugs.python.org/file27603/endian2.patch

___
Python tracker 

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



[issue16270] ftplib hangs when closing connection

2012-10-17 Thread Ugra Dániel

New submission from Ugra Dániel:

With version 3.3 (64 bit on Arch Linux) Python now hangs when closing FTP 
connection on some sites:

url = "ftp://ftp.fu-berlin.de/pub/misc/movies/database/ratings.list.gz";

with urllib.request.urlopen( url ):
pass

--
components: Library (Lib)
messages: 173209
nosy: daniel.ugra
priority: normal
severity: normal
status: open
title: ftplib hangs when closing connection
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue16269] multiprocessing.Queue uses select()

2012-10-17 Thread William Edwards

New submission from William Edwards:

If you have 1024 file descriptors already open, the file descriptors created 
internally in multiprocessing.Queue will be beyond 1024 and the select() call 
buried deep in the Queue will throw an exception.

In fact, all uses of select() in the Python libs should be use poll() where 
available instead, obviously.

--
components: IO
messages: 173208
nosy: William.Edwards
priority: normal
severity: normal
status: open
title: multiprocessing.Queue uses select()
type: behavior
versions: Python 2.6, Python 2.7

___
Python tracker 

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



[issue14900] cProfile does not take its result headers as sort arguments

2012-10-17 Thread Andrew Svetlov

Andrew Svetlov added the comment:

I'm waiting for your patch.
Thanks.

--

___
Python tracker 

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



[issue16203] Proposal: add re.fullmatch() method

2012-10-17 Thread Antoine Pitrou

Antoine Pitrou added the comment:

FWIW, I prefer "fullmatch" as well :)

--

___
Python tracker 

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



[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-17 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I would prefer if you yanked PY_LITTLE_ENDIAN_FLAG. We don't need two different 
ways to do it.

--

___
Python tracker 

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



[issue12759] "(?P=)" input for Tools/scripts/redemo.py raises unnhandled exception

2012-10-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> My only question is, the exception we raise now says, there invalid 
>characters in the group name, whether in our case the group name is just empty.

Good point. It would be better if you move the test outside isname() function 
and immediately raise an error with an appropriate message.

--
nosy: +serhiy.storchaka
stage: patch review -> needs patch

___
Python tracker 

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



[issue15814] memoryview: equality-hash invariant

2012-10-17 Thread Martin v . Löwis

Martin v. Löwis added the comment:

3.3.1 is correct, you apparently missed msg169425.

--

___
Python tracker 

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



[issue13301] the script Tools/i18n/msgfmt.py allows arbitrary code execution via po files

2012-10-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch does not unquote strings ("spam\n" is interpreted as r"spam\n") and 
allows invalid entry such as "\\" or boo.

--
nosy: +serhiy.storchaka
stage: patch review -> needs patch
versions: +Python 3.4

___
Python tracker 

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



[issue16268] dir(closure) claims that a closure has no __dir__, only to work later after manually invoking __dir__ from its type

2012-10-17 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue15814] memoryview: equality-hash invariant

2012-10-17 Thread Mark Lawrence

Mark Lawrence added the comment:

The 3.3.0 docs now state "Note Hashing of memoryviews with formats other than 
‘B’, ‘b’ or ‘c’ as well as hashing of multi-dimensional memoryviews is possible 
in version 3.3.0, but will raise an error in 3.3.1 in order to be compatible 
with the new memoryview equality definition."  I assume 3.3.1 should read 3.4, 
or have I missed something?

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue16262] srcdir != builddir builds fail, if hg is not installed

2012-10-17 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-17 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16267] order of decorators @abstractmethod and @classmethod is significant (is not documented to be in @abstractclassmethod which advises their combined use)

2012-10-17 Thread Andrew Svetlov

Andrew Svetlov added the comment:

After brief looking sources I figured out it can be solved by adding setters 
for __isabstractmethod__ to classmethod/staticmethod objects.
It can be done, I'll try to make a patch.

For property situation is worse: property is abstract if any of 
getter/setter/deleter is abstract.
Which object attribute should be set for setting __isabstractmethod__ for 
property?

We can make the rule: abstractmethod for classmethod/staticmethod/property 
should set descriptor as abstract, not functions behind it.

I'm not sure is it true solution but I like to try to make a patch for that.

Anyway, the patch for describing current behavior in the docs is welcome.

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

___
Python tracker 

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



[issue16258] test_local.TestEnUSCollection failures on Solaris 10

2012-10-17 Thread STINNER Victor

STINNER Victor added the comment:

Python 3.2 rejects characters outside the range U+-U+10 in
some operations, but not everywhere. I fixed Python 3.3 to be more
strict and always reject characters outside this range. I noticed the
Solaris issue with mbstowcs() on locale encodings different than
UTF-8: #13441. I asked if it's more important to be strict on Unicode,
or if we need to handle the wcsxfrm() issue on python-dev:
http://mail.python.org/pipermail/python-dev/2011-December/114759.html

Stefan Krah answered: "Yes, if the cause is a broken mbstowcs() that
sounds good."
http://mail.python.org/pipermail/python-dev/2011-December/114781.html

I asked for help on OpenIndiana IRC channel, but nobody had a locale
encoding different than UTF-8. I didn't have access to a Solaris box,
so I chose to skip failing tests on Solaris.

My commit 2a2d0872d993 (and 7ffe3d304487) skips many locales to
workaround this issue in test__locale.

--

___
Python tracker 

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



[issue16267] order of decorators @abstractmethod and @classmethod is significant (is not documented to be in @abstractclassmethod which advises their combined use)

2012-10-17 Thread Christopher the Magnificent

Christopher the Magnificent added the comment:

As Darren Dale pointed out, it looks like this is a (partial) documentation 
issue.  I think it's plausible that someone like me, who has used 
abstractmethod by itself, would read the docs for abstractclassmethod and not 
re-read the docs on abstract method to know that he needs to put the one 
decorator first and other other second.

Changing Python to make it indifferent to the order of classmethod and 
abstractmethod wouldn't be a bad idea if it isn't too hairy to implement, since 
it does not seem to be intuitive to me and probably others that the order of 
the decorators in this specific situation should matter.

At bare minimum, I recommend that the documentation for abstractclassmethod and 
abstractstaticmethod should be updated to indicate not merely that 
abstractmethod and either classmethod or staticmethod should be used together, 
but IN WHICH ORDER they should be used, if it is decided to preserve the 
sensitivity to ordering.

:-)

--

___
Python tracker 

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



[issue16268] dir(closure) claims that a closure has no __dir__, only to work later after manually invoking __dir__ from its type

2012-10-17 Thread Kushal Das

Changes by Kushal Das :


--
nosy: +kushaldas

___
Python tracker 

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



[issue16268] dir(closure) claims that a closure has no __dir__, only to work later after manually invoking __dir__ from its type

2012-10-17 Thread Christopher the Magnificent

New submission from Christopher the Magnificent:

This is really short, you should spot the inconsistency in the result of the 
same function call fairly easily.

Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 01:25:11) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class Thing:
... def method(self):
... print(__class__)
... 
>>> x = Thing.method.__closure__[0]
>>> dir(x)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: object does not provide __dir__
>>> type(x).__dir__(x)
['__gt__', '__eq__', '__setattr__', '__doc__', '__sizeof__', '__str__', 
'__init__', '__repr__', 'cell_contents', '__dir__', '__ge__', '__class__', 
'__new__', '__ne__', '__subclasshook__', '__hash__', '__lt__', '__reduce__', 
'__le__', '__getattribute__', '__format__', '__reduce_ex__', '__delattr__']
>>> dir(x)
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', 
'__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', 
'__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', 
'__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'cell_contents']
>>>

--
components: Interpreter Core
messages: 173197
nosy: christopherthemagnificent
priority: normal
severity: normal
status: open
title: dir(closure) claims that a closure has no __dir__, only to work later 
after manually invoking __dir__ from its type
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2012-10-17 Thread Chris Calloway

Chris Calloway added the comment:

I have a number of patches for this issue I have worked on during a few local 
Python user group hack nights. I have not submitted them yet, however, as they 
require some expository material here in order to illustrate how they address 
Jerdonek's points. I have a regional Python conference (PyCarolinas) that I 
have some responsibilities in through the weekend, however, and will not be 
able to move forward ASAP until after then.

--

___
Python tracker 

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



[issue13614] setup.py register fails if long_description contains ReST

2012-10-17 Thread Éric Araujo

Éric Araujo added the comment:

The changesets you see are in distutils2, I haven’t had a chance to backport 
them yet.

--
stage: test needed -> commit review
versions: +Python 3.4

___
Python tracker 

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



[issue13614] setup.py register fails if long_description contains ReST

2012-10-17 Thread Petri Lehtinen

Petri Lehtinen added the comment:

Can this be closed?

--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue15450] Allow dircmp.subdirs to behave well under subclassing

2012-10-17 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
keywords: +patch

___
Python tracker 

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



[issue9583] Document startup option/environment interaction

2012-10-17 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Close the issue.
Feel free to reopen if clarification needed.

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

___
Python tracker 

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



[issue16266] Rephrase sentence in tutorial about universal newlines

2012-10-17 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Looks good to me, please apply it.

--

___
Python tracker 

___
___
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-10-17 Thread Guilherme Polo

Guilherme Polo added the comment:

It is a well known fact that the readprofile function uses exec, and it has 
been like that for more than 18 years. The parameters baseName and className 
defines the execution of the files $HOME/.{className}.tcl, 
$HOME/.{className}.py, $HOME/.{baseName}.tcl, and $HOME/.{baseName}.py. The 
function's docstring actually say that.

Said that, I never needed to load custom code during the creation of a Tk 
instance. To me the existence of readprofile is unneeded.

But what is your proposal to the issue ?

--

___
Python tracker 

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



[issue16267] order of decorators @abstractmethod and @classmethod is significant (is not documented to be in @abstractclassmethod which advises their combined use)

2012-10-17 Thread Darren Dale

Darren Dale added the comment:

Quoting the documentation for abstractmethod:

"When abstractmethod() is applied in combination with other method descriptors, 
it should be applied as the innermost decorator, as shown in the following 
usage examples:"

The examples include staticmethod and classmethod.

--

___
Python tracker 

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



[issue16267] order of decorators @abstractmethod and @classmethod is significant (is not documented to be in @abstractclassmethod which advises their combined use)

2012-10-17 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I don't see why classmethod/staticmethod should be special cased if it doesn't 
work for other decorators.

--

___
Python tracker 

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



[issue16267] order of decorators @abstractmethod and @classmethod is significant (is not documented to be in @abstractclassmethod which advises their combined use)

2012-10-17 Thread R. David Murray

R. David Murray added the comment:

I've added the nosy list from issue 11610, in case complicating the 
implementation is seen as sub-optimal :)

--
nosy: +Darren.Dale, benjamin.peterson, daniel.urban, dsdale24, eric.araujo, 
eric.snow, ncoghlan, python-dev, r.david.murray, stutzbach

___
Python tracker 

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



[issue16266] Rephrase sentence in tutorial about universal newlines

2012-10-17 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I would suggest something like this:

"In text mode, the default when reading is to convert platform-specific line 
endings (\n on Unix, \r\n on Windows) to just \n.  When writing in text mode, 
the default is to convert occurrences of \n back to platform-specific line 
endings."

--
keywords: +easy
title: Typo in tutorial -> Rephrase sentence in tutorial about universal 
newlines
versions: +Python 3.4

___
Python tracker 

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



[issue16266] Typo in tutorial

2012-10-17 Thread Chris Jerdonek

Chris Jerdonek added the comment:

The last \n is needed for the reason Andrew mentioned, but it is true that the 
sentence could probably be rephrased to reduce the chance of confusion.

--

___
Python tracker 

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



[issue15268] curses configure checks fail if only /usr/include/ncursesw/curses.h is installed

2012-10-17 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue15483] CROSS: initialise include and library paths in setup.py

2012-10-17 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

___
___
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-10-17 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever, gpolo

___
Python tracker 

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



[issue16267] order of decorators @abstractmethod and @classmethod is significant (is not documented to be in @abstractclassmethod which advises their combined use)

2012-10-17 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue14621] Hash function is not randomized properly

2012-10-17 Thread Christian Heimes

Christian Heimes added the comment:

I've modified unicodeobject's unicode_hash() function. V8's algorithm is about 
55% slower for a 800 MB ASCII string on my box.

Python's current hash algorithm for bytes and unicode:

   while (--len >= 0)
x = (_PyHASH_MULTIPLIER * x) ^ (Py_uhash_t) *P++;

$ ./python -m timeit -s "t = 'abcdefgh' * int(1E8)" "hash(t)"
10 loops, best of 3: 94.1 msec per loop


V8's algorithm:

while (--len >= 0) {
x += (Py_uhash_t) *P++;
x += ((x + (Py_uhash_t)len) << 10);
x ^= (x >> 6);
}

$ ./python -m timeit -s "t = 'abcdefgh' * int(1E8)" "hash(t)"
10 loops, best of 3: 164 msec per loop

--

___
Python tracker 

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



[issue16267] order of decorators @abstractmethod and @classmethod is significant (is not documented to be in @abstractclassmethod which advises their combined use)

2012-10-17 Thread Andrew Svetlov

Andrew Svetlov added the comment:

I think better to fix code to make first sample also work.
It can be done as special cases in abc.abstractmethod to process 
classmethod/staticmethod objects properly.

--

___
Python tracker 

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



[issue16267] order of decorators @abstractmethod and @classmethod is significant (is not documented to be in @abstractclassmethod which advises their combined use)

2012-10-17 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue16267] order of decorators @abstractmethod and @classmethod is significant (is not documented to be in @abstractclassmethod which advises their combined use)

2012-10-17 Thread Christopher the Magnificent

New submission from Christopher the Magnificent:

This may be an issue with the interpreter behavior or it may be a documentation 
issue.

Note: I only selected Python 3.3 as the version, but it probably affects MANY 
other Python versions.

Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 01:25:11) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> import abc
>>> help(abc.abstractclassmethod)
Help on class abstractclassmethod in module abc:

class abstractclassmethod(builtins.classmethod)
 |  A decorator indicating abstract classmethods.
 |  
 |  Similar to abstractmethod.
 |  
 |  Usage:
 |  
 |  class C(metaclass=ABCMeta):
 |  @abstractclassmethod
 |  def my_abstract_classmethod(cls, ...):
 |  ...
 |  
 |  'abstractclassmethod' is deprecated. Use 'classmethod' with
 |  'abstractmethod' instead.
. (et cetra)
.
.
>>> # doesn't work
>>> class Demo(metaclass=abc.ABCMeta):
... @abc.abstractmethod
... @classmethod
... def test(cls):
... pass
... 
Traceback (most recent call last):
  File "", line 1, in 
class Demo3(metaclass=abc.ABCMeta):
  File "", line 3, in Demo3
@classmethod
  File 
"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/abc.py", line 
24, in abstractmethod
funcobj.__isabstractmethod__ = True
AttributeError: attribute '__isabstractmethod__' of 'classmethod' objects is 
not writable
>>> # DOES work
>>> class Demo2(metaclass=abc.ABCMeta):
... @classmethod
... @abc.abstractmethod
... def test(cls):
... pass
... 
>>> Demo2()
Traceback (most recent call last):
  File "", line 1, in 
Demo4()
TypeError: Can't instantiate abstract class Demo2 with abstract methods test


Hopefully this is enough documentation to show what the issues is.  If not, 
just chime in.  :-)

--
assignee: docs@python
components: Documentation, Interpreter Core
messages: 173183
nosy: christopherthemagnificent, docs@python
priority: normal
severity: normal
status: open
title: order of decorators @abstractmethod and @classmethod is significant (is 
not documented to be in @abstractclassmethod which advises their combined use)
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue16258] test_local.TestEnUSCollection failures on Solaris 10

2012-10-17 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +haypo

___
Python tracker 

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



[issue13441] TestEnUSCollation.test_strxfrm() fails on Solaris

2012-10-17 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea
superseder:  -> test_local.TestEnUSCollection failures on Solaris 10

___
Python tracker 

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



[issue9583] Document startup option/environment interaction

2012-10-17 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Applied patch.
Thanks, Todd.
I think the issue can be closed.

--
nosy: +asvetlov
versions: +Python 3.2, Python 3.3

___
Python tracker 

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



[issue9583] Document startup option/environment interaction

2012-10-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2f812212599b by Andrew Svetlov in branch '2.7':
Issue #9583: Document startup option/environment interaction.
http://hg.python.org/cpython/rev/2f812212599b

New changeset a8052ad9752b by Andrew Svetlov in branch '3.2':
Issue #9583: Document startup option/environment interaction.
http://hg.python.org/cpython/rev/a8052ad9752b

New changeset f0bb61cbc046 by Andrew Svetlov in branch '3.3':
Merge issue #9583: Document startup option/environment interaction.
http://hg.python.org/cpython/rev/f0bb61cbc046

New changeset def0e0bb06ef by Andrew Svetlov in branch 'default':
Merge issue #9583: Document startup option/environment interaction.
http://hg.python.org/cpython/rev/def0e0bb06ef

--
nosy: +python-dev

___
Python tracker 

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



[issue15378] Underported Tools/unicode/comparecodecs.py

2012-10-17 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The patch is obviously good, thank you :)

--
nosy: +pitrou
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue15378] Underported Tools/unicode/comparecodecs.py

2012-10-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 98f64cbed2ac by Antoine Pitrou in branch '3.2':
Issue #15378: Fix Tools/unicode/comparecodecs.py.  Patch by Serhiy Storchaka.
http://hg.python.org/cpython/rev/98f64cbed2ac

New changeset f281d7700339 by Antoine Pitrou in branch '3.3':
Issue #15378: Fix Tools/unicode/comparecodecs.py.  Patch by Serhiy Storchaka.
http://hg.python.org/cpython/rev/f281d7700339

New changeset ae1f84fd143e by Antoine Pitrou in branch 'default':
Issue #15378: Fix Tools/unicode/comparecodecs.py.  Patch by Serhiy Storchaka.
http://hg.python.org/cpython/rev/ae1f84fd143e

--
nosy: +python-dev

___
Python tracker 

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



[issue15378] Underported Tools/unicode/comparecodecs.py

2012-10-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Can anyone look at this tiny patch?

--
versions: +Python 3.4

___
Python tracker 

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



[issue15378] Underported Tools/unicode/comparecodecs.py

2012-10-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
Removed message: http://bugs.python.org/msg165687

___
Python tracker 

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



[issue15145] Faster *_find_max_char

2012-10-17 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thanks for the effort, Serhiy!

--

___
Python tracker 

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



[issue15145] Faster *_find_max_char

2012-10-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch updated to tip.

But because results are contradictory and often patched version even slower 
vanilla (and I don't understand why it happens), I close the issue. I think all 
changes are irrelevant and differences are only compiler optimization artifacts.

--
resolution:  -> rejected
stage: patch review -> committed/rejected
status: open -> closed
Added file: http://bugs.python.org/file27602/find_max_char_2.patch

___
Python tracker 

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



[issue16261] Fix bare excepts in various places in std lib

2012-10-17 Thread Brett Cannon

Brett Cannon added the comment:

One thing to be aware of, Ramchandra, is that there might be a slight 
backwards-compatibility problem from tightening up what exceptions propagate. 
Now with proper documentation and only applying things to 3.4 this probably 
won't be a problem.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue15145] Faster *_find_max_char

2012-10-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file26093/find_max_char.patch

___
Python tracker 

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



[issue16265] Code sample does not collapse correctly

2012-10-17 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Fixed. Thanks.

--
nosy: +asvetlov
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
versions: +Python 3.4

___
Python tracker 

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



[issue16265] Code sample does not collapse correctly

2012-10-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a0fba0382ae0 by Andrew Svetlov in branch '3.2':
Issue #16265: Fix collapsing of code sample in tutorial.
http://hg.python.org/cpython/rev/a0fba0382ae0

New changeset 7c0de8be4eaf by Andrew Svetlov in branch '3.3':
Merge issue #16265: Fix collapsing of code sample in tutorial.
http://hg.python.org/cpython/rev/7c0de8be4eaf

New changeset c8a11e9a0217 by Andrew Svetlov in branch 'default':
Merge issue #16265: Fix collapsing of code sample in tutorial.
http://hg.python.org/cpython/rev/c8a11e9a0217

--
nosy: +python-dev

___
Python tracker 

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



[issue16258] test_local.TestEnUSCollection failures on Solaris 10

2012-10-17 Thread Antoine Pitrou

Antoine Pitrou added the comment:

(by the way, I also tried a memset() before calling wcsxfrm(): no change)

--

___
Python tracker 

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



[issue16258] test_local.TestEnUSCollection failures on Solaris 10

2012-10-17 Thread Antoine Pitrou

Antoine Pitrou added the comment:

It only works on Python 3.2 because PyUnicode_FromWideChar is more permissive, 
it seems. The first character in the wchar_t string returned by Solaris is 
still 0x101010e.

--

___
Python tracker 

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



[issue15200] Faster os.walk

2012-10-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Timing of walk depends on how deep we dive into the directories.

$ ./python -m timeit -s "from os import walk"  "for x in 
walk('/home/serhiy/py/1/2/3/4/5/6/7/8/9/cpython/'): pass"
10 loops, best of 3: 398 msec per loop
$ ./python -m timeit -s "from os import fwalk"  "for x in 
fwalk('/home/serhiy/py/1/2/3/4/5/6/7/8/9/cpython/'): pass"
10 loops, best of 3: 249 msec per loop

Given the above mentioned objections (consuming a lot of file descriptors, 
OS/FS dependency, testing burden) I withdraw my patch and close the issue. 
Thanks all for discussion.

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

___
Python tracker 

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



[issue16266] Typo in tutorial

2012-10-17 Thread Andrew Svetlov

Andrew Svetlov added the comment:

I'm not native English speaker, but for me it just means
\r\n -> \n when read from stream and
\n -> \r\n when write to stream
if OS is Windows.
That's correct.

--
nosy: +asvetlov, chris.jerdonek

___
Python tracker 

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



[issue16258] test_local.TestEnUSCollection failures on Solaris 10

2012-10-17 Thread Jesús Cea Avión

Jesús Cea Avión added the comment:

BTW, this works in python 3.2:

x86, 32 bit python, Solaris 10 update 10:

"""
Python 3.2.3 (default, Apr 12 2012, 13:29:13) 
[GCC 4.7.0] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
'en_US.UTF-8'
>>> locale.strxfrm('a')
'���\U00010f69�'
"""

--
keywords: +3.3regression

___
Python tracker 

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



[issue16258] test_local.TestEnUSCollection failures on Solaris 10

2012-10-17 Thread Antoine Pitrou

Antoine Pitrou added the comment:

With the system Python on s10:

Python 2.6.8 (unknown, Apr 13 2012, 17:08:12) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.strxfrm('a')
'a'
>>> locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
'en_US.UTF-8'
>>> locale.strxfrm('a')
'\x01\x01\x01\x0e\x01\x01\x01\x01\x01\x01\x01\x02\x01\x01\x0fi\x01\x01\x01\x01'
>>> locale.strxfrm('a').decode('utf-8')
u'\x01\x01\x01\x0e\x01\x01\x01\x01\x01\x01\x01\x02\x01\x01\x0fi\x01\x01\x01\x01'

The difference between Python 2 and Python 3 is that Python 3 uses wcsxfrm, not 
strxfrm. Apparently Solaris' wcsxfrm is some broken thing that returns the same 
thing as strxfrm, cast to a wchar_t *, hence the character U+101010e 
(corresponding to the '\x01\x01\x01\x0e' bytestring above).

--
nosy: +loewis, pitrou

___
Python tracker 

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



[issue16258] test_local.TestEnUSCollection failures on Solaris 10

2012-10-17 Thread Jesús Cea Avión

Jesús Cea Avión added the comment:

I can reproduce this on my x86 Solaris 10 update 10.

--

___
Python tracker 

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



[issue16266] Typo in tutorial

2012-10-17 Thread Yongzhi Pan

New submission from Yongzhi Pan:

http://docs.python.org/py3k/tutorial/inputoutput.html#reading-and-writing-files

The text:

In text mode, the default is to convert platform-specific line endings (\n on 
Unix, \r\n on Windows) to just \n on reading and \n back to platform-specific 
line endings on writing. 

Is the last '\n' a typo and not needed?

--
assignee: docs@python
components: Documentation
messages: 173165
nosy: docs@python, fossilet
priority: normal
severity: normal
status: open
title: Typo in tutorial
type: behavior
versions: Python 3.2, Python 3.3

___
Python tracker 

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



[issue16258] test_local.TestEnUSCollection failures on Solaris 10

2012-10-17 Thread Trent Nelson

Trent Nelson added the comment:

With the caveat that I know absolutely nothing about locales, here's what I've 
been able to reduce the problem down to:

zinc (alias s11, Solaris 11 x64):
>>> locale.setlocale(locale.LC_ALL, 'C')
'C'
>>> locale.strxfrm('a')
'a'
>>> locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
'en_US.UTF-8'
>>> locale.strxfrm('a')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: character U+10105a3 is not in range [U+; U+10]
>>> 

nitrogen (alias s10, Solaris 10 SPARC):

>>> locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
'en_US.UTF-8'
>>> locale.strxfrm('a')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: character U+101010e is not in range [U+; U+10]

Not sure how relevant it is, but on both those Solaris boxes, locale.LC_ALL 
returns 6, whereas on BSD and OS X it always seems to return 0.

--

___
Python tracker 

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



[issue16265] Code sample does not collapse correctly

2012-10-17 Thread Yongzhi Pan

New submission from Yongzhi Pan:

http://docs.python.org/py3k/tutorial/inputoutput.html#fancier-output-formatting

In the last but second code sample in that section, the code is not correctly 
colored and cannot be correctly collapsed.

Expanded:

>>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 8637678}
>>> print ('Jack: {0[Jack]:d}; Sjoerd: {0[Sjoerd]:d}; '
...'Dcab: {0[Dcab]:d}'.format(table))
Jack: 4098; Sjoerd: 4127; Dcab: 8637678

Collapsed:

table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 8637678}
print('Jack: {0[Jack]:d}; Sjoerd: {0[Sjoerd]:d}; '

--
assignee: docs@python
components: Documentation
messages: 173163
nosy: docs@python, fossilet
priority: normal
severity: normal
status: open
title: Code sample does not collapse correctly
type: behavior
versions: Python 3.2, Python 3.3

___
Python tracker 

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



[issue16259] Replace exec() in test.regrtest with __import__

2012-10-17 Thread R. David Murray

R. David Murray added the comment:

That's a safe use of exec, since the name is coming from a loaded module and 
not from user input.  Still, load_module would be cleaner.

However, the real fix is to just delete that code.  It is dead code...we always 
pass the indirect_test argument to dash_R.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-17 Thread R. David Murray

R. David Murray added the comment:

Yes, I think keeping this bug as the doc bug and opening a new one for the 
enhancement is the best way to go.

--
versions: +Python 3.2, Python 3.3

___
Python tracker 

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



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-10-17 Thread Trent Nelson

Trent Nelson added the comment:

That last commit fixes in-tree builds, but broke out-of-tree builds.  I've 
refactored the patch (sysconfig.py.patch) to fix the issue, but it's getting 
progressively more hacky, so I wanted to see what other people think before 
proceeding.

(That being said, it works a *lot* better than the previous solution of writing 
_sysconfigdata.py to the root builddir, then moving it.  That didn't work at 
all for out-of-tree builds.  This solution slots _sysconfigdata directly into 
sys.modules, which _init_posix() is more than happy with.)

--
Added file: http://bugs.python.org/file27601/sysconfig.py.patch

___
Python tracker 

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



[issue16264] test_logging failure on Windows 7 buildbot

2012-10-17 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Committed http://hg.python.org/cpython/rev/240fa6e93925 in order to have a 
clearer look on what's going on.
Will get back on this later today, after the next bb failure.

--

___
Python tracker 

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



[issue16264] test_logging failure on Windows 7 buildbot

2012-10-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 240fa6e93925 by Giampaolo Rodola' in branch 'default':
test_logging.py: where needed use unittest's assertGreater, assertLesser, 
assertIs rather than assertTrue (also in order to debug issue 16264)
http://hg.python.org/cpython/rev/240fa6e93925

--
nosy: +python-dev

___
Python tracker 

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



  1   2   >