[issue2075] Float number comparision problem

2008-02-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

This is expected behavior. Please see 
http://www.python.org/doc/faq/general/#why-are-floating-point-calculations-so-inaccurate

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

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2075
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-02-12 Thread Jean-Philippe Laverdure

Changes by Jean-Philippe Laverdure:


--
components: +Library (Lib) -Extension Modules
versions: +Python 2.4

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2078
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2065] trunk version does not compile with vs8 and vc6

2008-02-12 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Ithink this patch still conflicts with issue 1763 - SHGetFolderPathW is
(apparently) only available on W2k. So I don't see why we *shouldn't*
mandate W2k-or-better platform headers. VC6 users should install the W2k
SDK, or the W2k3 SDK (or any later SDK that still supports VC6).

--
nosy: +loewis

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2065
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2090] __import__ with fromlist=[''] causes double initialization of modules

2008-02-12 Thread hauser

New submission from hauser:

This construction:

__import__( 'pkg', {}, {}, [''] )

Will cause double initialization of package 'pkg', once with name 'pkg'
and second one with name 'pkg.' (trailing dot). Implementation tries to
import subpackage of 'pkg' with empty name, and imports the same package
twice.

This kind of construction is used as a hacky way to obtain exact module
instead of top-level module in return value. It is a hack, but should
not cause this kind of side effects.

--
components: Interpreter Core
files: empty_import.tgz
messages: 62333
nosy: hauser
severity: minor
status: open
title: __import__ with fromlist=[''] causes double initialization of modules
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file9420/empty_import.tgz

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2090
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2091] file accepts 'rU+' as a mode

2008-02-12 Thread Brett Cannon

New submission from Brett Cannon:

The docs on file's constructor says that the 'U' mode should not work
with '+', and yet 'rU+' does not throw an error.

--
components: Interpreter Core
messages: 62343
nosy: brett.cannon
severity: normal
status: open
title: file accepts 'rU+' as a mode
type: behavior
versions: Python 2.5, Python 2.6

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2091
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1682] Move Demo/classes/Rat.py to Lib/fractions.py and fix it up.

2008-02-12 Thread Nick Coghlan

Nick Coghlan added the comment:

Thanks for adding the class methods back Mark.

On the constructor front, we got a fair payoff in the early Decimal days
just by reordering the type checks in the constructor. Other than that,
I'd have to dig into the code a bit more to offer any useful suggestions.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1682
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2065] trunk version does not compile with vs8 and vc6

2008-02-12 Thread Christian Heimes

Christian Heimes added the comment:

Amaury Forgeot d'Arc wrote:
 Is it permitted to allow python compile with older compilers, even with
 some functions missing?

When a user compiles her own Python binary she is most probably
experienced enough to notice the difference. We can't hold the hand of
every user who strolls off the official path. New features was one of
reasons for the migration to VS 2008. Legacy support shouldn't stop us
from introducing new features.

So yes, it's permitted to build Python with old compilers but users must
not expect full support of all features.

Christian

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2065
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2013] Long object free list optimization

2008-02-12 Thread Christian Heimes

Christian Heimes added the comment:

Antoine Pitrou wrote:
 Christian, maybe you did your measurements with the DEBUG flag turned
 on? That would explain the discrepancy.
 
 Also, I'm not sure the patch is useful for 2.x since long objects with
 size -1 or 1 should be represented as ints instead :-)

Yes, I've used a Py_Debug build to measure the speed difference.

You are right. The patch makes no sense for the 2.x series.

Christian

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2013
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1682] Move Demo/classes/Rat.py to Lib/fractions.py and fix it up.

2008-02-12 Thread Mark Dickinson

Mark Dickinson added the comment:

 BTW I think the next goal should be to reduce the cost of constructing
 a Fraction out of to plain ints by at least an order of magnitude. I
 believe this is possible.

I certainly hope so!  Here's a very simple (and simplistic) benchmark:

# start benchmark

from fractions import Fraction
from cProfile import run

def test1():
return sum(Fraction(1, n*n-1) for n in xrange(2, 10))

run(test1())

#end benchmark

On my MacBook this reports a total time of 38.072 seconds, with 22.731 of 
those (i.e. around 60%) being spent in abc.__instancecheck__ and its 
callees.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1682
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1682] Move Demo/classes/Rat.py to Lib/fractions.py and fix it up.

2008-02-12 Thread Mark Dickinson

Mark Dickinson added the comment:

limit_denominator implemented in r60752
from_decimal and from_float restored to classmethods in r60754

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1682
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2065] trunk version does not compile with vs8 and vc6

2008-02-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Is it permitted to allow python compile with older compilers, even with
some functions missing?

This patch already skips some functions not included with VC6:
socket.ioctl, msvcrt.getwch co.
Even socket.RCVALL_IPLEVEL is not available on my installation of VS8
(Professional Edition).

Even if the result is only a subset of the official python (as shown
when running the test suite), it may still be useful, when embedded in
legacy applications for example, where installing a new SDK is not
always possible.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2065
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2085] Syntax for property set method

2008-02-12 Thread Georg Brandl

Georg Brandl added the comment:

First, syntax proposals for 3.0 are no longer accepted.
Second, this sort of proposal should be discussed on the python-ideas
mailing list first.
Third, this is really ugly :)

So, closing this.

--
nosy: +georg.brandl
resolution:  - rejected
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2085
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1943] improved allocation of PyUnicode objects

2008-02-12 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Here is an updated patch against the current py3k branch, and with
spaces instead of tabs for indentation.

Added file: http://bugs.python.org/file9419/unialloc2.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1943
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1390] toxml generates output that is not well formed

2008-02-12 Thread Thomas Conway

Thomas Conway added the comment:

On Feb 13, 2008 6:27 AM, Virgil Dupras [EMAIL PROTECTED] wrote:
 CDATASection.writexml() already raises ValueError when finding invalid data,
 so it seems consistent to me to extend the behavior to Comment.writexml()

That looks fine to me.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1390
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1390] toxml generates output that is not well formed

2008-02-12 Thread Virgil Dupras

Virgil Dupras added the comment:

I wanted to start contributing to python for quite a while, so here's my very 
first try (cleaning out old patchless open tickets).

So, whatever is the final decision on this, here's a patch.

CDATASection.writexml() already raises ValueError when finding invalid data, 
so it seems consistent to me to extend the behavior to Comment.writexml()

note: I can't add the patch keyword myself?

--
nosy: +vdupras
Added file: http://bugs.python.org/file9418/minidom_comment.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1390
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1595] Probable extra semicolon in Py_LeaveRecursiveCall macro

2008-02-12 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Thanks again for pointing that out. Fixed in r60750.

--
resolution:  - fixed
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1595
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1652] subprocess should have an option to restore SIGPIPE to default action

2008-02-12 Thread Martin v. Löwis

Martin v. Löwis added the comment:

The patch as it stands (subprocess-sigpipe.patch) definitely can't go
into 2.5.x: it introduces a new feature.

It's not clear to me whether Colin intended to target it for 2.5.x, as
it is against the trunk. For the trunk, the patch is fine.

Regargeting for 2.6. Colin, if that wasn't your intention, please speak up.

--
assignee: loewis - 
priority: high - normal
versions: +Python 2.6 -Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1652
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1966] infinite loop in httplib

2008-02-12 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Thanks for the patch. Committed as r60747 and r60748.

--
resolution:  - accepted
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1966
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2016] Crash when modifying the **kwargs passed to a function.

2008-02-12 Thread Martin v. Löwis

Martin v. Löwis added the comment:

I think we agree that this patch has the potential of breaking existing
valid code. So based on the policy that we should avoid doing so in a
bugfix release, I'd rather reject that fix (fix2016.txt) for 2.5.x.
OTOH, if it is really unlikely that is ever occurs in existing code,
there would be no point in backporting it to 2.5.x, since the check
wouldn't trigger. 

I also can't see a security concern - applications shouldn't pass
untrusted objects as keyword arguments (if they were, such objects could
 put their malicious code inside __hash__).

--
assignee: loewis - 
priority: high - normal

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2016
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2092] PEP-3100 should reflect removal of 'cmp' parameter in sort() and sorted()

2008-02-12 Thread Kurt B. Kaiser

New submission from Kurt B. Kaiser:

Document the decision to remove the comparision ('cmp') 
parameter from list.sort() and builtin.sorted()

--
assignee: rhettinger
components: Documentation
files: pep-3100.patch
messages: 62346
nosy: kbk, rhettinger
priority: normal
severity: normal
status: open
title: PEP-3100 should reflect removal of 'cmp' parameter in sort() and sorted()
versions: Python 3.0
Added file: http://bugs.python.org/file9422/pep-3100.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2092
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1682] Move Demo/classes/Rat.py to Lib/fractions.py and fix it up.

2008-02-12 Thread Guido van Rossum

Guido van Rossum added the comment:

 Okay, Nick; you've got me convinced.  For some reason I wasn't really
 thinking of these methods as alternative constructors---in this light,
 your arguments about doing the same as __new__, and about established
 patterns, make perfect sense.

 Looking back at the discussion, Jeffrey looked like he was +/-0 on the
 change, and Guido was answering a slightly different question (about
 __add__ instead of constructors);  I then took his answer out of context
 to justify the change  :(

 So I'll change this back unless there's further discussion.

Sounds good.

BTW I think the next goal should be to reduce the cost of constructing
a Fraction out of to plain ints by at least an order of magnitude. I
believe this is possible.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1682
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2079] UserDict documentation typo

2008-02-12 Thread Raymond Hettinger

Changes by Raymond Hettinger:


--
assignee:  - rhettinger
nosy: +rhettinger

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2079
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2096] Reporting bugs page refers to old site

2008-02-12 Thread Yinon Ehrlich

New submission from Yinon Ehrlich:

http://www.python.org/doc/ext/reporting-bugs.html refers to
http://sourceforge.net/bugs/?group_id=5470 instead  of
http://bugs.python.org

--
components: Documentation
messages: 62347
nosy: Yinon
severity: minor
status: open
title: Reporting bugs page refers to old site
versions: Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2096
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2065] trunk version does not compile with vs8 and vc6

2008-02-12 Thread Hirokazu Yamamoto

Changes by Hirokazu Yamamoto:


--
nosy: +ocean-city

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2065
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2097] typo in exception-handling tutorial

2008-02-12 Thread Yinon Ehrlich

New submission from Yinon Ehrlich:

At http://docs.python.org/tut/node10.html#SECTION001030
there is One my also instantiate instead of One may also instantiate

--
components: Documentation
messages: 62348
nosy: Yinon
severity: normal
status: open
title: typo in exception-handling tutorial
versions: Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2097
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2085] Syntax for property set method

2008-02-12 Thread David W. Lambert

New submission from David W. Lambert:

# proposed syntax:
# object.property = *args,**kwargs

# python 3k could accept property setter with multiple arguments

class c:
def f(self,a,b,c):
print a,b,c
F=property(None,f)

c().F=*'hi',**{'c':'third setter argument'}

--
components: None
messages: 62323
nosy: LambertDW
severity: minor
status: open
title: Syntax for property set method
type: rfe
versions: Python 3.0

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2085
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2099] unclear error message on bug reporting

2008-02-12 Thread Yinon Ehrlich

New submission from Yinon Ehrlich:

When filing a new bug on http://bugs.python.org/issue and not filling
the Change Note the following message appears: Error: list index out
of range... instead of please fill the change notes or something alike...

--
messages: 62349
nosy: Yinon
severity: normal
status: open
title: unclear error message on bug reporting
versions: Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2099
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1777134] minidom pretty xml output improvement

2008-02-12 Thread John-Mark Gurney

John-Mark Gurney added the comment:

I think this is a good patch.  It gives more useful pretty XML output. 
I would suggest that possibly this routine be moved to xml.dom or
xml.dom.utils instead of being part of minidom since it should not be
minidom specific.

There is one bug in the patch in that:
node.writexml(writer, (%s%s) % (indent,addindent)

the parens around the %s%s should be quotes instead.

--
nosy: +jmg

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1777134
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2065] trunk version does not compile with vs8 and vc6

2008-02-12 Thread Martin v. Löwis

Martin v. Löwis added the comment:

 Is it permitted to allow python compile with older compilers, even with
 some functions missing?

It's certainly ok that Python may not have some functions on some
system. Even though there might not be any precedence, I think this
extends to some compilers on the same system.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2065
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1866] const arg for PyInt_FromString

2008-02-12 Thread phil

phil added the comment:

Ok.  Ran 'make test' before and after patch.  Output identical. 
Attaching output after patch.

Added file: http://bugs.python.org/file9417/make_test_after

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1866
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1682] Move Demo/classes/Rat.py to Lib/fractions.py and fix it up.

2008-02-12 Thread Mark Dickinson

Mark Dickinson added the comment:

Okay, Nick; you've got me convinced.  For some reason I wasn't really 
thinking of these methods as alternative constructors---in this light, 
your arguments about doing the same as __new__, and about established 
patterns, make perfect sense.

Looking back at the discussion, Jeffrey looked like he was +/-0 on the 
change, and Guido was answering a slightly different question (about 
__add__ instead of constructors);  I then took his answer out of context 
to justify the change  :(

So I'll change this back unless there's further discussion.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1682
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1682] Move Demo/classes/Rat.py to Lib/fractions.py and fix it up.

2008-02-12 Thread Mark Dickinson

Mark Dickinson added the comment:

Nick Coghlan wrote:
 I mentioned my dislike of the classmethod-staticmethod change on the
 python-checkins list, but given the lack of response there, I figure I
 should bring it up here.

Yes, I missed it.  Apologies.  I'll rethink this (and likely-as-not 
revert it, but I want to get my head around the issues first).

One problem I'm having is imagining any real-life examples of subclasses 
of Rational.  An example or two might help inform the discussion.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1682
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2065] trunk version does not compile with vs8 and vc6

2008-02-12 Thread Hirokazu Yamamoto

Hirokazu Yamamoto added the comment:

I tried PSDK Feb 2003 downloadable from
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm
and this two issues went away.

- When WINVER is set to 0x500, vc6 gives a long warning because at the
time, windows nt 5.0 was only at beta stage. Moreover, there are other
clashes between winsock.h and winsock2.h, that show up when WINVER is
0x500.

Next, I tried to compile Modules/socketmodule.h's _MSC_VER = 1300 part
but this didn't work.

#if _MSC_VER = 1300
# include winsock2.h
# include ws2tcpip.h
# include MSTcpIP.h /* for SIO_RCVALL */
# define HAVE_ADDRINFO
# define HAVE_SOCKADDR_STORAGE
# define HAVE_GETADDRINFO
# define HAVE_GETNAMEINFO
# define ENABLE_IPV6
#else
# include winsock.h
#endif

I didn't investigate too much, but it seems
#include windows.h
#include winsock2.h
causes another conflicts between winsock.h and winsock2.h
this time.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2065
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2001] Pydoc interactive browsing enhancement

2008-02-12 Thread Ron Adam

Ron Adam added the comment:

Added a topics and keywords index choices to the navbar.

This gives the web interface the same functionality as the cli interface.

Fixed the -p option which I had missed.

Added file: http://bugs.python.org/file9423/pydocnotk.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2001
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2013] Long object free list optimization

2008-02-12 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I don't get the same impressive speedup as you do, although it's still
significant.

$ ./python -m timeit for i in range(100): list(range(1000))
Without patch:
100 loops, best of 3: 5.05 msec per loop
With patch:
100 loops, best of 3: 3.57 msec per loop

Also, your patch is leaky. I'm attaching a fixed version (for py3k,
didn't check the trunk version).

--
nosy: +pitrou
Added file: http://bugs.python.org/file9421/py3k_longfreelist2.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2013
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-02-12 Thread Jean-Philippe Laverdure

New submission from Jean-Philippe Laverdure:

When attempting to sniff() the dialect for the attached .csv file,
csv.Sniffer.sniff() returns an unusable dialect:

 import csv
 file = open('listB2Mforblast.csv', 'r')
 dialect = csv.Sniffer().sniff(file.readline())
 file.seek(0)
 file.readline()
 file.seek(0)
 reader = csv.DictReader(file, dialect)
 reader.next()
Traceback (most recent call last):
  File stdin, line 1, in module
  File /soft/bioinfo/linux/python-2.5/lib/python2.5/csv.py, line 93,
in next
d = dict(zip(self.fieldnames, row))
TypeError: zip argument #1 must support iteration

However, this works fine:
 file.seek(0)
 reader = csv.DictReader(file)
 reader.next()
{'Sequence': 'AALENTHLL'}

If I use a 2 column file, sniff() works perfectly.
It only seems to have a problem with single column .csv files (which are
still .csv files in my opinion)

Thanks for looking into this.

--
components: Extension Modules
files: listB2Mforblast.csv
messages: 62319
nosy: jplaverdure
severity: normal
status: open
title: CSV Sniffer does not function properly on single column .csv files
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file9416/listB2Mforblast.csv

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2078
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2063] os.times() utime and stime exchanged on windows

2008-02-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

As a suggestion, we could just run some computation that does no system
call:

 import os
 os.times()
(0.015625, 0.015625, 0.0, 0.0, 0.0)
 max(xrange(1000))   # this takes half a second on my machine
999
 os.times()
(0.015625, 0.484375, 0.0, 0.0, 0.0)

utime delta should be much higher than stime delta. This is obviously
not the case here; the values seems inverted.
   (os.times() - (utime, stime, cutime, cstime, elapsed_time))

--
nosy: +amaury.forgeotdarc

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2063
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2077] Interpreter crash on shutdown

2008-02-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

This seems to be another incarnation of issue1856.
See also issue1193099, which shows the same backtrace on Windows.

--
nosy: +amaury.forgeotdarc
resolution:  - duplicate
status: open - pending

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2077
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1193099] Embedded python thread crashes

2008-02-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

This is a duplicate of issue1856: while a thread is sleeping,
Py_Finalize() deallocates the thread's frame. During deallocation the
thread wakes up and boom.

--
nosy: +amaury.forgeotdarc
resolution:  - duplicate
status: open - closed

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1193099
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1682] Move Demo/classes/Rat.py to Lib/fractions.py and fix it up.

2008-02-12 Thread Nick Coghlan

Nick Coghlan added the comment:

I mentioned my dislike of the classmethod-staticmethod change on the
python-checkins list, but given the lack of response there, I figure I
should bring it up here. It is well established that the way to
implement an alternate constructor in Python is to write a classmethod.
This means the alternate constructor will behave in a way similar to
__new__: invocation via a subclass will result in an instance of that
subclass rather than of the base type.

Now, this does usually mean the parent class is placing certain
expectations on the signature of the subclass constructor. However, this
is a pretty common Python idiom, and a lot friendlier than coercing the
result to the base type. It makes the common case (constructor signature
unchanged or at least compatible) simple, while still permitting the
rarer case of changing the signature in an incompatible way (by
overriding the class methods as well as the __new__ and __init__ methods)

If you want to make this more convenient for users that do want to
subclass and change the constructor signature, the expected interface
can be factored out to a single method, similar to the way it is done
for collections.Set and its _from_iterable class method (i.e. if a Set
subclass constructor doesn't accept an iterable directly, it can just
override _from_iterable to adapt the supplied iterable to the new
interface).

--
nosy: +ncoghlan

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1682
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2077] Interpreter crash on shutdown

2008-02-12 Thread Rupert Summerton

New submission from Rupert Summerton:

1. Description: The Python interpretor is crashing on shutdown due to a
segmentation fault:

Unhandled exception at 0x1e03d41f in python.exe: 0xC005: Access
violation reading location 0x002c.

2. Reproducibility: At least 10% on Windows XP Professional SP2, P4
3.20GHz, 2.00GB RAM, when running the attached module, threadpool.py.
(Running with Python 2.5.1). Unfortunately I cannot get the attached
test case to crash on Linux or Solaris. However, executing this code as
part of our Python test framework (see context below), with Python
2.4.1, what looks like the same crash produced the following backtrace:

#0  reset_exc_info (tstate=0x8254458) at
/tools/src/python/python-2.4.1/Python/ceval.c:2861
tstate = (PyThreadState *) 0x8254458
frame = (PyFrameObject *) 0x0
tmp_type = (PyObject *) 0x82a3a18
tmp_value = (PyObject *) 0x0
tmp_tb = (PyObject *) 0x2
#1  0x080a9b56 in PyEval_EvalFrame (f=0x82a38ac) at
/tools/src/python/python-2.4.1/Python/ceval.c:2490
stack_pointer = (PyObject **) 0x82a3a18
next_instr = (unsigned char *) 0x81d4f1e 
opcode = 136660056
oparg = 0
why = WHY_RETURN
err = 0
x = (PyObject *) 0x810d940
v = (PyObject *) 0x81d4f1e
w = (PyObject *) 0xf6462fc0
u = (PyObject *) 0xf642ec50
t = (PyObject *) 0x0
stream = (PyObject *) 0x0
fastlocals = (PyObject **) 0x82a39f8
freevars = (PyObject **) 0x82a3a18
retval = (PyObject *) 0x810d940
tstate = (PyThreadState *) 0x8254458
co = (PyCodeObject *) 0xf6134c60
instr_ub = -1
instr_lb = 0
instr_prev = -1
first_instr = (unsigned char *) 0x81d4d9c |
names = (PyObject *) 0xf63d762c
consts = (PyObject *) 0xf6134c2c
#2  0x080aa263 in PyEval_EvalCodeEx (co=0xf6134c60, globals=0xf6075824,
locals=0x0, args=0x82c1080, argcount=2, kws=0x82c1088, kwcount=0,
defs=0xf6414298, 
defcount=1, closure=0x0) at
/tools/src/python/python-2.4.1/Python/ceval.c:2730
co = (PyCodeObject *) 0xf6134c60
globals = (PyObject *) 0x8254458
locals = (PyObject *) 0x82a38ac
args = (PyObject **) 0x82c1080
argcount = 2
kws = (PyObject **) 0x82c1088
kwcount = 0
defs = (PyObject **) 0xf6414298
defcount = 1
closure = (PyObject *) 0x0
f = (PyFrameObject *) 0x82a38ac
retval = (PyObject *) 0x0
fastlocals = (PyObject **) 0x82a39f8
freevars = (PyObject **) 0x82a3a18
tstate = (PyThreadState *) 0x8254458
x = (PyObject *) 0x82a38ac
u = (PyObject *) 0x82a38ac
#3  0x080acda7 in fast_function (func=0xf613e8b4, pp_stack=0xe951f3dc,
n=2, na=2, nk=0) at /tools/src/python/python-2.4.1/Python/ceval.c:3643
func = (PyObject *) 0x82a38ac
co = (PyCodeObject *) 0x8254458
globals = (PyObject *) 0xf6075824
argdefs = (PyObject *) 0x8254458
d = (PyObject **) 0xf6414298
nd = 1
#4  0x080ab08a in call_function (pp_stack=0xe951f3dc, oparg=1) at
/tools/src/python/python-2.4.1/Python/ceval.c:3568
oparg = 136660056
na = 2
nk = 0
n = 2
pfunc = (PyObject **) 0x82c1080
func = (PyObject *) 0xf613e8b4
x = (PyObject *) 0x8172f54
w = (PyObject *) 0x82a38ac
#5  0x080a9338 in PyEval_EvalFrame (f=0x82c0f1c) at
/tools/src/python/python-2.4.1/Python/ceval.c:2163
sp = (PyObject **) 0x82c1088
stack_pointer = (PyObject **) 0x82c1088
next_instr = (unsigned char *) 0x81f58cc \001q\225
opcode = 136660056
oparg = 1
why = WHY_NOT
err = 0
x = (PyObject *) 0x82a37ec
v = (PyObject *) 0x81f58cc
w = (PyObject *) 0xf6444de0
u = (PyObject *) 0xf642ec50
t = (PyObject *) 0x1
stream = (PyObject *) 0x0
fastlocals = (PyObject **) 0x82c1068
freevars = (PyObject **) 0x82c1080
retval = (PyObject *) 0x0
tstate = (PyThreadState *) 0x8254458
co = (PyCodeObject *) 0xf618c920
instr_ub = -1
instr_lb = 0
instr_prev = -1
first_instr = (unsigned char *) 0x81f57f4 |
names = (PyObject *) 0xf63a484c
consts = (PyObject *) 0xf6164a1c
#6  0x080aa263 in PyEval_EvalCodeEx (co=0xf618c920, globals=0xf5d658ac,
locals=0x0, args=0x827d690, argcount=1, kws=0x827d694, kwcount=1,
defs=0xf5d77e78, 
defcount=2, closure=0x0) at
/tools/src/python/python-2.4.1/Python/ceval.c:2730
co = (PyCodeObject *) 0xf618c920
globals = (PyObject *) 0x8254458
locals = (PyObject *) 0x82a38ac
args = (PyObject **) 0x8136f18
argcount = 1
kws = (PyObject **) 0x827d694
kwcount = 1
defs = (PyObject **) 0xf5d77e78
defcount = 2
closure = (PyObject *) 0x0
f = (PyFrameObject *) 0x82c0f1c
retval = (PyObject *) 0x0

[issue2076] xmlrpclib closes connection after each call

2008-02-12 Thread Erno Kuusela

New submission from Erno Kuusela:

xmlrpclib is using the old HTTP and HTTPS classes from httplib which are
to quote the docstring, Compatibility classes with httplib.py from 1.5.
and force the use of HTTP 1.0. This prevents connection reuse and
pipelining.

Attacked is some code we are using as a workaround.

Is the xmlrpclib in the standard library required to keep compatibility
with old python versions?

--
components: Library (Lib)
files: transport.py
messages: 62309
nosy: erno
severity: normal
status: open
title: xmlrpclib closes connection after each call
versions: Python 2.5
Added file: http://bugs.python.org/file9414/transport.py

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2076
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2063] os.times() utime and stime exchanged on windows

2008-02-12 Thread Georg Brandl

Georg Brandl added the comment:

Fixed on trunk in r60758. Should this be backported?

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

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2063
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1866] const arg for PyInt_FromString

2008-02-12 Thread Nick Coghlan

Nick Coghlan added the comment:

The test suite is run via test/regrtest.py. If you aren't on windows,
'make test' works as well.

For myself, I tend to just run ./python -m test.regrtest in the
directory where I built Python.

--
nosy: +ncoghlan

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1866
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2063] os.times() utime and stime exchanged on windows

2008-02-12 Thread Facundo Batista

Facundo Batista added the comment:

How can we test it? What can we do to see it?

--
nosy: +facundobatista

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2063
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1736] Three bugs of FCICreate (PC/_msi.c)

2008-02-12 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Thanks for the patch. Committed as r60743 and r60744.

--
resolution:  - accepted
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1736
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2079] UserDict documentation typo

2008-02-12 Thread Gabriel Sean Farrell

New submission from Gabriel Sean Farrell:

2nd paragraph of documentation at
http://docs.python.org/lib/module-UserDict.html should read as follows:

This module also defines a class...

The also is out of place.

--
components: Documentation
messages: 62322
nosy: gsf
severity: minor
status: open
title: UserDict documentation typo
versions: Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2079
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com