[issue11787] File handle leak in TarFile lib

2011-04-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

Attached trivial patch to fix the issue. Needs tests.

--
keywords: +easy, patch
nosy: +ezio.melotti
stage:  -> test needed
Added file: http://bugs.python.org/file21668/issue11787.diff

___
Python tracker 

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



[issue11848] Comment for random.betavariate is intriguing and incomplete

2011-04-14 Thread Brandon W Maister

Brandon W Maister  added the comment:

Oh, awesome, thanks!

--

___
Python tracker 

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



[issue11848] Comment for random.betavariate is intriguing and incomplete

2011-04-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

I replaced the link, thanks for noticing it!

--
assignee:  -> ezio.melotti
resolution:  -> fixed
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



[issue11848] Comment for random.betavariate is intriguing and incomplete

2011-04-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset e1f0881d2cb4 by Ezio Melotti in branch '2.7':
#11848: replace dead link in random.betavariate comment.
http://hg.python.org/cpython/rev/e1f0881d2cb4

New changeset f5b9ad73157c by Ezio Melotti in branch '3.1':
#11848: replace dead link in random.betavariate comment.
http://hg.python.org/cpython/rev/f5b9ad73157c

New changeset 40656d8ae2c6 by Ezio Melotti in branch '3.2':
#11848: Merge with 3.1.
http://hg.python.org/cpython/rev/40656d8ae2c6

New changeset 2acb16023fbe by Ezio Melotti in branch 'default':
#11848: Merge with 3.2.
http://hg.python.org/cpython/rev/2acb16023fbe

--
nosy: +python-dev

___
Python tracker 

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



[issue11845] Refcounting error in compute_slice_indices in rangeobject.c

2011-04-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

Fixed, thanks for the patch!

--
assignee:  -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> fixed
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



[issue11845] Refcounting error in compute_slice_indices in rangeobject.c

2011-04-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 8025fb83dece by Ezio Melotti in branch '3.2':
#11845: Fix typo in rangeobject.c that caused a crash in compute_slice_indices. 
 Patch by Daniel Urban.
http://hg.python.org/cpython/rev/8025fb83dece

New changeset 724e2e84a74f by Ezio Melotti in branch 'default':
#11845: Merge with 3.2.
http://hg.python.org/cpython/rev/724e2e84a74f

--
nosy: +python-dev

___
Python tracker 

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



[issue11848] Comment for random.betavariate is intriguing and incomplete

2011-04-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

See http://mail.python.org/pipermail/python-bugs-list/2001-January/003753.html

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue11848] Comment for random.betavariate is intriguing and incomplete

2011-04-14 Thread Brandon W Maister

New submission from Brandon W Maister :

The comment just before the random.betavariate method reads in part:

## See
## http://sourceforge.net/bugs/?func=detailbug&bug_id=130030&group_id=5470
## for Ivan Frohne's insightful analysis of why the original implementation:
## (snip original implementation) was dead wrong, and how it propbably got that 
way.

And I would like to read that comment, but the buglink is pretty deeply dead. 
I'm not sure what the correct thing to do here is, maybe stick the text of the 
bug into the comment, or just update the link.

But I'm definitely curious. Thanks.

--
components: Demos and Tools
messages: 133788
nosy: quodlibetor
priority: normal
severity: normal
status: open
title: Comment for random.betavariate is intriguing and incomplete

___
Python tracker 

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



[issue11847] OSError importing antigravity module

2011-04-14 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

As an extra, presumably if you just do:
import webbrowser
webbrowser.open("http://www.python.org";)

it also fails?

--
nosy: +rosslagerwall
status: pending -> open
type: crash -> behavior

___
Python tracker 

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



[issue11844] Update json to upstream simplejson latest release

2011-04-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti, fdrake

___
Python tracker 

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



[issue11847] OSError importing antigravity module

2011-04-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

This seems to be a duplicate of #11432.
Can you try to compile the latest Python 3.2 (or 3.3) and see if you still get 
the problem?

You can do it by following these steps:
hg clone http://hg.python.org/cpython
cd cpython
hg up 3.2
./configure && make
./python
import antigravity

See also http://docs.python.org/devguide/setup.html

--
nosy: +ezio.melotti
status: open -> pending

___
Python tracker 

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



[issue4783] document that json.load/dump can’t be used twice on the same stream

2011-04-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
assignee: bob.ippolito -> ezio.melotti
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



[issue4783] document that json.load/dump can’t be used twice on the same stream

2011-04-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 8dbf072556b9 by Ezio Melotti in branch '2.7':
#4783: document that is not possible to use json.dump twice on the same stream.
http://hg.python.org/cpython/rev/8dbf072556b9

New changeset 2ec08aa2c566 by Ezio Melotti in branch '3.1':
#4783: document that is not possible to use json.dump twice on the same stream.
http://hg.python.org/cpython/rev/2ec08aa2c566

New changeset 1e315794ac8c by Ezio Melotti in branch '3.2':
#4783: Merge with 3.1.
http://hg.python.org/cpython/rev/1e315794ac8c

New changeset 91881e304e13 by Ezio Melotti in branch 'default':
#4783: Merge with 3.2.
http://hg.python.org/cpython/rev/91881e304e13

--
nosy: +python-dev

___
Python tracker 

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



[issue11827] mention of list2cmdline() in docs of subprocess.Popen

2011-04-14 Thread Eli Bendersky

Eli Bendersky  added the comment:

Patch committed to 3.3, 3.2, 3.1, 2.7

In case no objections arise, I will close this issue in a couple of days

--
status: pending -> open

___
Python tracker 

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



[issue11827] mention of list2cmdline() in docs of subprocess.Popen

2011-04-14 Thread Eli Bendersky

Changes by Eli Bendersky :


--
status: open -> pending

___
Python tracker 

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



[issue11827] mention of list2cmdline() in docs of subprocess.Popen

2011-04-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f38489a3394f by Eli Bendersky in branch '2.7':
Issue #11827: remove mention of list2cmdline in the doc of subprocess
http://hg.python.org/cpython/rev/f38489a3394f

--

___
Python tracker 

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



[issue5057] Unicode-width dependent optimization leads to non-portable pyc file

2011-04-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

PEP 3147 says[0]:
"""
For backward compatibility, Python will still support pyc-only distributions, 
however it will only do so when the pyc file lives in the directory where the 
py file would have been, i.e. not in the __pycache__ directory. pyc file 
outside of __pycache__ will only be imported if the py source file is missing.
"""

Does that mean that there could be cases where untagged pyc files are used in 
3.2+?
In that case the patch should be ported to 3.2 and 3.3 too.

[0]: http://www.python.org/dev/peps/pep-3147/#rationale

--
assignee:  -> ezio.melotti
nosy: +barry

___
Python tracker 

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



[issue11827] mention of list2cmdline() in docs of subprocess.Popen

2011-04-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset e7a55e236b8b by Eli Bendersky in branch '3.1':
Issue #11827: remove mention of list2cmdline in the doc of subprocess
http://hg.python.org/cpython/rev/e7a55e236b8b

--
nosy: +python-dev

___
Python tracker 

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



[issue11846] Implementation question for (-5) - 256 caching, and doc update for c-api/int.html

2011-04-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue9904] Cosmetic issues that may warrant a fix in symtable.h/c

2011-04-14 Thread Eli Bendersky

Changes by Eli Bendersky :


--
resolution:  -> fixed
status: pending -> closed

___
Python tracker 

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



[issue828450] sdist generates bad MANIFEST on Windows

2011-04-14 Thread higery

higery  added the comment:

I will join GSOC2011 and I find this bug is a good test for me to submit my 
patch as a scoring judgment.

I have created a diff file to confirm this bug, but setuptools may have already 
fix it, because when using 'python setup.py sdist' to create the source 
distribution, file paths in SOURCES.txt are correctly with '/' as separator. 
However, when running the test_sdist.py tests, the problem Jeremy raised 
exists. 

So, it means that distutils still has this problem, but setuptools fix it.

--
keywords: +patch
nosy: +higery
Added file: http://bugs.python.org/file21667/test_sdist.diff

___
Python tracker 

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



[issue2571] can cmd.py's API/docs for the use of an alternate stdin be improved?

2011-04-14 Thread Jack Andrews

Jack Andrews  added the comment:

> Terry J. Reedy  added the comment:
>
> Jack, several questions.
> Are you saying that when stdin is a pipe and not a tty, pdb works better with 
> use_rawinput set False?

yes.  well, at least i thought so.  today, pdb works fine
with no patch.  i must have stumbled across my bug
in the middle of patching cmd.py.

if i notice anything strange, i'll let you know.

--

___
Python tracker 

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



[issue9176] module termios doesn't build on HP-UX

2011-04-14 Thread Graeme Perrow

Changes by Graeme Perrow :


--
nosy: +gperrow

___
Python tracker 

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



[issue11710] Landing pages in docs for standard library packages

2011-04-14 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: docs@python -> georg.brandl
nosy: +georg.brandl

___
Python tracker 

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



[issue11397] os.path.realpath() may produce incorrect results

2011-04-14 Thread STINNER Victor

STINNER Victor  added the comment:

I tested issue11397_py32.patch:
 - you should use os.fsencode(sep) instead of sep.encode()
 - os.path.realpath('../'*10) raises IndexError('pop from empty list') instead 
of giving '/'

--

___
Python tracker 

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



[issue11710] Landing pages in docs for standard library packages

2011-04-14 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
nosy: +orsenthil

___
Python tracker 

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



[issue11847] OSError importing antigravity module

2011-04-14 Thread Santoso Wijaya

Changes by Santoso Wijaya :


--
nosy: +santa4nt

___
Python tracker 

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



[issue11847] OSError importing antigravity module

2011-04-14 Thread ackounts

New submission from ackounts :

When I try to import antigravity module on Linux I get an error (on Windows it 
runs fine):

Python 3.2 (r32:88445, Feb 21 2011, 01:55:53) 
[GCC 4.5.2 20110127 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import antigravity
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.2/antigravity.py", line 5, in 
webbrowser.open("http://xkcd.com/353/";)
  File "/usr/lib/python3.2/webbrowser.py", line 62, in open
if browser.open(url, new, autoraise):
  File "/usr/lib/python3.2/webbrowser.py", line 276, in open
success = self._invoke(args, True, autoraise)
  File "/usr/lib/python3.2/webbrowser.py", line 239, in _invoke
stderr=inout, preexec_fn=setsid)
  File "/usr/lib/python3.2/subprocess.py", line 736, in __init__
restore_signals, start_new_session)
  File "/usr/lib/python3.2/subprocess.py", line 1330, in _execute_child
raise child_exception_type(errno_num, err_msg)
OSError: [Errno 9] Bad file descriptor

--
components: Library (Lib)
messages: 133776
nosy: ackounts
priority: normal
severity: normal
status: open
title: OSError importing antigravity module
type: crash
versions: Python 3.2

___
Python tracker 

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



[issue4537] webbrowser.UnixBrowser should use builtins.open

2011-04-14 Thread ackounts

ackounts  added the comment:

yes, you right, I will create a new issue, thanks.

--
components: +None -Library (Lib)
type: crash -> 
versions:  -Python 3.2

___
Python tracker 

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



[issue11846] Implementation question for (-5) - 256 caching, and doc update for c-api/int.html

2011-04-14 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

We should remove the documentation entries that discuss non-guaranteed 
implementation details (i.e. which integers are singletons).

Instead, there should probably be a brief tutorial entry on what aspects of 
object identity people can rely on:

* None, True, and False are singletons.  PEP 8 recommends testing for None with 
"is".

* Most internal equality comparisons (i.e. that in list.count or 
list.__contains__) assume that identity-implied-equality regardless of how 
__eq__ is defined (i.e. an object is always equal to itself).

* Once created, an object doesn't change its identity.  So, you can use "is" to 
find the exact same object at a later stage in a program.

* Unless documented otherwise (a singleton class telling you that it returns 
the same object every time), no other assumptions should be made about object 
identity.  In particular, one cannot assume that an object id won't be re-used 
after the object is reclaimed.

--
nosy: +rhettinger

___
Python tracker 

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



[issue11846] Implementation question for (-5) - 256 caching, and doc update for c-api/int.html

2011-04-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I don't think it's in the business of the C API docs to explain Python-visible 
semantics, or the difference between "==" and "is". I would just rephrase the 
original paragraph, removing the last sentence joke:

“Since integer objects are very frequently created, certain optimizations can 
be applied on their allocation. For example, the current implementation keeps 
an array of integer objects for all integers between -5 and 256: when you 
create an int in that range, you actually just get back a reference to the 
existing object.”

--
nosy: +pitrou

___
Python tracker 

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



[issue11846] Implementation question for (-5) - 256 caching, and doc update for c-api/int.html

2011-04-14 Thread Dave Malcolm

Dave Malcolm  added the comment:

Interpreter idea: " is " could trigger a compatibility warning, 
perhaps, to help people avoid relying on CPython quirks

--

___
Python tracker 

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



[issue11845] Refcounting error in compute_slice_indices in rangeobject.c

2011-04-14 Thread Daniel Stutzbach

Changes by Daniel Stutzbach :


--
nosy: +stutzbach

___
Python tracker 

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



[issue11846] Implementation question for (-5) - 256 caching, and doc update for c-api/int.html

2011-04-14 Thread Dave Malcolm

Dave Malcolm  added the comment:

Perhaps should also note that this is done for the purposes of optimization 
(both speed and memory).

--

___
Python tracker 

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



[issue11846] Implementation question for (-5) - 256 caching, and doc update for c-api/int.html

2011-04-14 Thread Dave Malcolm

Dave Malcolm  added the comment:

>From IRC discussion, how about something like:

The current implementation consolidates integers in the range -5 to 256 
(inclusive) into singleton PyIntObject instances, whereas other integer values 
have unique PyIntObject instances created for them.

This means that on CPython::

   >>> -5 is -5
   True

but::

   >>> -6 is not -6
   False

This behavior is an implementation detail of CPython, and is not required by 
other implementations of Python.

In particular:
  - do not manipulate the internal value of a PyIntObject after creation
  - do not use "is" for comparing integer values, use "==" instead.

--
nosy: +dmalcolm

___
Python tracker 

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



[issue11846] Implementation question for (-5) - 256 caching, and doc update for c-api/int.html

2011-04-14 Thread Anthony Long

New submission from Anthony Long :

http://docs.python.org/c-api/int.html

"The current implementation keeps an array of integer objects for all integers 
between -5 and 256, when you create an int in that range you actually just get 
back a reference to the existing object. So it should be possible to change the 
value of 1. I suspect the behaviour of Python in this case is undefined. :-)"

This paragraph should be changed to reflect that you can (by construction) 
mutate anything you want in C, and (as per suggestion of dmalcolm)

"The current implementatin consolidates integers in the range -5 to 256 
(inclusive) into singleton instances.  Do not manipulate the internal value of 
a PyIntObject after creation."

Also, the last line of that paragraph insinuates this functionality (caching of 
-5 to 256) is undocumented. I searched for a good while for an answer for this, 
and I didn't find one. If there is something written on the implementation 
details surrounding why '-5 is -5' works, while -6 is -6' wouldn't. 

If there is nothing written about this, I will put something together. My final 
question however which I have not been able to find an answer for, is: Is this 
even necessary functionality?

I encountered around 100 blog posts and a couple of stackoverflow questions 
about why this fails, and it seems like 1) a source of confusion 2) a point of 
ridicule. Is it really necessary?

>>> id(1)
4298196440
>>> a = 1
>>> id(a)
4298196440
>>> id(3000)
4320396376
>>> a = 3000
>>> id(a)
4320396160
>>>

--
components: Library (Lib)
messages: 133769
nosy: antlong
priority: normal
severity: normal
status: open
title: Implementation question for (-5) - 256 caching, and doc update for 
c-api/int.html
type: behavior

___
Python tracker 

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



[issue11845] Refcounting error in compute_slice_indices in rangeobject.c

2011-04-14 Thread Dave Malcolm

Changes by Dave Malcolm :


--
nosy: +dmalcolm

___
Python tracker 

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



[issue11783] email parseaddr and formataddr should be IDNA aware

2011-04-14 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

On Thu, Apr 14, 2011 at 06:05:59PM +, Torsten Becker wrote:
> :)

Mumble...
:)

--

___
Python tracker 

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



[issue11783] email parseaddr and formataddr should be IDNA aware

2011-04-14 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

On Thu, Apr 14, 2011 at 06:05:59PM +, Torsten Becker wrote:
> So sure .. go ahead. :)

Gr
Wuah, Wuuuah, Wuuh!
No.  Now i'm exhausted.

--

___
Python tracker 

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



[issue11845] Refcounting error in compute_slice_indices in rangeobject.c

2011-04-14 Thread Daniel Urban

New submission from Daniel Urban :

The attached crash.py script reliably crashes the 3.2 and 3.3 interpreter on my 
machine. The script does a lot of range slicing.

I think there is a typo in compute_slice_indices() in rangeobject.c, in line 
475. In line 474 there is an assign to tmp_stop, and on the next line tmp_start 
is incref'd (I think instead of tmp_stop).

With this patch, the interpreter doesn't crash any more:

diff -r 7563f10275a2 Objects/rangeobject.c
--- a/Objects/rangeobject.c Thu Apr 14 13:20:41 2011 +0800
+++ b/Objects/rangeobject.c Thu Apr 14 21:40:32 2011 +0200
@@ -472,7 +472,7 @@
 if (tmp_stop == NULL) goto Fail;
 } else {
 tmp_stop = r->length;
-Py_INCREF(tmp_start);
+Py_INCREF(tmp_stop);
 }
 }
 }

--
components: Interpreter Core
files: crash.py
messages: 133766
nosy: durban, ncoghlan
priority: normal
severity: normal
status: open
title: Refcounting error in compute_slice_indices in rangeobject.c
type: crash
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file21666/crash.py

___
Python tracker 

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



[issue11844] Update json to upstream simplejson latest release

2011-04-14 Thread Sandro Tosi

New submission from Sandro Tosi :

This issue is to track the update process of json to the latest upstream 
release (2.1.3).

As a start, here's the p-dev thread: 
http://mail.python.org/pipermail/python-dev/2011-April/110704.html

--
assignee: sandro.tosi
components: Library (Lib)
messages: 133765
nosy: sandro.tosi
priority: normal
severity: normal
status: open
title: Update json to upstream simplejson latest release
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



[issue2771] Test issue

2011-04-14 Thread Martin v . Löwis

Changes by Martin v. Löwis :


Added file: http://bugs.python.org/file21665/foo

___
Python tracker 

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



[issue11277] test_zlib.test_big_buffer crashes under BSD (Mac OS X and FreeBSD)

2011-04-14 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

And about mmap(2):

import os,sys,time,mmap

MP0 = ((2**30)-1)
MP1 = ((2**31)-1)
MP2 = ((2**32)-1)
MPV = (2**20) * 100
SIZES = (MP0-MPV, MP0, MP0+MPV,
 MP1-MPV, MP1, MP1+MPV,
 MP2-MPV, MP2, MP2+MPV)

FILE = 'test.dat'

print('Start:', time.gmtime())
for i in SIZES:
print('Testing file size ', i, ': ', sep='', end='')
sys.stdout.flush()
with open(FILE, "wb+") as f:
f.seek(i)
f.write(b'asdf')
f.flush()
sb = os.stat(FILE) 
if sb.st_size != i+4:
print('size failure:', sb.st_size, ' != ', i, sep='', end='')
sys.stdout.flush()
mem = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
if mem[0] != ord('\0'):
print('offset 0 failed: ', ord(mem[0]), ' ', end='', sep='')
else:
print('offset 0 ok ', end='', sep='')
sys.stdout.flush()
if mem[i] != ord('a'):
print('offset i failed: ', ord(mem[i]), ' ', end='', sep='')
else:
print('offset i ok ', end='', sep='')
print()
sys.stdout.flush()
os.unlink(FILE)
print('End:', time.gmtime())

...

Start: time.struct_time(tm_year=2011, tm_mon=4, tm_mday=14, tm_hour=17, 
tm_min=27, tm_sec=30, tm_wday=3, tm_yday=104, tm_isdst=0)
Testing file size 968884223: offset 0 ok offset i ok 
Testing file size 1073741823: offset 0 ok offset i ok 
Testing file size 1178599423: offset 0 ok offset i ok 
Testing file size 2042626047: offset 0 ok offset i ok 
Testing file size 2147483647: offset 0 ok offset i ok 
Testing file size 2252341247: offset 0 ok offset i ok 
Testing file size 4190109695: offset 0 ok offset i ok 
Testing file size 4294967295: offset 0 ok offset i ok 
Testing file size 4399824895: offset 0 ok offset i ok 
End: time.struct_time(tm_year=2011, tm_mon=4, tm_mday=14, tm_hour=17, 
tm_min=27, tm_sec=30, tm_wday=3, tm_yday=104, tm_isdst=0)

Now i think that can't be any faster.
Changing to
MP0 = ((2**30)-0)
MP1 = ((2**31)-0)
MP2 = ((2**32)-0)
results in

Start: time.struct_time(tm_year=2011, tm_mon=4, tm_mday=14, tm_hour=17, 
tm_min=27, tm_sec=55, tm_wday=3, tm_yday=104, tm_isdst=0)
Testing file size 968884224: offset 0 ok offset i ok 
Testing file size 1073741824: offset 0 ok offset i ok 
Testing file size 1178599424: offset 0 ok offset i ok 
Testing file size 2042626048: offset 0 ok offset i ok 
Testing file size 2147483648: offset 0 ok offset i ok 
Testing file size 2252341248: offset 0 ok offset i ok 
Testing file size 4190109696: offset 0 ok offset i ok 
Testing file size 4294967296: <- EOF here

Manually adjusted SIZES:

Testing file size 4294967295: offset 0 ok offset i ok 
Testing file size 4296015872: offset 0 ok offset i ok (MP2+1024*1024)
Testing file size 4295491584: offset 0 ok offset i ok (MP2+1024*512)
Testing file size 4295229440: offset 0 ok offset i ok (MP2+1024*256)
...
Testing file size 4294971392: offset 0 ok offset i ok (MP2+1024*4)
Testing file size 4294969344: <- EOF here (MP2+1024*2)

Pagesize = 4096.
I think the state machine can be easier than i thought.

--

___
Python tracker 

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



[issue9631] Python 2.7 installation issue for Linux gcc-4.1.0-3 (Fedora Core 5?)

2011-04-14 Thread sisco

sisco  added the comment:

make install fails on Fedora Core 13 as well:

make distclean
./configure
make
make install

/usr/bin/install -c -m 644 ./LICENSE /usr/local/lib/python2.7/LICENSE.txt
PYTHONPATH=/usr/local/lib/python2.7   \
./python -Wi -tt /usr/local/lib/python2.7/compileall.py \
-d /usr/local/lib/python2.7 -f \
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
/usr/local/lib/python2.7
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/compileall.py", line 17, in 
import struct
  File "/usr/local/lib/python2.7/struct.py", line 1, in 
from _struct import *
ImportError: No module named _struct
make: *** [libinstall] Error 1
[root@freebie Python-2.7.1]# df -T
FilesystemType   1K-blocks  Used Available Use% Mounted on
/dev/sda3 ext450395844   2899168  46984864   6% /
tmpfstmpfs 2020464   864   2019600   1% /dev/shm
/dev/sda1 ext4  396672 29566346626   8% /boot
/dev/sda2 ext4   898537912 146927532 705967272  18% /db
[root@freebie Python-2.7.1]# uname -av
Linux freebie 2.6.33.3-85.fc13.x86_64 #1 SMP Thu May 6 18:09:49 UTC 2010 x86_64 
x86_64 x86_64 GNU/Linux
[root@freebie Python-2.7.1]# cat /etc/fedora-release
Fedora release 13 (Goddard)

--
nosy: +asisco

___
Python tracker 

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



[issue11806] Missing 2 hyphens in the docs

2011-04-14 Thread Boštjan Mejak

Boštjan Mejak  added the comment:

I did a little mistake with the "coffee-table" thing. It's written as
"coffee table" (no hyphen). But other words listed are written with the
hyphen. Fix those damn things mentioned in the issue.

--
Added file: http://bugs.python.org/file21664/unnamed

___
Python tracker 

___I did a little mistake with the "coffee-table" thing. It's 
written as "coffee table" (no hyphen). But other words listed are 
written with the hyphen. Fix those damn things mentioned in the issue.
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8326] Cannot import name SemLock on Ubuntu

2011-04-14 Thread R. David Murray

R. David Murray  added the comment:

Like Stefan says, use the default build options with the checkout.  If it 
works, then the problem is an Ubuntu bug, and not a Python bug.

--

___
Python tracker 

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



[issue8326] Cannot import name SemLock on Ubuntu

2011-04-14 Thread Stefan Krah

Stefan Krah  added the comment:

Buck Golemon  wrote:
> > I suggest that you try to build from the above mercurial repository and see 
> > if the problem persists.
> 
> How do I know the configuration options that the Ubuntu packager used?

I'd use the default configuration and check if sem_open is detected
correctly by ./configure and if the import works.

As Matthias Klose stated earlier, the issue seems to be the kernel version.

--

___
Python tracker 

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



[issue8326] Cannot import name SemLock on Ubuntu

2011-04-14 Thread Sandro Tosi

Sandro Tosi  added the comment:

> How do I know the configuration options that the Ubuntu packager used?

the make file (likely) used is at:

http://bazaar.launchpad.net/~doko/python/pkg2.7-debian/view/head:/rules

Note: he is also a python developer, so you can add him to nosy and
ask clarification.

Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

--
nosy: +sandro.tosi

___
Python tracker 

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



[issue11397] os.path.realpath() may produce incorrect results

2011-04-14 Thread Santoso Wijaya

Santoso Wijaya  added the comment:

Oh, I understand. I'm just wondering especially for this one because it has no 
assigned dev.

--

___
Python tracker 

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



[issue11783] email parseaddr and formataddr should be IDNA aware

2011-04-14 Thread Torsten Becker

Torsten Becker  added the comment:

> (The word anybody made me think.
> But "fix properly" ... i'm sure you cannot refer to myself.
> :))

"fix properly" referred to my inferior implementation and "anybody"
should probably have been worded "Steffen or David".  So sure .. go
ahead. :)

--

___
Python tracker 

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



[issue8326] Cannot import name SemLock on Ubuntu

2011-04-14 Thread Buck Golemon

Buck Golemon  added the comment:

> I suggest that you try to build from the above mercurial repository and see 
> if the problem persists.

How do I know the configuration options that the Ubuntu packager used?

--

___
Python tracker 

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



[issue6634] sys.exit() called from threads other than the main one: undocumented behaviour

2011-04-14 Thread Daniel Stutzbach

Changes by Daniel Stutzbach :


--
nosy: +stutzbach

___
Python tracker 

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



[issue8326] Cannot import name SemLock on Ubuntu

2011-04-14 Thread Stefan Krah

Stefan Krah  added the comment:

This line...

>>> from multiprocessing.synchronize import Semaphore

... works on Ubuntu Lucid with the 2.7, 3.1, 3.2 and default
branches from:

http://hg.python.org/cpython


Since you mention Ubuntu's build configuration, I suggest that you
try to build from the above mercurial repository and see if the problem
persists.

--

___
Python tracker 

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



[issue11783] email parseaddr and formataddr should be IDNA aware

2011-04-14 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

On Wed, Apr 13, 2011 at 09:42:22PM +, Torsten Becker wrote:
> So if anybody wants to work on this before that time,
> please feel free to fix it properly. :)

(The word anybody made me think.
But "fix properly" ... i'm sure you cannot refer to myself.
:))

--

___
Python tracker 

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



[issue8326] Cannot import name SemLock on Ubuntu

2011-04-14 Thread Buck Golemon

Changes by Buck Golemon :


--
title: Cannot import name SemLock on Ubuntu lucid -> Cannot import name SemLock 
on Ubuntu

___
Python tracker 

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



[issue8326] Cannot import name SemLock on Ubuntu lucid

2011-04-14 Thread Buck Golemon

Buck Golemon  added the comment:

> Isn't this an Ubuntu problem if sem_open only works with some specific 
> kernels?

sem_open works fine (python2.6 is using it), but the python2.7 build process 
didn't detect it properly. This is either a bug with Ubuntu's python2.7 build 
configuration, or with python2.7's feature detection for sem_open.

I'm not sure which.

--

___
Python tracker 

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



[issue2571] can cmd.py's API/docs for the use of an alternate stdin be improved?

2011-04-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Jack, several questions.
Are you saying that when stdin is a pipe and not a tty, pdb works better with 
use_rawinput set False? 
Are you sure that the auto setting is correct in all use cases?
Are you aware that you can set use_rawinput 'manually'?
Have you read my previous response msg118093?
Are you willing to help sort out the questions and issues therein?

--

___
Python tracker 

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



[issue7990] xml.etree.cElementTree lacks full dir() on Element

2011-04-14 Thread Arc Riley

Arc Riley  added the comment:

It looks right to me, but I would include more verbose pydoc strings.  

IE, "The tail attribute can be used to hold additional data associated with the 
element" tells me nothing.  You could explain here what .tail actually is, a 
few XML examples of what would be put in tail or what tail would become, and 
the API design reason why tail is used in addition to text.

--

___
Python tracker 

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



[issue11397] os.path.realpath() may produce incorrect results

2011-04-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Sorry, patches sometimes sit awhile before a developer who can do something 
does do something.

--

___
Python tracker 

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



[issue11397] os.path.realpath() may produce incorrect results

2011-04-14 Thread Santoso Wijaya

Santoso Wijaya  added the comment:

ping?

--

___
Python tracker 

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



[issue10605] ElementTree documentation

2011-04-14 Thread Sandro Tosi

Sandro Tosi  added the comment:

Hi Adrian,
where do you see the 'entity' argument to class TreeBuilder?

In case I'm just missing in, would be interested in preparing a patch? you seem 
to be knowledgeable about the matter, so it would be nice if you can share it 
with us. You can also provide just the text you'd like to see, and I'll do the 
rest.

--
nosy: +sandro.tosi

___
Python tracker 

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



[issue7990] xml.etree.cElementTree lacks full dir() on Element

2011-04-14 Thread Santoso Wijaya

Santoso Wijaya  added the comment:

Is this a right approach? I converted the hard-coded "attributes" into real, 
C-API attributes.

--

___
Python tracker 

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



[issue11467] urlparse.urlsplit() regression for paths consisting of digits

2011-04-14 Thread Santoso Wijaya

Changes by Santoso Wijaya :


--
versions: +Python 3.1

___
Python tracker 

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



[issue11731] Simplify email API via 'policy' objects

2011-04-14 Thread R. David Murray

Changes by R. David Murray :


Added file: http://bugs.python.org/file21663/policy_for_review.patch

___
Python tracker 

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



[issue11731] Simplify email API via 'policy' objects

2011-04-14 Thread R. David Murray

Changes by R. David Murray :


Removed file: http://bugs.python.org/file21662/policy_for_review.patch

___
Python tracker 

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



[issue10121] test_multiprocessing stuck in test_make_pool if run in a loop

2011-04-14 Thread Sandro Tosi

Sandro Tosi  added the comment:

Thanks for reminding me of this issue. I let the same tight loop run on an 
up-to-date python for a whole day and not stuck happened.

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue11731] Simplify email API via 'policy' objects

2011-04-14 Thread R. David Murray

R. David Murray  added the comment:

Éric did a review of the previous patch (mostly doc stuff) which should
be pretty much addressed in this new version of the patch.

I'd like to propose this version (modulo any forthcoming comments) for
commit to trunk.  I've removed some parameters that I have not (yet)
implemented.  I've decided that it is better to commit the framework now
and have it there as the skeleton on which to attach the remaining items
(and some new ones I'm finding I need for the remaining email6 work)
when I'm really ready to implement those remaining items.

--
Added file: http://bugs.python.org/file21662/policy_for_review.patch

___
Python tracker 

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



[issue11842] slice.indices with negative step and default stop

2011-04-14 Thread Daniel Urban

Daniel Urban  added the comment:

I see. Thanks for the explanation. If indeed this is the expected behaviour (as 
it seems), then I suggest clarifying the documentation. I think it would be 
good to mention that the returned values are for range(), and not for creating 
another slice object.

--
assignee:  -> docs@python
components: +Documentation -Interpreter Core
nosy: +docs@python

___
Python tracker 

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



[issue10496] "import site failed" when Python can't find home directory (sysconfig._getuserbase)

2011-04-14 Thread STINNER Victor

STINNER Victor  added the comment:

Because the patch is simple (just add a try/except), I think that it doesn't 
matter if only few people use users without entry in /etc/passwd and we should 
fix this issue.

--

___
Python tracker 

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



[issue10496] "import site failed" when Python can't find home directory (sysconfig._getuserbase)

2011-04-14 Thread Charles-Francois Natali

Charles-Francois Natali  added the comment:

I'm not sure whether POSIX warrants anything about this behavior, but nothing 
prevents a process from running with a UID not listed in /etc/passwd (or NIS, 
whatever). For example, sudo allows running a command with a UID not listed in 
the password database, see http://linux.die.net/man/5/sudoers :
"""
targetpw

If set, sudo will prompt for the password of the user specified by the -u flag 
(defaults to root) instead of the password of the invoking user. Note that this 
precludes the use of a uid not listed in the passwd database as an argument to 
the -u flag. This flag is off by default.
"""

UIDs not backed by users are useful for example if you're working with a 
sandbox, or virtual users such as in some FTP servers 
http://www.proftpd.org/docs/howto/VirtualUsers.html :
"""
Question: What makes a user "virtual", then?
Answer: A virtual user is, quite simply, a user that is not defined in the 
system /etc/passwd file. This file associates a user name, given by the system 
administrator, to a user ID (commonly shortened to UID) and a group ID (GID), 
among other details. The Unix kernel does not deal with users in terms of their 
user names; it only "knows" about UIDs and GIDs. This means that an application 
like proftpd can look up the IDs to use for a given user name however it sees 
fit. Using /etc/passwd is not strictly required.
"""

--
nosy: +neologix

___
Python tracker 

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



[issue11277] test_zlib.test_big_buffer crashes under BSD (Mac OS X and FreeBSD)

2011-04-14 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

Pfff.
Now i really spent some time on Mac OS X memory management.
I did it for Wanda.  :)

(First: i don't know why you want to drop that nice mmap(2),
it's wonderful to test harddisk performance!
And if you want to support Apple, then you have to spend
some blood - right???
Implement a state machine, disallow mmap(2) if the file has
been written to.  Maybe i should spend some more hours and
try to find rules behind this??)

Situation is a follows.
Also here there are some nice sysctl(8) variables:

hw.memsize: 2147483648
hw.usermem = 1651843072
vm.global_no_user_wire_amount: 67108864
vm.global_user_wire_limit: 1811939328
vm.user_wire_limit: 1811939328

That doesn't mean much though.
I've searched Apples developer pages with their unbelievable
stupid search engine and found

developer.apple.com/library/mac/#documentation/Darwin/Conceptual/KernelProgramming/About/About.html

I've downloaded that as a PDF (upper right corner).
That doesn't mean much though.

So i finally did some tests using Nadeem's code snippet
from msg133677.  The largest top(1) i ever got was
30477  python3  2.7   00:09.77 101877912M+  240K
but the system is unusable then.

I killed all tests which spent more than about three minutes first,
later i did so whenever 900M was not reached in top(1) output -
it seems to me that Apple's VM is not intelligent enough to detect
that it effectively has entered an endless loop!!!

The result of all that is that i think i can savely give you the
following advice for my MacBook (Mac OS X 10.6.7, but uname 10.7):

x = bytearray(hw.usermem=1651843072   // 2)
responses in few fractions of a second almost regardless of system
load and gives that top(1) line:
31369  python3  0.0   00:01.29 101871794M   240K

x = bytearray(hw.user_wire_limit=1811939328   // 2)
responses in noticably more fractions of a second and gives the
following top(1) line:
   32899  python3  0.0   00:01.39 101871870M   240K

Note that the system seemed to handle the first case somewhat
easily, whereas the latter resulted in unresponsive window
switching etc. etc., so that it seems as if...

I don't know wether Python offers the available memory size values
somewhere, but note that Apple has moved sysctl(8) from /sbin
to /usr/sbin, which is a lie if you would ask me to express my
opinion.

Except for all this i don't understand this thread.
Isn't that bot the one for which haypo has noticed those
random failures???

--

___
Python tracker 

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



[issue2571] can cmd.py's API/docs for the use of an alternate stdin be improved?

2011-04-14 Thread Jack Andrews

Jack Andrews  added the comment:

hi guys,

this makes Cmd a bit more useful.

my use case is talking to pdb via pipe
(ie. subprocess module).  pdb doesn't 
behave very well if stdin is not a tty.


===
--- cmdpy.orig/cmd.py   2011-04-14 23:55:01.102867999 +1000
+++ cmdpy/cmd.py2011-04-14 23:55:16.272868002 +1000
@@ -92,6 +92,8 @@
 self.stdin = stdin
 else:
 self.stdin = sys.stdin
+if not stdin.isatty():
+self.use_rawinput = 0
 if stdout is not None:
 self.stdout = stdout

--
nosy: +Jack.Andrews

___
Python tracker 

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



[issue9544] xdrlib.Packer().pack_fstring throws a TypeError when called with a str()

2011-04-14 Thread Filip Gruszczyński

Filip Gruszczyński  added the comment:

I'll provide docs patch.

--
assignee:  -> docs@python
components: +Documentation -None
nosy: +docs@python

___
Python tracker 

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



[issue5057] Unicode-width dependent optimization leads to non-portable pyc file

2011-04-14 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Ezio Melotti wrote:
> 
> Ezio Melotti  added the comment:
> 
> Here's a new patch that checks that newconst is not NULL and that it's a 
> unicode object.
> I added a test for the case where it's NULL.  I don't think it's possible to 
> test the case when newconst is not unicode though, because unicode subclasses 
> are not literals and don't get optimized in the first place.

Thank you.

--
title: Unicode-width dependent optimization leads   to  non-portable 
pyc file -> Unicode-width dependent optimization   leads   to  non-portable 
pyc file

___
Python tracker 

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



[issue9544] xdrlib.Packer().pack_fstring throws a TypeError when called with a str()

2011-04-14 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2011/4/14 Filip Gruszczyński :
>
> Filip Gruszczyński  added the comment:
>
> I am well aware of this, Benjamin. I am not trying to force any solution, but 
> rather trying to point out, that current documentation is misleading. There 
> might be no need for patching the code, but rather updating the docs to say, 
> that only bytes are allowed and that will be sufficient.

Yes, I think a doc patch is the correct thing to do.

--

___
Python tracker 

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



[issue9544] xdrlib.Packer().pack_fstring throws a TypeError when called with a str()

2011-04-14 Thread Filip Gruszczyński

Filip Gruszczyński  added the comment:

I am well aware of this, Benjamin. I am not trying to force any solution, but 
rather trying to point out, that current documentation is misleading. There 
might be no need for patching the code, but rather updating the docs to say, 
that only bytes are allowed and that will be sufficient.

--

___
Python tracker 

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



[issue9544] xdrlib.Packer().pack_fstring throws a TypeError when called with a str()

2011-04-14 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2011/4/14 Filip Gruszczyński :
>
> Filip Gruszczyński  added the comment:
>
> Actually documentation doesn't say that it supports only bytes, but:
>
> "The following methods support packing strings, bytes, and opaque data:"
>
> Also under python2 you can easily do this:
>
> In [1]: import xdrlib
>
> In [2]: p = xdrlib.Packer()
>
> In [3]: p.pack_string('some str')
>
> In [4]: p.pack_string(u'some str')

I doubt u"美", will, though.

--

___
Python tracker 

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



[issue5057] Unicode-width dependent optimization leads to non-portable pyc file

2011-04-14 Thread STINNER Victor

STINNER Victor  added the comment:

> ... which does not give the same result in UCS-2 and UCS-4 builds.
> As a result, the pyc file is not portable across those builds.

Since Python 3.2, the pyc filename contains a tag (u) to indicate wide build 
(sys.maxunicode==0x10), instead of narrow (sys.maxunicode==0x).

I think we can keep the optimizer for Python >= 3.2. I suppose that Python 3.1 
has the bug.

--
nosy: +haypo
versions: +Python 3.1 -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



[issue5057] Unicode-width dependent optimization leads to non-portable pyc file

2011-04-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

Here's a new patch that checks that newconst is not NULL and that it's a 
unicode object.
I added a test for the case where it's NULL.  I don't think it's possible to 
test the case when newconst is not unicode though, because unicode subclasses 
are not literals and don't get optimized in the first place.

--
Added file: http://bugs.python.org/file21661/issue5057-2.diff

___
Python tracker 

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



[issue11843] distutils doc: duplicate line in table

2011-04-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
components: +Distutils
nosy: +eric.araujo
versions:  -Python 2.6

___
Python tracker 

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



[issue6191] HTMLParser attribute parsing - 2 test cases when it fails

2011-04-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

So you are suggesting that 
  http://xxx.org/xxx.php?a=1 target="_blank">click me
should result in an 'a' element with an href attribute equals to 
"http://xxx.org/xxx.php?a=1 target=" and then discard _blank" as extra data?

--

___
Python tracker 

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



[issue6191] HTMLParser attribute parsing - 2 test cases when it fails

2011-04-14 Thread Paweł Widera

Paweł Widera  added the comment:

Great! With one "but"... the second case *is* handled by browsers. Browsers do 
not throw an exception on it as HTMLParser do. So improvement is definitely 
possible here. If it is worth an effort, it is not for me to judge.

--

___
Python tracker 

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



[issue11843] distutils doc: duplicate line in table

2011-04-14 Thread Steven Samuel Cole

New submission from Steven Samuel Cole :

in the first table on http://docs.python.org/distutils/builtdist.html (search 
for 'available formats for built distributions'), the line with 'rpm / RPM / 
(5)' is in there twice

--
assignee: docs@python
components: Documentation
messages: 133730
nosy: docs@python, ssc
priority: normal
severity: normal
status: open
title: distutils doc: duplicate line in table
versions: Python 2.6, Python 2.7, Python 3.1, 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



[issue5057] Unicode-width dependent optimization leads to non-portable pyc file

2011-04-14 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Ezio Melotti wrote:
> 
> Ezio Melotti  added the comment:
> 
> Are there any cases where v[w] -- where v is a unicode object -- returns a 
> non-unicode object?

There could be: either from subclasses or from buggy code. In any case,
macros should only be used if you're certain that the object cannot
be anything else.

Also note that newconst can well be NULL.

--
title: Unicode-width dependent optimization leads tonon-portable pyc file 
-> Unicode-width dependent optimization leads to  non-portable pyc file

___
Python tracker 

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



[issue5057] Unicode-width dependent optimization leads to non-portable pyc file

2011-04-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
versions: +Python 3.3 -Python 2.6, Python 3.1

___
Python tracker 

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



[issue9101] reference json format in file formats chapter

2011-04-14 Thread anatoly techtonik

anatoly techtonik  added the comment:

Thanks.

--

___
Python tracker 

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



[issue5057] Unicode-width dependent optimization leads to non-portable pyc file

2011-04-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

Are there any cases where v[w] -- where v is a unicode object -- returns a 
non-unicode object?

--

___
Python tracker 

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



[issue5057] Unicode-width dependent optimization leads to non-portable pyc file

2011-04-14 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Ezio Melotti wrote:
> 
> Ezio Melotti  added the comment:
> 
> The attached patch skips the peepholer optimizations for BINARY_SUBSCR if the 
> resulting char is a surrogate on narrow builds or a non-bmp char in wide 
> builds.
> Note that this affects the optimization of lone surrogates on narrow builds 
> too, but I think it's not worth to adding more complexity on the peepholer 
> and check if they are part of a surrogate pair.
> The patch still lacks comments and could have better tests.

 newconst = PyObject_GetItem(v, w);
+if (PyUnicode_Check(v)) {
+Py_UNICODE ch = PyUnicode_AS_UNICODE(newconst)[0];

Without checking, you shouldn't assume that newconst is a PyUnicodeObject.

Other than that the patch looks fine.

--
nosy: +lemburg
title: Unicode-width dependent optimization leads to non-portable pyc file -> 
Unicode-width dependent optimization leads to non-portable pyc file

___
Python tracker 

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



[issue4537] webbrowser.UnixBrowser should use builtins.open

2011-04-14 Thread R. David Murray

R. David Murray  added the comment:

Despite the apparent similarity, your issue is something different from what 
was reported in this issue.  Could you please open a new issue for your problem?

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



[issue5057] Unicode-width dependent optimization leads to non-portable pyc file

2011-04-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

The attached patch skips the peepholer optimizations for BINARY_SUBSCR if the 
resulting char is a surrogate on narrow builds or a non-bmp char in wide builds.
Note that this affects the optimization of lone surrogates on narrow builds 
too, but I think it's not worth to adding more complexity on the peepholer and 
check if they are part of a surrogate pair.
The patch still lacks comments and could have better tests.

--
keywords: +needs review, patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file21660/issue5057.diff

___
Python tracker 

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



[issue8326] Cannot import name SemLock on Ubuntu lucid

2011-04-14 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +barry

___
Python tracker 

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



[issue9101] reference json format in file formats chapter

2011-04-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

In msg123296, r86976.

--

___
Python tracker 

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



[issue9101] reference json format in file formats chapter

2011-04-14 Thread anatoly techtonik

anatoly techtonik  added the comment:

Awesome. Especially links to actual changesets. BTW, there are only backport 
commits - where is the notification about the main one?

--

___
Python tracker 

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



[issue10932] distutils.core.setup - data_files misbehaviour ?

2011-04-14 Thread Prashant Kumar

Prashant Kumar  added the comment:

I have added a test for the modification in msg127191. Though, inside zip-file 
we get files without its parent dir, nothing changes in manifest file(should it 
change?). Please have a look at the changeset 
https://bitbucket.org/pkumar/distutils2_bugs/changeset/7473385c23f2.

--
hgrepos: +18
nosy: +Prashant.Kumar

___
Python tracker 

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



[issue9101] reference json format in file formats chapter

2011-04-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

It's just a mercurial hook that sends email, and yes, it's possible to close 
the issues automatically writing "closes #" in the commit message, but I 
prefer to close the issue manually.

--

___
Python tracker 

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



[issue9544] xdrlib.Packer().pack_fstring throws a TypeError when called with a str()

2011-04-14 Thread Filip Gruszczyński

Filip Gruszczyński  added the comment:

Actually documentation doesn't say that it supports only bytes, but:

"The following methods support packing strings, bytes, and opaque data:"

Also under python2 you can easily do this:

In [1]: import xdrlib

In [2]: p = xdrlib.Packer()

In [3]: p.pack_string('some str')

In [4]: p.pack_string(u'some str')

So to conclude I believe either docs for python3 should be changed to say that 
only bytes are allowed or it should be changed to work as in python2. It's 
clear that in python2 some unicode string are accepted and I think we should 
allow such strings to be accepted in python3 too.

--

___
Python tracker 

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



[issue9101] reference json format in file formats chapter

2011-04-14 Thread anatoly techtonik

anatoly techtonik  added the comment:

Wow. That's much better - python makes progress. Does this `robot` stuff flies 
back to Roundup? Is it possible to specify "closes bug #9101" directly in 
commit message?

--

___
Python tracker 

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