[issue2384] [Py3k] line number is wrong after encoding declaration

2008-08-29 Thread Dwayne Litzenberger

Dwayne Litzenberger <[EMAIL PROTECTED]> added the comment:

Could "-*- coding: ascii -*-" and other equivalent encodings be fixed,
at least, before the release?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3732] bdist_msi gives a deprecation warning when run with Python 2.6

2008-08-29 Thread Hirokazu Yamamoto

Hirokazu Yamamoto <[EMAIL PROTECTED]> added the comment:

This patch will partialy backport r53335

--
keywords: +patch
nosy: +ocean-city
Added file: http://bugs.python.org/file11315/fix_deprecated_sets.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2548] Undetected error in exception handling

2008-08-29 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

After thinking about it a bit, I think the whole recursion checking
thing has gone a bit mad. It probably deserves proper discussion on the
mailing-list. In the meantime, I'm downgrading this bug to critical.

--
priority: release blocker -> critical

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3720] segfault in for loop with evil iterator

2008-08-29 Thread Raymond Hettinger

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

It's not just performance -- the patch code is grotesque.  Lots of code 
would need to be changed just before the release candidate (usually a 
bad idea).  And the underlying problem doesn't seem to be one that has 
*ever* affected a real user since 2.2.  I have a hard time caring much 
about this problem.  

The minor performance hit only bugs me because it affects the inner-
loops of just about every piece of real python code -- everyone will 
pay a cost for this change.

Since the "problem" has existed so long with no ill effect, am 
unmarking the "release blocker" priority.  Would rather have a 
thoughtful discussion on alternatives along with a careful, thorough, 
efficient patch for a bug release version.

--
priority: release blocker -> normal

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2548] Undetected error in exception handling

2008-08-29 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Ouch, there were a couple of useless lines in ceval.h. New patch.

Added file: http://bugs.python.org/file11314/excrecurse.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2548] Undetected error in exception handling

2008-08-29 Thread Antoine Pitrou

Changes by Antoine Pitrou <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file11313/excrecurse.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3736] super is a built-in type

2008-08-29 Thread Raymond Hettinger

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

Am already working on the docs for super().

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

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3720] segfault in for loop with evil iterator

2008-08-29 Thread Daniel Diniz

Daniel Diniz <[EMAIL PROTECTED]> added the comment:

Raymond, I think a different solution would be great, as the performance
penalty might become nasty in tight loops if we miss some detail. 

Regarding the possible impact, I hope we can get a better estimate since
the other examples of segfaulting that look like Armin's I've found are
in itertools. I imagine you have the right tests to check the effect of
any changes there.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2548] Undetected error in exception handling

2008-08-29 Thread Antoine Pitrou

Changes by Antoine Pitrou <[EMAIL PROTECTED]>:


--
keywords: +needs review

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2548] Undetected error in exception handling

2008-08-29 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Ok, here is a patch which seems to cover all bases. It fixes the present
bug, adds tests for the aforementioned ex-crashers, backports the
somewhat smarter recursion checking from py3k, and improves the latter
by fixing a nasty recursion bug when exceptions are ignored by C code.

I have to explain the latter problem a bit. Some functions like
PyDict_GetItem() are designed to silence all exceptions. If a
RuntimeError is raised because of a recursion overflow, however, a flag
(named "overflowed") is additionally set in the thread state structure;
this flag temporarily bumps the recursion_limit by 50, so that the  code
which caught the exception can perform some cleanup without itself
getting into the recursion limit. However, if recursion_limit + 50 is in
turned reached, the interpreter aborts with a fatal error.

Now, if the RuntimeError is discarded by PyDict_GetItem(), the
"overflowed" flag must also be reset, because the caller won't know that
there was a recursion overflow and that it must clean up. Instead, it
will simply assume the requested value is not in the dict, and will
continue happily... until it overflows the recursion limit again, which
will trigger the aforementioned fatal error if "overflowed" has not been
reset.

Consequently, PyErr_Clear() now resets the "overflowed" flag if the
current recursion count has gone back below the recursion limit. This
improvement must also be merged back to py3k.

Of course, we may also decide that all those subtle changes are not
worth the risk, just to fix a few obscure glitches.

--
keywords: +patch
Added file: http://bugs.python.org/file11313/excrecurse.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3720] segfault in for loop with evil iterator

2008-08-29 Thread Terry J. Reedy

Terry J. Reedy <[EMAIL PROTECTED]> added the comment:

I share Raymond's annoyance.  The ultimate solution for segfaults is for
bad pointer references to be catchable (trappable) the same as math
errors are are now.  I remember when 1/0 was fatal, not EDOM.  Then the
interpreter could print a traceback and SegfaultException message ;-)

For this problem, I think there are alternatives to the current patch,
which as Armin points out, would need to be extended to every built-in
use of iterators.

Is there any (sensible) way to make .__next__ (or the underlying
tp_iternext slot) undelete-able?  We already cannot change methods of
built-ins.  Or replace with def __next__(self): raise StopIteration.

Or could iter() temporarily lock iterators in some way similar to what
happens to dict during iteration?  (Modifying actually does the action,
and then raises RuntimeError).  Modifying an active iterator strikes me
as even less sane than modifying an underlying dict.

The basic problem is that C code (unnecessarily?) does the same pointer
tracing each iteration.  Why not calculate np = *v->ob_type->tp_iternext
just once?  and just (more quickly) call np(v) each iteration?

One could claim this is a semantic change, but so was the change to dicts.  

The equivalent in Python would be

class BadIterator() :
def __iter__(self) :
return self
def __next__(self) : # should be __next__ for python 3.0
del BadIterator.__next__
return 1

itnext = BadIterator().__next__
print(itnext())
print(itnext())

The second itnext call only fails because the del statement fails with
AttributeError: __next__.  I presume it would do the same if called from C.

(My annoyance with Py3 changing .next to .__next__ is that it makes it
harder to do the 'right thing' when iterating explicitly, which to me it
to use a bound method.  I wish next(it) returned it.__next__ instead of
calling it.)

--
nosy: +tjreedy

___
Python tracker <[EMAIL PROTECTED]>

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



[issue836035] strftime month name is encoded somehow

2008-08-29 Thread Kevin Watters

Changes by Kevin Watters <[EMAIL PROTECTED]>:


--
nosy: +kevinwatters

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3736] super is a built-in type

2008-08-29 Thread Tarek Ziadé

New submission from Tarek Ziadé <[EMAIL PROTECTED]>:

super is defined as a built-in function

http://docs.python.org/dev/library/functions.html

but it is a type, shouldn't it be replaced ?

--
assignee: georg.brandl
components: Documentation
messages: 72174
nosy: georg.brandl, tarek
severity: normal
status: open
title: super is a built-in type
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3720] segfault in for loop with evil iterator

2008-08-29 Thread Raymond Hettinger

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

Amaury, if you decide to go forward with this, please clean-up the 
patches to eliminate common subexpressions. 

Wonder if there is an alternate solution that keeps the next slot 
filled with something that raises an Attribute error.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3720] segfault in for loop with evil iterator

2008-08-29 Thread Daniel Diniz

Daniel Diniz <[EMAIL PROTECTED]> added the comment:

Hopefully the right patch this time :/

Added file: http://bugs.python.org/file11312/itercrashers.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3720] segfault in for loop with evil iterator

2008-08-29 Thread Daniel Diniz

Changes by Daniel Diniz <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file11311/itercrashers.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3720] segfault in for loop with evil iterator

2008-08-29 Thread Daniel Diniz

Daniel Diniz <[EMAIL PROTECTED]> added the comment:

This patch fixes Armin's list of crashers for trunk. Looking for others
like them.

--
nosy: +ajaksu2
versions: +Python 2.6
Added file: http://bugs.python.org/file11311/itercrashers.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3735] allow multiple threads to efficiently send the same requests to a processing.Pool without incurring duplicate processing

2008-08-29 Thread David Decotigny

New submission from David Decotigny <[EMAIL PROTECTED]>:

I posted a recipe on ASPN: http://code.activestate.com/recipes/576462/
and Jesse, cheerleader for the inclusion of (multi)processing into
python-core, suggested that it could be interesting to add this feature
to the next pythons.
This recipe is based on version 0.52 of the standalone "processing"
package, and allows to avoid redundancy when multiple threads send the
same job requests to a pool of background worker processes. The recipe
details the why and the how.
Some notes on the implementation, though:
 - There is a "Begin/End workaround" section in the code, which aims at
working around a limitation of processing 0.52 (see comments and
docstring for details). I sent issue #014431 to the issue tracker for
processing on berlios, this would allow to get rid of this workaround
 - Read my comment #2 to the recipe, dealing with my thoughts of using
weak references

--
components: Library (Lib)
messages: 72170
nosy: DavidDecotigny, jnoller
severity: normal
status: open
title: allow multiple threads to efficiently send the same requests to a 
processing.Pool without incurring duplicate processing
type: feature request
versions: Python 2.6, Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3734] subclassing complex

2008-08-29 Thread Blair

New submission from Blair <[EMAIL PROTECTED]>:

The following is quoted from the Python docs (ref/numeric_types):

"Note: If the right operand's type is a subclass of the left operand's
type and that subclass provides the reflected method for the operation,
this method will be called before the left operand's non-reflected
method. This behavior allows subclasses to override their ancestors'
operations."

My issue is that the built-in complex type does not respect this rule
(see code below). Note that float can be subclassed using the method
shown below and the rules are applied correctly. It seems that it is
only a problem with complex.

class xcomplex( complex ):

def __new__(cls,*args,**kwargs):
return complex.__new__(cls,*args,**kwargs)

def __coerce__(self,other):
t = complex.__coerce__(self,other)
try:
return (self,xcomplex(t[1]))
except TypeError:
return t

def __add__(self,x):
return xcomplex( complex.__add__(self,x) )

def __radd__(self,x):
return xcomplex( complex.__radd__(self,x) ) 

print type(z + xz)  # gives complex when xcomplex is required

--
components: None
messages: 72169
nosy: gumtree
severity: normal
status: open
title: subclassing complex
type: behavior
versions: Python 2.5

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3679] pressing HOME key in IDLE editor ends IDLE

2008-08-29 Thread Toby Donaldson

Toby Donaldson <[EMAIL PROTECTED]> added the comment:

I am using (x86) Python 3.0b2 on Windows XP Home Edition (SP 3) on an
AMD 64 X2 Dual Core Processor 6400+, 2.41 GHz, with 2 GB of RAM.

Just to be clear, its when I press HOME in the *editor* window when the
crash occurs. There's no problem if I press HOME in the shell window.

As soon as the 3.0b3 (or later) installer is released for Windows, I'll
check it out again.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3733] Adding bin and Scripts folder into PATH

2008-08-29 Thread Tarek Ziadé

New submission from Tarek Ziadé <[EMAIL PROTECTED]>:

The windows installer could add two entries in the PATH environment
variable. This would make "Python.exe" and other binaries available from
the command prompt without having to change PATH manually.

--
components: Installation, Windows
messages: 72167
nosy: mhammond, tarek
severity: normal
status: open
title: Adding bin and Scripts folder into PATH
type: feature request
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3679] pressing HOME key in IDLE editor ends IDLE

2008-08-29 Thread Terry J. Reedy

Terry J. Reedy <[EMAIL PROTECTED]> added the comment:

Things like this tend to be system specific, and sometimes even machine
specific, so please include platform/os with reports, even I you do not
think it relevant.

In this case, Home works as it should on my WinXP 3.0b2
(which is fortunate since there is no b3 installer, and may not be).

--
nosy: +tjreedy

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3675] Python 2.6 can't read sets pickled with Python 3.0

2008-08-29 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

> Was it really intended that 3.0 pickles unpickle on 2.6?

He used protocol 2, so he explicitly asked for something inpickleable
with 2.6. If it's not the intended behaviour, then protocols < 3 should
be deprecated.

--
nosy: +pitrou

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3675] Python 2.6 can't read sets pickled with Python 3.0

2008-08-29 Thread Terry J. Reedy

Terry J. Reedy <[EMAIL PROTECTED]> added the comment:

Was it really intended that 3.0 pickles unpickle on 2.6?
What about other changes like moving something from one module to
another (reduce from built-in to functools), changing all classes to new
style (several examples), or adding methods to a built-in class (floats)?

--
nosy: +tjreedy

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2548] Undetected error in exception handling

2008-08-29 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

The crashers which were deleted in rev58032 should at least have been
turned into unittests... well.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3732] bdist_msi gives a deprecation warning when run with Python 2.6

2008-08-29 Thread Marc-Andre Lemburg

New submission from Marc-Andre Lemburg <[EMAIL PROTECTED]>:

d:\Python26\lib\msilib\__init__.py:5: DeprecationWarning: the sets
module is deprecated
  import sets, os, string, re

Should be easy to solve.

--
components: Distutils, Library (Lib)
keywords: easy
messages: 72162
nosy: lemburg
priority: normal
severity: normal
status: open
title: bdist_msi gives a deprecation warning when run with Python 2.6
type: behavior
versions: Python 2.6

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3297] Python interpreter uses Unicode surrogate pairs only before the pyc is created

2008-08-29 Thread Terry J. Reedy

Terry J. Reedy <[EMAIL PROTECTED]> added the comment:

"Just to clarify: Python can be built as UCS2 or UCS4 build (not UTF-16
vs. UTF-32)"

I recently read most of the Unicode 5 standard and as near as I could
tell it no longer uses the term UCS, if it ever did.  Chapter 3 has only
the following 3 hits.

1. "D79 A Unicode encoding form assigns each Unicode scalar value to a
unique code unit sequence.
• For historical reasons, the Unicode encoding forms are also referred
to as Unicode (or UCS) transformation formats (UTF). That term is
actually ambiguous between its usage for encoding forms and encoding
schemes."

2. "For a discussion of the relationship between UTF-32 and UCS-4
encoding form defined in ISO/IEC 10646, see Section C.2, Encoding Forms
in ISO/IEC 10646."

Section C.2 says "UCS-4 can now be taken effectively as an alias for the
Unicode encoding form UTF-32" and mentions the restriction of UCS-2 to
the BMP.

3. "ISO/IEC 10646 specifies an equivalent UTF-16 encoding form.
For details, see Section C.3, UCS Transformation Formats."

U5 has 3 coding formats which it names UTF-8,16,32 and 7 serialization
formats of the same name with plus the latter two with 'BE' or 'LE'
append.  So, to me, use of 'UCS' is either confusing or misleading.

--
"If it really was UCS-2, the repr wouldn't be u'\U00010123' on windows. 
It'd be a pair of ill-formed code units instead."

On WinXP,IDLE 3.0b2 
>>> repr('\U00010123') # u prefix no longer needed or valid
"'𐄣'"
>>> repr('\ud800\udd23')
"'𐄣'"
# Interesting: what I cut from IDLE has 2 empty boxes instead of the one
larger square with 010 and 123 I see on FireFox.  len(repr('\U0010123'))
is 4, not 3, so FireFox recognizes the surrogate and displays one symbol.

Entering either directly into the interpreter gives
Python 3.0b2 (r30b2:65106, Jul 18 2008, 18:44:17) [MSC v.1500 32 bit
(Intel)] on win32
>>> c='\U00010123'
>>> len(c)
2
>>> repr(c)
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Program Files\Python30\lib\io.py", line 1428, in write
b = encoder.encode(s)
  File "C:\Program Files\Python30\lib\encodings\cp437.py", line 19, in
encode
return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position
2-3: character maps to  

2.5 gives instead "u'\\U00010123'" as reported, so I added 3.0 to the
list of versions with a problem.

I do wonder how can repr() work on IDLE but not the underlying
interpreter?  Could IDLE change self.errors so that  is left
as is instead of raising an exception?  With the display then replacing
those with empty boxes?

--
nosy: +tjreedy
versions: +Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3660] reference leaks in 3.0

2008-08-29 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Ok, after the two patches plus the patch in #3667, I get the following:

test_asyncore leaked [84, -84] references, sum=0
test_distutils leaked [141, 142] references, sum=283
test_docxmlrpc leaked [-85, 0] references, sum=-85
test_logging leaked [219, -219] references, sum=0
test_sqlite leaked [17, 17] references, sum=34
test_unicode leaked [1, 1] references, sum=2
test_urllib2_localnet leaked [3, 3] references, sum=6
test_xmlrpc leaked [-6, -79] references, sum=-85

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3720] segfault in for loop with evil iterator

2008-08-29 Thread Armin Rigo

Armin Rigo <[EMAIL PROTECTED]> added the comment:

The same approach can be used to segfault many more places.  See
http://svn.python.org/projects/python/trunk/Lib/test/crashers/iter.py .

--
nosy: +arigo

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3720] segfault in for loop with evil iterator

2008-08-29 Thread Raymond Hettinger

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

Go for it.  There's really no question about fixing possible 
segfaulters.  Was just voicing my displeasure at this sort of 
exercise.  The code has been around since at least 2.2 and hasn't 
caused the slightest problem.  It bugs me to put cruft in the middle of 
otherwise tight loops.  Fortunately, the check is cheap and branch 
predictable.

BTW, your timings are domained by the function call and the range(5000) 
step.  To cleanly time for-loop overhead, use:

   python -m timeit "pass"

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3724] math.log(x, 10) gives different result than math.log10(x)

2008-08-29 Thread Florian Mayer

Changes by Florian Mayer <[EMAIL PROTECTED]>:


Added file: http://bugs.python.org/file11310/log.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3678] Ignored LDFLAGS during linking libpython$(VERSION).so

2008-08-29 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis <[EMAIL PROTECTED]> added the comment:

I'm confirming that the newer patch also fixes this bug.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3724] math.log(x, 10) gives different result than math.log10(x)

2008-08-29 Thread Florian Mayer

Changes by Florian Mayer <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file11302/log.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3660] reference leaks in 3.0

2008-08-29 Thread Amaury Forgeot d'Arc

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

Did you look at the patch for issue3667 ? it should at least correct
test_site.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3720] segfault in for loop with evil iterator

2008-08-29 Thread Amaury Forgeot d'Arc

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

Here are some timings, on winXP, vs2008 release build:

# t.py
def f(l=range(5000)): 
for x in l: pass

# before the patch
> python -m timeit -s "from t import f" "f()"
1 loops, best of 3: 159 usec per loop

# after the patch
> python -m timeit -s "from t import f" "f()"
1 loops, best of 3: 160 usec per loop

and these figures are pretty stable on my machine.
Is it too much to pay? Some may consider that potential crashes are more
expensive.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3660] reference leaks in 3.0

2008-08-29 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

With the two patches applied, we are now at:

test_unittest leaked [124, 124] references, sum=248
test_distutils leaked [141, 142] references, sum=283
test_docxmlrpc leaked [85, -85] references, sum=0
test_logging leaked [366, -366] references, sum=0
test_os leaked [37, 0] references, sum=37
test_site leaked [88, 88] references, sum=176
test_smtplib leaked [0, 87] references, sum=87
test_sqlite leaked [17, 17] references, sum=34
test_telnetlib leaked [151, -151] references, sum=0
test_unicode leaked [1, 1] references, sum=2
test_urllib2_localnet leaked [3, 3] references, sum=6
test_xmlrpc leaked [-85, 0] references, sum=-85

24 tests skipped:
test_bsddb3 test_cProfile test_codecmaps_cn test_codecmaps_hk
test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_curses
test_dbm_gnu test_kqueue test_nis test_normalization
test_ossaudiodev test_pep277 test_socketserver test_startfile
test_tcl test_timeout test_urllib2net test_urllibnet test_winreg
test_winsound test_xmlrpc_net test_zipfile64
2 skips unexpected on linux2:

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3729] SystemError on calling len() if __len__() doesn't return an int

2008-08-29 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

That is *not* wanted. We had a discussion on the list about changing the
return value of the sq_length slot to allow larger lengths to be
reported, and while I don't recall why this wasn't done, I do recall
that the consensus was that if Py_ssize_t remains, len() should raise
rather than lie for larger values-

--
nosy: +georg.brandl

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3678] Ignored LDFLAGS during linking libpython$(VERSION).so

2008-08-29 Thread Ali Polatel

Changes by Ali Polatel <[EMAIL PROTECTED]>:


--
nosy: +hawking

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3660] reference leaks in 3.0

2008-08-29 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file11285/encode-leak.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3660] reference leaks in 3.0

2008-08-29 Thread Amaury Forgeot d'Arc

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

Oops, you are right of course.
I remove my patch so we don't get confused.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3729] SystemError on calling len() if __len__() doesn't return an int

2008-08-29 Thread Amaury Forgeot d'Arc

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

Not bad! some remarks though:
- It's better to avoid the "expensive" call to PyErr_Occurred() when
possible. Here, an exception is set if (and only if) len==-1.
For example, it is enough to add these lines after the "__len__() should
return >= 0" message:

+   else if (PyErr_ExceptionMatches(PyExc_TypeError))
+   PyErr_SetString(PyExc_TypeError, 
+   "__len__() should return an int");

- Please clarify (that is: add tests for) the case where __len__ returns
1<<50 or -1<<50. If I remember correctly, PyNumber_AsSsize_t(res, NULL)
clips the values to MAXINT. Is this wanted?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3660] reference leaks in 3.0

2008-08-29 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Amaury, I believe the first part of encode-leak.patch is wrong, you
should Py_DECREF the bytearray after it has been converted to bytes, not
before. Here is an alternate patch.

Added file: http://bugs.python.org/file11309/encode-leak2.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3668] "s*" argument parser marker leaks memory

2008-08-29 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Committed in r66057 and r66058.

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

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3720] segfault in for loop with evil iterator

2008-08-29 Thread Raymond Hettinger

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

It would be a damned shame to slow down the entire language to save 
code that is intentionally shooting itself in the foot.  EVERYONE will 
pay a cost -- NO ONE will benefit.  My two cents.

--
nosy: +rhettinger

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3066] FD leak in urllib2

2008-08-29 Thread James Antill

James Antill <[EMAIL PROTECTED]> added the comment:

So if I add a:

class _WrapForRecv:
def __init__(self, obj):
self.__obj = obj

def __getattr__(self, name):
if name == "recv": name = "read"
return getattr(self.__obj, name)

...and then change:

r.recv = r.read

...into:

r = _WrapForRecv(r)

...it stops the leak, and afaics nothing bad happens.

--
nosy: +nevyn

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3731] import warning in multiprocessing

2008-08-29 Thread Antoine Pitrou

New submission from Antoine Pitrou <[EMAIL PROTECTED]>:

I get the following when running "regrtest.py -uall" under trunk:

/home/antoine/cpython/__svn__/Lib/multiprocessing/__init__.py:82:
ImportWarning: Not importing directory
'/home/antoine/cpython/__svn__/Modules/_multiprocessing': missing
__init__.py
  import _multiprocessing

--
assignee: jnoller
components: Library (Lib)
messages: 72146
nosy: jnoller, pitrou
severity: normal
status: open
title: import warning in multiprocessing
type: behavior
versions: Python 2.6

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3729] SystemError on calling len() if __len__() doesn't return an int

2008-08-29 Thread Hagen Fürstenau

Hagen Fürstenau <[EMAIL PROTECTED]> added the comment:

Of course we can do both: Accept integral-like types and reset the
exception text. The new patch does this and adds a test for the new
behaviour.

Review carefully - I'm a newbie! ;-)

Added file: http://bugs.python.org/file11308/len_check2.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3730] Update BaseHTTPServer docs

2008-08-29 Thread Chris AtLee

New submission from Chris AtLee <[EMAIL PROTECTED]>:

The BaseHTTPServer docs don't mention 'server' as an instance variable
in the instance variable section for BaseHTTPRequestHandler.  It is
mentioned in passing a few paragraphs above in the BaseHTTPServer class
description, but it's too easy to miss there.

Index: basehttpserver.rst
===
--- basehttpserver.rst  (revision 66056)
+++ basehttpserver.rst  (working copy)
@@ -68,6 +68,11 @@
   address.
 
 
+   .. attribute:: server
+
+  Contains the server instance.
+
+
.. attribute:: command
 
   Contains the command (request type). For example, ``'GET'``.

--
assignee: georg.brandl
components: Documentation
messages: 72144
nosy: catlee, georg.brandl
severity: normal
status: open
title: Update BaseHTTPServer docs
type: feature request
versions: Python 2.5, Python 2.6, Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3729] SystemError on calling len() if __len__() doesn't return an int

2008-08-29 Thread Hagen Fürstenau

Hagen Fürstenau <[EMAIL PROTECTED]> added the comment:

Sounds ok, but then you get a more generic "object cannot be interpreted
as an integer" at the point where len() is called, instead of the
clearer "__len__() should return an int". I'm not sure if this could be
confusing.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3729] SystemError on calling len() if __len__() doesn't return an int

2008-08-29 Thread Amaury Forgeot d'Arc

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

What about using PyNumber_AsSsize_t? it uses PyNumber_Index to accept
integral-like types, and refuses floats.

--
nosy: +amaury.forgeotdarc

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3729] SystemError on calling len() if __len__() doesn't return an int

2008-08-29 Thread Hagen Fürstenau

New submission from Hagen Fürstenau <[EMAIL PROTECTED]>:

On Python 3.0:

>>> class C:
... def __len__(self): return "foo"
...
>>> len(C())
Traceback (most recent call last):
  File "", line 1, in 
SystemError: Objects/longobject.c:433: bad argument to internal function


On Python 2.6 the behaviour is different for old and new-style classes,
with old-style classes giving the more informative error message and
both accepting (and truncating) floats.

I attached a patch for Python 3.0, which refuses everything but ints and
gives an informative error message. Or does the float-truncating
behaviour of Python 2.x need to be preserved?

--
files: len_check.diff
keywords: patch
messages: 72141
nosy: hagen
severity: normal
status: open
title: SystemError on calling len() if __len__() doesn't return an int
type: behavior
versions: Python 2.6, Python 3.0
Added file: http://bugs.python.org/file11307/len_check.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3722] print followed by exception eats print with doctest

2008-08-29 Thread Tim Peters

Tim Peters <[EMAIL PROTECTED]> added the comment:

As the doctest docs say,

Examples containing both expected output and an exception
are not supported.  Trying to guess where one ends and
the other begins is too error-prone, and that also makes
for a confusing test.

Since this is working as designed and as documented, it's not "a bug". 
You could call it a feature request.

--
nosy: +tim_one

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3728] imaplib module broken by str to unicode conversion

2008-08-29 Thread Dmitry Vasiliev

Dmitry Vasiliev <[EMAIL PROTECTED]> added the comment:

Ah, yes.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3728] imaplib module broken by str to unicode conversion

2008-08-29 Thread Raghuram Devarakonda

Raghuram Devarakonda <[EMAIL PROTECTED]> added the comment:

This seems to be duplicate of #1210.

--
nosy: +draghuram
resolution:  -> duplicate
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3728] imaplib module broken by str to unicode conversion

2008-08-29 Thread Dmitry Vasiliev

New submission from Dmitry Vasiliev <[EMAIL PROTECTED]>:

Example:

>>> from imaplib import IMAP4
>>> m = IMAP4("localhost")
Traceback (most recent call last):
  File "", line 1, in 
  File "/py3k/Lib/imaplib.py", line 185, in __init__
self.welcome = self._get_response()
  File "/py3k/Lib/imaplib.py", line 912, in _get_response
if self._match(self.tagre, resp):
  File "/py3k/Lib/imaplib.py", line 1021, in _match
self.mo = cre.match(s)
TypeError: can't use a string pattern on a bytes-like object
>>> m = IMAP4(b"localhost")
Traceback (most recent call last):
  File "", line 1, in 
  File "/py3k/Lib/imaplib.py", line 185, in __init__
self.welcome = self._get_response()
  File "/py3k/Lib/imaplib.py", line 912, in _get_response
if self._match(self.tagre, resp):
  File "/py3k/Lib/imaplib.py", line 1021, in _match
self.mo = cre.match(s)
TypeError: can't use a string pattern on a bytes-like object

--
components: Library (Lib)
messages: 72137
nosy: hdima
severity: normal
status: open
title: imaplib module broken by str to unicode conversion
type: crash
versions: Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3727] poplib module broken by str to unicode conversion

2008-08-29 Thread Dmitry Vasiliev

New submission from Dmitry Vasiliev <[EMAIL PROTECTED]>:

Example:

>>> from poplib import POP3
>>> p = POP3("localhost")
>>> p.user("user")
Traceback (most recent call last):
  File "", line 1, in 
  File "/py3k/Lib/poplib.py", line 179, in user
return self._shortcmd('USER %s' % user)
  File "/py3k/Lib/poplib.py", line 151, in _shortcmd
self._putcmd(line)
  File "/py3k/Lib/poplib.py", line 98, in _putcmd
self._putline(line)
  File "/py3k/Lib/poplib.py", line 91, in _putline
self.sock.sendall('%s%s' % (line, CRLF))
TypeError: sendall() argument 1 must be string or buffer, not str
>>> p.user(b"user")
Traceback (most recent call last):
  File "", line 1, in 
  File "/py3k/Lib/poplib.py", line 179, in user
return self._shortcmd('USER %s' % user)
  File "/py3k/Lib/poplib.py", line 151, in _shortcmd
self._putcmd(line)
  File "/py3k/Lib/poplib.py", line 98, in _putcmd
self._putline(line)
  File "/py3k/Lib/poplib.py", line 91, in _putline
self.sock.sendall('%s%s' % (line, CRLF))
TypeError: sendall() argument 1 must be string or buffer, not str

--
components: Library (Lib)
messages: 72136
nosy: hdima
severity: normal
status: open
title: poplib module broken by str to unicode conversion
type: crash
versions: Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3720] segfault in for loop with evil iterator

2008-08-29 Thread Amaury Forgeot d'Arc

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

New patches, with the suggested spelling.
For 3.0 and 2.6.

Added file: http://bugs.python.org/file11306/baditer-2.6.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3720] segfault in for loop with evil iterator

2008-08-29 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc <[EMAIL PROTECTED]>:


Added file: http://bugs.python.org/file11305/baditer.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3720] segfault in for loop with evil iterator

2008-08-29 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file11303/baditer.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3726] Allow ', ' delimiters in logging.config.fileConfig()

2008-08-29 Thread Will Maier

New submission from Will Maier <[EMAIL PROTECTED]>:

Currently, logging.config.fileConfig() inconsistently handles lines like:

[handlers]
keys = spam, eggs

[formatters]
keys = foo, bar

It does, however, correctly handle the ', ' delimiter in the [loggers]
section. This is because the various _install_*() functions in
logging.config aren't consistent about whether (and when) or not they
strip whitespace when generating key names.

Though the stdlib documentation only includes examples in the [handlers]
and [formatters] section with ',' delimiters, it seems reasonable to
expect that logging.config.fileConfig() should handle ', '. The attached
test demonstrates the failure and suggests a solution.

Thanks!
whitespace

--
components: Library (Lib)
files: logging.diff
keywords: patch
messages: 72134
nosy: wcmaier
severity: normal
status: open
title: Allow ',' delimiters in logging.config.fileConfig()
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file11304/logging.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3720] segfault in for loop with evil iterator

2008-08-29 Thread Ismail Donmez

Ismail Donmez <[EMAIL PROTECTED]> added the comment:

Maybe do a s/"object is no more an iterator"/"is no longer an iterator"

--
nosy: +cartman

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3725] telnetlib module broken by str to unicode conversion

2008-08-29 Thread Dmitry Vasiliev

Dmitry Vasiliev <[EMAIL PROTECTED]> added the comment:

I think only bytes need to be allowed for write() and read*() because of
low-level nature of Telnet. I can create a patch later.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3725] telnetlib module broken by str to unicode conversion

2008-08-29 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc <[EMAIL PROTECTED]>:


--
priority:  -> critical

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3725] telnetlib module broken by str to unicode conversion

2008-08-29 Thread Dmitry Vasiliev

New submission from Dmitry Vasiliev <[EMAIL PROTECTED]>:

Simple example:

>>> from telnetlib import Telnet
>>> t = Telnet("google.com", 80)
>>> t.write("GET / HTTP/1.1\r\n")
Traceback (most recent call last):
  File "", line 1, in 
  File "/py3k/Lib/telnetlib.py", line 280, in write
self.sock.sendall(buffer)
TypeError: sendall() argument 1 must be string or buffer, not str
>>> t.write(b"GET / HTTP/1.1\r\n")
Traceback (most recent call last):
  File "", line 1, in 
  File "/py3k/Lib/telnetlib.py", line 277, in write
if IAC in buffer:
TypeError: Type str doesn't support the buffer API

--
components: Library (Lib)
messages: 72131
nosy: hdima
severity: normal
status: open
title: telnetlib module broken by str to unicode conversion
type: crash
versions: Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3720] segfault in for loop with evil iterator

2008-08-29 Thread Amaury Forgeot d'Arc

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

Good catch! Here is a patch for 3.0.

--
keywords: +needs review, patch
nosy: +amaury.forgeotdarc
priority:  -> release blocker
Added file: http://bugs.python.org/file11303/baditer.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3724] math.log(x, 10) gives different result than math.log10(x)

2008-08-29 Thread Florian Mayer

New submission from Florian Mayer <[EMAIL PROTECTED]>:

I have found out that the result of math.log(x, 10) is slightly more
inaccurate than the one of math.log10(x). Probably the best example is
math.log(1000, 10) and math.log10(1000). I have attached a patch that
forces math.log to internally use log10 when it gets the base 10. Patch
is against revision 66056. Also adds 3 tests to test_math.py to test new
behaviour implemented.

--
files: log.patch
keywords: patch
messages: 72129
nosy: segfaulthunter
severity: normal
status: open
title: math.log(x, 10) gives different result than math.log10(x)
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file11302/log.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3717] Py_InitModule* is still referenced in docs

2008-08-29 Thread Amaury Forgeot d'Arc

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

In your patch, it is not correct to declare main as
main(int argc, wchar_t **argv)
It is simply not the correct signature: the OS only supports "char** argv".

You have to perform the conversion yourself. Look for example at
Modules/python.c.

The problem with importexc.c is more serious; I've filled issue3723 for
this.

--
nosy: +amaury.forgeotdarc
priority:  -> high

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3723] Py_NewInterpreter does not work

2008-08-29 Thread Amaury Forgeot d'Arc

New submission from Amaury Forgeot d'Arc <[EMAIL PROTECTED]>:

The example Demo/embed/importexc.c crashes, because Py_NewInterpreter
cannot reimport builtins and sys modules. This problem seems important
for embedding applications like mod_python, for example.

(the "import exceptions" statement does not work with python 3.0, but
replacing with e.g. "import types" does not change anything: the
interpreter is not correctly renewed)

I tried to put "-1" in the m_size structure of these modules, and they
seem to import correctly. However, "builtins" comes with its original
dictionary - without the standard exceptions.

I think that these modules should be made re-importable, with specific
functions.

Maybe two related problems:
- once you've done
del sys.modules['sys']
it's not possible to get it back, "import sys" raises an error...

- the usual trick to call sys.setdefaultencoding will not work, since it
needs to "imp.reload(sys)"

--
components: Extension Modules
messages: 72127
nosy: amaury.forgeotdarc, loewis
priority: release blocker
severity: normal
status: open
title: Py_NewInterpreter does not work
versions: Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3668] "s*" argument parser marker leaks memory

2008-08-29 Thread Amaury Forgeot d'Arc

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

Yes, let them go in!

--
resolution:  -> accepted

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3722] print followed by exception eats print with doctest

2008-08-29 Thread Chris Withers

Chris Withers <[EMAIL PROTECTED]> added the comment:

Here's the full test file.

Added file: http://bugs.python.org/file11301/doctestbug.py

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3722] print followed by exception eats print with doctest

2008-08-29 Thread Chris Withers

New submission from Chris Withers <[EMAIL PROTECTED]>:

Here's an example from a python interpreter session:

Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> def test():
... print "hello"
... raise Exception()
...
 >>> test()
hello
Traceback (most recent call last):
   File "", line 1, in ?
   File "", line 3, in test
Exception

Now, turning this into a doctests gives:

"""
>>> def test():
...   print "hello"
...   raise Exception()
...
>>> test()
hello
Traceback (most recent call last):
...
Exception
"""

Which when run gives:

**
File "C:\Projects\doctestbug.py", line 6, in __main__
Failed example:
test()
Exception raised:
Traceback (most recent call last):
  File "C:\Python25\lib\doctest.py", line 1212, in __run
compileflags, 1) in test.globs
  File "", line 1, in 
test()
  File "", line 3, in test
raise Exception()
Exception
**
1 items had failures:
   1 of   2 in __main__
***Test Failed*** 1 failures.

The problem is that the function prints output before raising the
exception. If I take the printed output away, the doctest passes fine.
However, especially with dummy fixtures common in doctests, that printed
output needs to be seen to test that things are happening as they should
prior to the exception being raised.

--
components: Library (Lib)
messages: 72124
nosy: cjw296
severity: normal
status: open
title: print followed by exception eats print with doctest
versions: Python 2.4, Python 2.5

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3668] "s*" argument parser marker leaks memory

2008-08-29 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Amaury, are these patches ok to check in?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3721] invalid literal for int() with base 16: ''

2008-08-29 Thread Amaury Forgeot d'Arc

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

This is already fixed in trunk. (see issue900744)
Can you try with a 2.6 version?

--
nosy: +amaury.forgeotdarc
resolution:  -> out of date
status: open -> pending

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3721] invalid literal for int() with base 16: ''

2008-08-29 Thread ivo

New submission from ivo <[EMAIL PROTECTED]>:

I tested metode urllib2.read() on 2000 web_pages and there was a
exception ValueError in only one case, here is short code:

import urllib2
req = urllib2.urlopen('http://www.peachbit.org/')
req.read()


Traceback (most recent call last):
  File "httplib_bug.py", line 6, in 
req.read()
  File "/usr/lib/python2.5/socket.py", line 291, in read
data = self._sock.recv(recv_size)
  File "/usr/lib/python2.5/httplib.py", line 509, in read
return self._read_chunked(amt)
  File "/usr/lib/python2.5/httplib.py", line 548, in _read_chunked
chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: ''

--
components: Installation
messages: 72121
nosy: xhomol11
severity: normal
status: open
title: invalid literal for int() with base 16: ''
type: crash
versions: Python 2.5

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3611] invalid exception context

2008-08-29 Thread Amaury Forgeot d'Arc

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

Committed as r66056.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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