[issue2604] doctest.DocTestCase fails when run repeatedly

2008-04-18 Thread Piet Delport

Changes by Piet Delport <[EMAIL PROTECTED]>:


--
keywords: +patch
Added file: http://bugs.python.org/file10060/reset_globs.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue2645] httplib throws ValueError

2008-04-18 Thread Niall O'Higgins

Niall O'Higgins <[EMAIL PROTECTED]> added the comment:

Unfortunately I do not get this consistently from any URL.  My code is
periodically polling a single HTTP server over the Internet.  Quite
possibly it is triggered by some random network/remote server condition. 

I have not had the chance to look deeply into the RFC yet.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2657] curses

2008-04-18 Thread Fernando Pérez

New submission from Fernando Pérez <[EMAIL PROTECTED]>:

Curses sometimes fails to correctly initialize the terminal. 
Unfortunately I don't know how to reproduce the problem, it was reported
multiple times by ipython users, but I have no idea what causes it.  I
finally found a workaround by making a termios call that at least
restores terminal state (see attachment), but it's just a workaround,
not a real fix.

The issue manifests itself as follows: at some point (I don't know why),
a call to curses.initscr() doesn't actually set the terminal in the
usual mode where input isn't accepted, but instead the terminal
continues accepting normal input, issuing newlines, etc.  The only sign
that curses is active is that in a modern terminal, the scrollbar
changes to fill the screen.  After this, calling curses.endwin(),
instead of restoring terminal state, leaves the terminal in the mode
that typically initscr() would put it in: no input is displayed,
printouts swallow end-of-line characters, etc.

When this happened in ipython sessions, we'd just suggest users call
!reset (the system command), which would restore terminal state.  But
the problem is obviously in curses itself, because once this problem
appeared, running the attached script would always print 'False' for the
state condition checked there.

For now in IPython we have a workaround, but perhaps with this little
description/example, someone who knows the curses code might be able to
actually fix the real problem.  If I find a reliable way to trigger the
bug, I'll add comments here indicating so.

--
components: Extension Modules
files: cursesbug.py
messages: 65626
nosy: fer_perez
severity: normal
status: open
title: curses
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file10059/cursesbug.py

__
Tracker <[EMAIL PROTECTED]>

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



[issue2645] httplib throws ValueError

2008-04-18 Thread Georg Brandl

Changes by Georg Brandl <[EMAIL PROTECTED]>:


--
assignee:  -> georg.brandl
nosy: +georg.brandl

__
Tracker <[EMAIL PROTECTED]>

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



[issue2458] Allow Python code to change Py3k warning flag

2008-04-18 Thread Benjamin Peterson

Benjamin Peterson <[EMAIL PROTECTED]> added the comment:

As suggested by Christian, this patch changes the method names to
setpy3kwarn and getpy3kwarn.

--
nosy: +tiran
Added file: http://bugs.python.org/file10058/change_py3kwarning2.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue2656] Autodoc should skip inherited methods

2008-04-18 Thread John Millikin

New submission from John Millikin <[EMAIL PROTECTED]>:

Using the following class layout:

class A (object):
def a (self):
"A.a"
pass
class B (A):
def b (self):
"B.b"
pass

If sphinx.ext.autodoc is used to extract documentation, the entry for
class B will have subentries for both the a() and b() methods. This is
unnecessary clutter. It would be nice if the inherited method was
skipped when documenting B, or even better if it was inserted as a
"stub" linking to the documentation for A.a().

--
assignee: georg.brandl
components: Documentation tools (Sphinx)
messages: 65624
nosy: georg.brandl, jmillikin
severity: normal
status: open
title: Autodoc should skip inherited methods
type: behavior
versions: Python 2.6

__
Tracker <[EMAIL PROTECTED]>

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



[issue2014] xmlrpclib cannot send datetime objects with dates before 1900

2008-04-18 Thread Skip Montanaro

Skip Montanaro <[EMAIL PROTECTED]> added the comment:

Checked in on trunk as r62378.  Will let the normal 3.0 merge process
suck it over to the py3k branch.

--
resolution:  -> accepted
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

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



[issue2416] % string formatting does not support %b

2008-04-18 Thread Eric Smith

Eric Smith <[EMAIL PROTECTED]> added the comment:

I should have noted that the PEP was modified to remove %b and %#b
formatting.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2416] % string formatting does not support %b

2008-04-18 Thread Eric Smith

Eric Smith <[EMAIL PROTECTED]> added the comment:

On the python-3000 list we decided not to add new features to %
formatting, since it will be deprecated in favor of str.format.

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

__
Tracker <[EMAIL PROTECTED]>

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



[issue2655] Create ctypes instances from buffer interface

2008-04-18 Thread Thomas Heller

Changes by Thomas Heller <[EMAIL PROTECTED]>:


--
type:  -> behavior

__
Tracker <[EMAIL PROTECTED]>

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



[issue2655] Create ctypes instances from buffer interface

2008-04-18 Thread Thomas Heller

New submission from Thomas Heller <[EMAIL PROTECTED]>:

This patch implements a .from_buffer(source, offset=0) class method from
ctypes types.  'source' must expose a writeable buffer interface; the
created ctypes instance will share the internal buffer of the source
object; also it holds a reference to the source object to keep it alive.

The usual problems with the buffer interface are not hidden.

Open question:
Should there be an additional 'copy_from_buffer' class method that
accepts read-only buffer interface (as an alternative, an optional
'copy=False' parameter could be introduced)?

--
assignee: theller
components: ctypes
files: from_buffer.patch
keywords: patch, patch
messages: 65620
nosy: theller
severity: normal
status: open
title: Create ctypes instances from buffer interface
versions: Python 2.6
Added file: http://bugs.python.org/file10057/from_buffer.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue1184112] Missing trailing newline with comment raises SyntaxError

2008-04-18 Thread Nick Coghlan

Nick Coghlan <[EMAIL PROTECTED]> added the comment:

Yeah, it's actually still blowing up for me to. I have no idea what I
actually tested when I thought it was working in 2.6/3.0 - I must have
managed to sneak an extra carriage return into the test string. So
reverting back to marking it as a non-easy interpreter core problem.

--
components: +Interpreter Core -Documentation

_
Tracker <[EMAIL PROTECTED]>

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



[issue2654] Typo at http://docs.python.org/dev/3.0/howto/doanddont.html

2008-04-18 Thread A.M. Kuchling

A.M. Kuchling <[EMAIL PROTECTED]> added the comment:

Fixed in r62373; thanks for reporting this!

--
assignee: georg.brandl -> akuchling
nosy: +akuchling
resolution:  -> fixed
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

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



[issue2636] Regexp 2.6 (modifications to current re 2.2.2)

2008-04-18 Thread Jeffrey C. Jacobs

Jeffrey C. Jacobs <[EMAIL PROTECTED]> added the comment:

This simple patch adds (?P#...)-style comment support.

Added file: http://bugs.python.org/file10056/issue2636-05.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue2250] rlcompleter raises Exception on bad input

2008-04-18 Thread Lorenz Quack

Changes by Lorenz Quack <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file10054/rlcompleter.rst.diff

__
Tracker <[EMAIL PROTECTED]>

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



[issue2250] rlcompleter raises Exception on bad input

2008-04-18 Thread Lorenz Quack

Lorenz Quack <[EMAIL PROTECTED]> added the comment:

In the last patch I used the wrong ticks. I hope it's fine like this.

Added file: http://bugs.python.org/file10055/rlcompleter.rst.diff

__
Tracker <[EMAIL PROTECTED]>

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



[issue2250] rlcompleter raises Exception on bad input

2008-04-18 Thread Lorenz Quack

Lorenz Quack <[EMAIL PROTECTED]> added the comment:

I attached a patch for the docs.
It now states that the rlcompleter.Completer will catch and silence all
exceptions raised by evaluating the expression passed to complete()

Added file: http://bugs.python.org/file10054/rlcompleter.rst.diff

__
Tracker <[EMAIL PROTECTED]>

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



[issue2636] Regexp 2.6 (modifications to current re 2.2.2)

2008-04-18 Thread Jeffrey C. Jacobs

Jeffrey C. Jacobs <[EMAIL PROTECTED]> added the comment:

Here is a patch to implement item 7)

Added file: http://bugs.python.org/file10053/issue2636-07.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue2636] Regexp 2.6 (modifications to current re 2.2.2)

2008-04-18 Thread Jeffrey C. Jacobs

Jeffrey C. Jacobs <[EMAIL PROTECTED]> added the comment:

Here are the modification so far for item 9) in _sre.c plus some small
modifications to sre_constants.h which are only to get _sre.c to
compile; normally sre_constants.h is generated by sre_constants.py, so
this is not the final version of that file.  I also would have intended
to make SRE_CHARSET and SRE_COUNT use lookup tables, as well as maybe
others, but not likely any other lookup tables.  I also want to remove
alloc_pos out of the self object and make it a parameter to the ALLOC
parameter and probably get rid of the op_code attribute since it is only
used in 1 place to save one subtract in a very rare case.  But I want to
resolve the 10% problem first, so would appreciate it if people could
look at the REMOVE_SRE_MATCH_MACROS section of code and compare it to
the non-REMOVE_SRE_MATCH_MACROS version of SRE_MATCH and see if you can
suggest anything to make the former (new code) faster to get me that
elusive 10%.

--
keywords: +patch
Added file: http://bugs.python.org/file10052/issue2636-09.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue2654] Typo at http://docs.python.org/dev/3.0/howto/doanddont.html

2008-04-18 Thread Ismail Donmez

New submission from Ismail Donmez <[EMAIL PROTECTED]>:

At top it says "This document is placed in the public doman." should do
a s/doman/domain .

--
assignee: georg.brandl
components: Documentation
messages: 65612
nosy: cartman, georg.brandl
severity: normal
status: open
title: Typo at http://docs.python.org/dev/3.0/howto/doanddont.html
type: behavior
versions: Python 3.0

__
Tracker <[EMAIL PROTECTED]>

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



[issue2014] xmlrpclib cannot send datetime objects with dates before 1900

2008-04-18 Thread Skip Montanaro

Skip Montanaro <[EMAIL PROTECTED]> added the comment:

working on it

--
assignee:  -> skip.montanaro
nosy: +skip.montanaro

__
Tracker <[EMAIL PROTECTED]>

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



[issue1731717] race condition in subprocess module

2008-04-18 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

This popped up on the mailing list today.

Please give this bug a proper review. I *believe* it's fixed but I'm not
sure.

--
nosy: +tiran
priority: normal -> critical
type:  -> behavior
versions: +Python 2.5, Python 2.6, Python 3.0 -Python 2.4

_
Tracker <[EMAIL PROTECTED]>

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



[issue2651] Strings passed to KeyError do not round trip

2008-04-18 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment:

Here is another form of the same inconsistency:

>>> [].pop(0)
IndexError: pop from empty list
>>> {}.pop(0)
KeyError: 'pop(): dictionary is empty'

And my preferred one:
>>> unicodedata.lookup('"')
KeyError: 'undefined character name \'"\''

KeyError is special in that dict lookup raises the equivalent of
KeyError(key). Since the key may be any kind of (hashable) object, it's
preferable to repr() it.

I can see 3 solutions to the problem:

1- imitate IndexError for lists: the exception do not contain the key.

2- dict lookup builds the complete string message, and raise it
   raise KeyError("key not found: %r" % key)
then KeyError.__str__ can be removed.

3- like IOError, KeyError has "msg" and "key" attributes. then dict
lookup raises
   raise KeyError("key not found", key)
and KeyError.__str__ is something like:
   if self.key is not None:
   return "%s: %r" % (self.msg, self.key)
   else
   return str(self.msg)

Choice 1 is not an improvement.
Choice 2 has the correct behavior but leads to performance problems;
KeyErrors are very very common in the interpreter (namespace lookups...)
and formatting the message is costly.
Choice 3 may cause regression for code that use exception.args[0], but
otherwise seems the best to me. I'll try to come with a patch.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2014] xmlrpclib cannot send datetime objects with dates before 1900

2008-04-18 Thread Ralf Schmitt

Ralf Schmitt <[EMAIL PROTECTED]> added the comment:

guido says it's ok to fix the issue in xmlrpclib only:
http://mail.python.org/pipermail/python-dev/2008-April/078396.html

I'm also attaching a dummy.diff in order to have a patch keyword...
If someone is willing to commit this, I'll check if it still applies to
trunk and maybe update the diff.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2632] performance problem in socket._fileobject.read

2008-04-18 Thread Ralf Schmitt

Ralf Schmitt <[EMAIL PROTECTED]> added the comment:

However it should be fixed in release25-maint. Can anyone install curt's
patch? It does what the original fix intended to do.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2630] repr() should not escape non-ASCII characters

2008-04-18 Thread Marc-Andre Lemburg

Marc-Andre Lemburg <[EMAIL PROTECTED]> added the comment:

On 2008-04-18 05:35, atsuo ishimoto wrote:
> atsuo ishimoto <[EMAIL PROTECTED]> added the comment:
> 
> Is a codec which encode() returns an Unicode allowed in Python3?

Sure, why not ?

I think you have to ask another question: Is repr() allowed to
return a string (instead of Unicode) in Py3k ?

If not, then unicode_repr() will have to check the return value of
the codec and convert it back to Unicode as necessary.

> I started to think codec is not nessesary, but python function is enough.

That's what we currently have with unicode_repr(), but it doesn't
solve the problem.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2653] string to float to int

2008-04-18 Thread Raymond Hettinger

Raymond Hettinger <[EMAIL PROTECTED]> added the comment:

>>> int('%.0f' % (float('1.005')*1000))
1005

>>> int(Decimal('1.005')*1000)
1005

--
nosy: +rhettinger

__
Tracker <[EMAIL PROTECTED]>

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



[issue2653] string to float to int

2008-04-18 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment:

Yes, and 
  >>> 1.005 * 1000
  1004.9

Please read 
http://www.python.org/doc/faq/general/#why-are-floating-point-calculations-so-inaccurate

To perform exact base-10 calculation, you may use the Decimal module.
Or use round() instead of the int() truncation.

--
nosy: +amaury.forgeotdarc
resolution:  -> invalid
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

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



[issue2652] 64 bit python memory leak usage

2008-04-18 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment:

Please provide a "main" function to test with.
I tried to write one based on your code; but memory usage was stable
after a few seconds.

--
nosy: +amaury.forgeotdarc

__
Tracker <[EMAIL PROTECTED]>

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



[issue2653] string to float to int

2008-04-18 Thread wr

New submission from wr <[EMAIL PROTECTED]>:

IDLE 1.2.1  
>>> print int(float('1.005')*1000)
1004

--
components: None
messages: 65602
nosy: wr
severity: normal
status: open
title: string to float to int
type: behavior
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>

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