[issue870807] optparse int, long types support binary, octal and hex forma

2008-01-31 Thread Ralf Schmitt

Ralf Schmitt added the comment:

python trunk supports this. please close.

--
nosy: +schmir


Tracker <[EMAIL PROTECTED]>


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



[issue1545463] New-style classes fail to cleanup attributes

2008-01-31 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

In PyImport_Cleanup(), sys and __builtin__ are the last ones deleted.
What if PyGC_Collect() is called just before?

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



[issue870807] optparse int, long types support binary, octal and hex forma

2008-01-31 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc:


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



[issue1014230] optparse: parser.remove_option("-h") inconsistency

2008-01-31 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc:


--
resolution:  -> out of date
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



[issue1976] pybsddb leak in using cursors

2008-01-31 Thread Jesús Cea Avión

Jesús Cea Avión added the comment:

Seems to be a leak when a cursor is used in a database without an
environment. Working on this...

__
Tracker <[EMAIL PROTECTED]>

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



[issue1976] pybsddb leak in using cursors

2008-01-31 Thread Jesús Cea Avión

Jesús Cea Avión added the comment:

Memory leak solved. Commit 293 in Sourceforge

__
Tracker <[EMAIL PROTECTED]>

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



[issue1515] deepcopy doesn't copy instance methods

2008-01-31 Thread Dmitrey

Dmitrey added the comment:

Hallo, I' developer of the OpenOpt, free Python-based numerical
optimization framework. 

Please don't you mind me to increase Severity of the bug to major. This
bug is driving me mad, as well as some of OO users, and makes OO usage
much less convenient and obvious.

http://openopt.blogspot.com/2008/01/about-prob-structure-redefinition.html

--
nosy: +Dmitrey
severity: normal -> major

__
Tracker <[EMAIL PROTECTED]>

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



[issue1979] Make Decimal comparisons with NaN less arbitrary

2008-01-31 Thread Mark Dickinson

Mark Dickinson added the comment:

Yes, I think it's necessary.

Speaking of standards, it's the current behavior which isn't backed by any 
standard or rationale other than the historical one involving now-defunct 3-
way comparisons.

The proposed behavior is much closer to that specified by C99 (see sections 
7.12.14 and section F.3) and by IEEE 754 and its upcoming revision (see 
section 5.11 of the most recent draft, which is linked to from the wikipedia 
page for IEEE 754r).  Even better from a standards-compliance perspective 
would be to have all comparisons except != involving NaNs raise the 
InvalidOperation flag.

The current behavior also breaks something fundamental:  namely, that x < y 
should have the same truth value as y > x.  Python even depends on this for 
reversing comparison operators, which explains, but in my opinion doesn't 
excuse, the following oddity:

>>> 2 < Decimal("NaN")
True
>>> Decimal(2) < Decimal("NaN")
False

__
Tracker <[EMAIL PROTECTED]>

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



[issue1977] Python reinitialization test

2008-01-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Perhaps ROUNDS, CAUSE_SEGFAULT and VERBOSE could be command-line rather
than compile-time options?

--
nosy: +pitrou

__
Tracker <[EMAIL PROTECTED]>

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



[issue1980] pdb losing __file__

2008-01-31 Thread Erno Kuusela

New submission from Erno Kuusela:

under pdb, __file__ is not defined when executing a source code file
directly.

for example, if myprogram.py contains "print __file__", a NameError will
be raised when run with python -m pdb myprogram.py.

--
components: Library (Lib)
messages: 61896
nosy: erno
severity: normal
status: open
title: pdb losing __file__
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



[issue1482] IMAP4 SSL isn't working

2008-01-31 Thread David Binger

David Binger added the comment:

Bill's patch does appear to fix the ssl-related problem.

imaplib is still broken in py3k, though, due
to bytes/str issues.

--
nosy: +dbinger

__
Tracker <[EMAIL PROTECTED]>

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



[issue1980] pdb losing __file__

2008-01-31 Thread Christian Heimes

Christian Heimes added the comment:

The issue is already fixed in the 2.5 and 2.6. 2.5.2 is going to be
released in a couple of weeks.

$ python2.5 test.py
> /home/heimes/dev/python/trunk/test.py(4)()
-> print __file__
(Pdb) n
test.py
--Return--
> /home/heimes/dev/python/trunk/test.py(4)()->None
-> print __file__
(Pdb) n

--
nosy: +tiran
resolution:  -> out of date
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



[issue1979] Make Decimal comparisons with NaN less arbitrary

2008-01-31 Thread Christian Heimes

Changes by Christian Heimes:


--
nosy: +tiran
priority:  -> normal

__
Tracker <[EMAIL PROTECTED]>

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



[issue1977] Python reinitialization test

2008-01-31 Thread Christian Heimes

Christian Heimes added the comment:

I like to keep the test as simple as possible.

Here is a new file that shows Python crashes in the third Py_Finalize().

Added file: http://bugs.python.org/file9339/test_reinit.c

__
Tracker <[EMAIL PROTECTED]>

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



[issue1515] deepcopy doesn't copy instance methods

2008-01-31 Thread Christian Heimes

Christian Heimes added the comment:

I'm bumping up the version number to 2.6. Python 2.5 is in maintenance
mode and the behavior of deepcopy for instance methods won't be changed.

--
components: +Library (Lib)
priority:  -> normal
versions: +Python 2.6 -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



[issue1515] deepcopy doesn't copy instance methods

2008-01-31 Thread Christian Heimes

Christian Heimes added the comment:

I've read your blog. You don't have to modify the Python core:

import copy
import types

def _deepcopy_method(x, memo):
return type(x)(x.im_func, deepcopy(x.im_self, memo), x.im_class)
copy._deepcopy_dispatch[types.MethodType] = _deepcopy_method

I still wonder why you have to use deepcopy in your app.

--
nosy: +tiran

__
Tracker <[EMAIL PROTECTED]>

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



[issue799088] distutils ignored LDFLAGS in Makefile

2008-01-31 Thread Raghuram Devarakonda

Changes by Raghuram Devarakonda:


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



[issue800929] Module-specific PDFs

2008-01-31 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

Yet another one.

--
nosy: +draghuram, georg.brandl


Tracker <[EMAIL PROTECTED]>


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



[issue800926] Python version numbers in headers/footers PDF documentation

2008-01-31 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

Not really sure if this applies to new docs. I will let Georg close this
one :-).

--
nosy: +draghuram, georg.brandl


Tracker <[EMAIL PROTECTED]>


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



[issue1977] Python reinitialization test

2008-01-31 Thread Christian Heimes

Christian Heimes added the comment:

If fixed the problem with multiple reinitialization in r60477. It took
me quite some time to find the right spot.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1981] operator "is"

2008-01-31 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

It's actually documented in
http://docs.python.org/dev/reference/datamodel.html

"""
Note that the transformation from function object to (unbound or bound)
method object happens each time the attribute is retrieved from the
class or instance
"""

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



[issue1981] operator "is"

2008-01-31 Thread Georg Brandl

Georg Brandl added the comment:

Yes, it is expected since the descriptor access to methods creates a new
bound method object every time. The "is" operator does not work special
with methods.

There is another issue about documenting this, so closing as a duplicate.

--
nosy: +georg.brandl
resolution:  -> duplicate
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



[issue1981] operator "is"

2008-01-31 Thread Alexander Shigin

New submission from Alexander Shigin:

Hello,

The operator "is" works strange with methods, i.e.:

>>> a = 1
>>> a.__abs__ is a.__abs__
False

If this is the preferred behavior by some reasons, I think 
documentation should explain it.

It was tested on python 2.4.4, 2.5.1 and trunk r60477.

--
messages: 61905
nosy: shigin
severity: normal
status: open
title: operator "is"
type: behavior
versions: Python 2.4, 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



[issue1981] operator "is"

2008-01-31 Thread Alexander Shigin

Alexander Shigin added the comment:

I think it's good idea to make a note in Comparisons section or make 
some reference to data model section.

"""
The operators is and is not test for object identity: x is y is true if 
and only if x and y are the same object. x is not y yields the inverse 
truth value.
"""

But,
>>> id(a.__abs__) == id(a.__abs__)
True

And only example below shows me error in my objection.
>>> id(w)
6636344
>>> p = id(w)
>>> del w
>>> e = 1
>>> id(e)
6636344

I'm sorry for spam. I've missed Issue1410739 when search for any open 
bug.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1410739] Add notes to the manual about `is` and methods

2008-01-31 Thread Christian Heimes

Christian Heimes added the comment:

The example sure is surprising for somebody without intimate knowledge
about Python's memory management. Although the is operator is
implemented as id(a) == id(b) reference counting, free lists and arenas
can cause some surprising effects.

--
nosy: +tiran

_
Tracker <[EMAIL PROTECTED]>

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



[issue1515] deepcopy doesn't copy instance methods

2008-01-31 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm fine with applying Michael's suggestion to 2.6.

I're reverting the priority change though; using deepcopy is not OO and
IMO usually indicates that there's something wrong with your app.

--
severity: major -> normal

__
Tracker <[EMAIL PROTECTED]>

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



[issue1410739] Add notes to the manual about `is` and methods

2008-01-31 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

An even more surprising example:

>>> id([1]) == id([2])
True

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



[issue1941] 2.6 stdlib using with statement

2008-01-31 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Comments?

__
Tracker <[EMAIL PROTECTED]>

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



[issue1979] Make Decimal comparisons with NaN less arbitrary

2008-01-31 Thread Mark Dickinson

Mark Dickinson added the comment:

Here's a patch (richcmp_signal.patch) that gives an alternative way of doing 
things:  all 
<, <=, > and >= comparisons involving a NaN raise the InvalidOperation flag 
(using exactly 
the same semantics as those specified for compare_signal). == and != 
comparisons always 
return False and True, respectively, just as they do now.

So the post-patch decimal exactly follows IEEE 754(r) on this.  I think it 
makes good sense 
from a user's viewpoint, too:  with the default settings, any <, <=, > or >= 
comparison 
involving a NaN raises a Python exception; this seems like the best outcome for 
a beginning 
Decimal user, while expert users can choose to use the public compare or 
compare_signal 
methods instead.

My worries about list membership testing were nonsensical:  there's only one 
reasonable 
behaviour for == and !=, namely the current behavior, which also matches all 
the standards.

On balance, I think I prefer this approach to the idea of returning False on 
comparisons 
involving NaNs.  The only fly in the ointment is that floats and Decimals 
behave 
differently in this respect.

Added file: http://bugs.python.org/file9340/richcmp_signal.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue1941] 2.6 stdlib using with statement

2008-01-31 Thread Thomas Heller

Thomas Heller added the comment:

Lib/platform.py contains this notice at the top:

#This module is maintained by Marc-Andre Lemburg <[EMAIL PROTECTED]>.
#If you find problems, please submit bug reports/patches via the
#Python SourceForge Project Page and assign them to "lemburg".
#
#Note: Please keep this module compatible to Python 1.5.2.

I didn't look into the other modules in the patch.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1968] Unused number magic methods leaked into Py2.6

2008-01-31 Thread Jeffrey Yasskin

Jeffrey Yasskin added the comment:

Done in r60480.

--
resolution: accepted -> 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



[issue1941] 2.6 stdlib using with statement

2008-01-31 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

Please remove the platform.py part of the patch. You can apply that to
Py3k, but not to the 2.x series.

--
nosy: +lemburg

__
Tracker <[EMAIL PROTECTED]>

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



[issue1482] IMAP4 SSL isn't working

2008-01-31 Thread Bill Janssen

Bill Janssen added the comment:

But that's issue 1210, which is still open.  David, do you want to
submit a patch for 1210?

Meanwhile, do we still need this issue to be open?

__
Tracker <[EMAIL PROTECTED]>

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



[issue1410739] Add notes to the manual about `is` and methods

2008-01-31 Thread Christian Heimes

Changes by Christian Heimes:


--
assignee: fdrake -> 
keywords: +easy
type:  -> rfe
versions: +Python 2.6 -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



[issue1515] deepcopy doesn't copy instance methods

2008-01-31 Thread Christian Heimes

Christian Heimes added the comment:

Since Guido accepted the proposal can you please provide a patch with at
least one unit test?

--
resolution:  -> accepted

__
Tracker <[EMAIL PROTECTED]>

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



[issue1976] pybsddb leak in using cursors

2008-01-31 Thread Martin v. Löwis

Martin v. Löwis added the comment:

jcea, can you please attach the actual patch to be reviewed to this
report? What is commit 293 in SourceForge?

__
Tracker <[EMAIL PROTECTED]>

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



[issue1976] pybsddb leak in using cursors

2008-01-31 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Greg, can you take a look?

--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith, loewis

__
Tracker <[EMAIL PROTECTED]>

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



[issue1210] imaplib does not run under Python 3

2008-01-31 Thread Bill Janssen

Bill Janssen added the comment:

IMAP doesn't really support multiple charsets (just looked at RFC 3501).
 There are two places where character sets other than ASCII is used. 
One is in the SEARCH command; there's an optional parameter which can
indicate that the search strings are in a non-ASCII character set.  The
other is in transmission of message literals (email messages) back and
forth.

So probably setting the default encoding at this level isn't quite
right, as you should definitely be reading raw bytes from the socket,
not characters, but it isn't too far off.  Looks like _command() needs a
bit of work (it shouldn't try to quote bytes, only strings), and the
documentation need to be improved, to say that non-ASCII search strings
and message bodies should be passed as bytes encoded according to the
specified CHARSET, but with those fixes it should work.  Assuming that
bytes are hashable in Python 3K.

--
nosy: +janssen

__
Tracker <[EMAIL PROTECTED]>

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



[issue1482] IMAP4 SSL isn't working

2008-01-31 Thread David Binger

David Binger added the comment:

On Jan 31, 2008, at 12:42 PM, Bill Janssen wrote:

>
> Bill Janssen added the comment:
>
> But that's issue 1210, which is still open.  David, do you want to
> submit a patch for 1210?

I see that you are correct that 1210 is the bytes/str issue.
I regret it, but I won't be able to supply a patch.

>
> Meanwhile, do we still need this issue to be open?

Unless I'm missing something, the patch "b" that you posted
has not been checked in.  I think the issue should remain
open until that happens.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1515] deepcopy doesn't copy instance methods

2008-01-31 Thread Dmitrey

Dmitrey added the comment:

I don't know did you mean it to me (as I've noticed from address) or no. 
I can hardly provide any help for fixing the bug, I'm not skilled enough 
in Python core files. Here's results of the proposition mentioned:

import copy
import types

def _deepcopy_method(x, memo):
return type(x)(x.im_func, deepcopy(x.im_self, memo), x.im_class)
copy._deepcopy_dispatch[types.MethodType] = _deepcopy_method

from scikits.openopt import NLP
p = NLP(lambda x: x**2, 1)
p3 = _deepcopy_method(p, None)

Traceback (most recent call last):
  File "test_deepcopy.py", line 10, in 
p3 = _deepcopy_method(p, None)
  File "test_deepcopy.py", line 5, in _deepcopy_method
return type(x)(x.im_func, deepcopy(x.im_self, memo), x.im_class)
AttributeError: NLP instance has no attribute 'im_func'

as for copy.py from Python core, it seems like the file has no 
"_deepcopy_method" function.

Users want to run r = p.solve(solverName) for several different solvers and 
same p instance. So it needs each time using
for sn in [solverName1, solverName2, ..., solverNameN]:
  p = NLP(dozens of params)
  p.somefiled.paramN+1 =valN+1
  p.somefiled.paramN+2 =valN+2
...
  r{i} = p.solve(sn)
while in my previous MATLAB version of the toolbox it looks just like:

(assign prob only once)
p = ooAssign(params)
for sn in [solverName1, solverName2, ..., solverNameN]
  r{i} = p.solve(sn)
end 

Christian Heimes wrote:
> Christian Heimes added the comment:
>
> Since Guido accepted the proposal can you please provide a patch with at
> least one unit test?
>
> --
> resolution:  -> accepted
>
> __
> Tracker <[EMAIL PROTECTED]>
> 
> __
>
>
>
>

__
Tracker <[EMAIL PROTECTED]>

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



[issue1982] Feature: extend strftime to accept milliseconds

2008-01-31 Thread Brett Cannon

Changes by Brett Cannon:


--
type:  -> rfe

__
Tracker <[EMAIL PROTECTED]>

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



[issue1982] Feature: extend strftime to accept milliseconds

2008-01-31 Thread Andreas Balogh

New submission from Andreas Balogh:

Currently serializing datetime objects into isoformat string is well
possible. The reverse process - parsing an isoformat string into a
datetime object - doesn't work due to the missing %-tag for the strftime
format string.

Proposal:
Add new tag to strftime like format strings allowing to print and parse
milliseconds.

--
components: Extension Modules
messages: 61924
nosy: asbalogh
severity: normal
status: open
title: Feature: extend strftime to accept milliseconds
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



[issue846388] Check for signals during regular expression matches

2008-01-31 Thread Guido van Rossum

Guido van Rossum added the comment:

I think this is worth backporting to 2.5.2.  This and r60054 are the
*only* differences between _sre.c in 2.5.2 and 2.6.


Tracker <[EMAIL PROTECTED]>


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



[issue1983] Return from fork() is pid_t, not int

2008-01-31 Thread Ryan Stutsman

New submission from Ryan Stutsman:

In current trunk (60097).  Return from fork is not int but pid_t. 
Treating this as an int causes total breakage on systems with 64-bit pids.

--
components: Library (Lib)
messages: 61926
nosy: stutsman
severity: normal
status: open
title: Return from fork() is pid_t, not int
versions: Python 2.6, 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



[issue1983] Return from fork() is pid_t, not int

2008-01-31 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Can you provide a patch? It would be good if it still worked on systems
that don't have pid_t (although we could also require pid_t and then see
what systems that breaks for).

Also, what systems use 64-bit pids?

--
nosy: +loewis

__
Tracker <[EMAIL PROTECTED]>

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



[issue1983] Return from fork() is pid_t, not int

2008-01-31 Thread Ryan Stutsman

Ryan Stutsman added the comment:

Yeah; I shuold be able to provide one.  I just hacked 2.4.4 to work so I
think I could provide a fix easily.  The version I put together here is
rough, so I'll try to create a cleaner solution tonight or this weekend.

HiStar does (http://www.scs.stanford.edu/histar/).

Not sure if it's better to test for pid_t (in configure) or just use a
long long value all around a punt the problem?  I'll probably just go
with the former unless there are objections.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1222] locale.format bug if thousand separator is space (french separator as example)

2008-01-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Here is a patch. It is fairly big and I'm sorry about it, here is why:
1. it reworks the test suite using unittest, and makes it more comprehensive
2. it adds a feature in locale.py which allows overriding the localeconv
dictionary (this is necessary for proper testing)
3. it fixes the present bug, and also fixes integer formatting with
grouping and padding (which was broken, as well as untested)

Point 2 above may be controversial, it is just a dictionary (by default
empty) named _override_localeconv, if you prefer we can make it a real
API, e.g. _set_localeconv().

Added file: http://bugs.python.org/file9341/1222.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue1982] Feature: extend strftime to accept milliseconds

2008-01-31 Thread Christian Heimes

Christian Heimes added the comment:

Your chances are going to increase if you can come up with a decent
patch. It's going to be harder than you might think. Python uses the
system's strftime function. You'd have to implement a strftime
replacement which supports miliseconds.

Can't you use another like TAI64
(http://cr.yp.to/libtai/tai64.html#tai64n) or JDN
(http://en.wikipedia.org/wiki/Julian_day) instead?

--
nosy: +tiran
priority:  -> normal
versions: +Python 2.6 -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



[issue1864] test_locale doesn't use unittest

2008-01-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

An improved version of this patch is now included in the proposed patch
for #1222 :)

__
Tracker <[EMAIL PROTECTED]>

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



[issue1983] Return from fork() is pid_t, not int

2008-01-31 Thread Christian Heimes

Christian Heimes added the comment:

It's probably better to use pid_t through the code and add a typedef int
pid_t for system's without pid_t. Or better typedef long pid_t?

On my Linux, pid_t is defined as __PID_T_TYPE, which is defines as
__S32_TYPE which ends up as int.

--
nosy: +tiran
priority:  -> normal
type:  -> behavior

__
Tracker <[EMAIL PROTECTED]>

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



[issue1983] Return from fork() is pid_t, not int

2008-01-31 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Don't use long long literally; not all systems have such a type, and
even if they do, they might not call it "long long".

__
Tracker <[EMAIL PROTECTED]>

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



[issue1864] test_locale doesn't use unittest

2008-01-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

An improved version of this patch is now included in the proposed patch
for #1222 :)

__
Tracker <[EMAIL PROTECTED]>

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



[issue1984] The raw string r'\' fails

2008-01-31 Thread Neil Roques

New submission from Neil Roques:

Python's raw strings are supposed to prevent characters being
interpreted as special.  However entering the raw string r'\' into an
interactive session will result in:

Traceback (  File "", line 1
r'\'
   ^
SyntaxError: EOL while scanning single-quoted string

Python seems to have escaped the close of the string, even though raw
strings are not supposed to ever escape characters.

--
components: Interpreter Core
messages: 61936
nosy: passage
severity: minor
status: open
title: The raw string r'\' fails
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



[issue1678380] 0.0 and -0.0 identified, with surprising results

2008-01-31 Thread Mark Dickinson

Mark Dickinson added the comment:

Bug identifying 0j and -0j fixed for Python 2.6 in revision 60483.

Martin, can this be backported to 2.5.2?  I'll assume not, unless I hear
otherwise from you.

--
status: open -> pending

_
Tracker <[EMAIL PROTECTED]>

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



[issue1985] Bug/Patch: Problem with xml/__init__.py when using freeze.py

2008-01-31 Thread Toni Brkic

New submission from Toni Brkic:

Hi,

I tried to do freeze.py for my script that uses ElementTree.
But got the this error:

  File "/usr/lib/python2.5/xml/__init__.py", line 45, in 
_xmlplus.__path__.extend(__path__)
  AttributeError: 'str' object has no attribute 'extend'

The reason seems that _xmlplus.__path__ is a string
after freeze.py.

I fixed it by changing the import to:

try:
_xmlplus.__path__.extend(__path__)
sys.modules[__name__] = _xmlplus
except AttributeError:
pass

This might not be the correct solution but it works for me. I do not
really now
how the __path__ variable works in a freezed environment.

Best regards

--
messages: 61937
nosy: glomde
severity: normal
status: open
title: Bug/Patch: Problem with xml/__init__.py when using freeze.py

__
Tracker <[EMAIL PROTECTED]>

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



[issue1515] deepcopy doesn't copy instance methods

2008-01-31 Thread Michael Van Biesbrouck

Michael Van Biesbrouck added the comment:

Dmitrey: You can't call _deepcopy_method() on anything other than
something with type types.MethodType.  It is a function in a
type-dispatch table, so it will always be called safely. 
copy._deepcopy_dispatch is that table; if you assign _deepcopy_method to
copy._deepcopy_dispatch[types.MethodType] then copy.deepcopy() will
understand what to do with method types.  See my unit test below for the
semantics.

Christian Heimes, this is my unit test:

# This test would fail due to an exception during deepcopy in version 2.5.1

class C(object):
  def __init__(self, n):
self.n = n

  def GetN(self):
return self.n

orig_obj = C(42)
copy_list = copy.deepcopy([orig_obj, orig_obj.GetN])
if copy_list[1]() != 42:
  print 'Error: Instance method lost object?'
orig_obj.n = 43
if copy_list[1]() != 42:
  print 'Error: Instance method assoc with orig object'
copy_list[0].n = 44
if copy_list[1]() != 44:
  print 'Error: Instance method should assoc with new object copy'
if not type(copy_list[1]) is type(orig_obj.GetN):
  print 'Error: Deepcopy changed type of instance method'


Why do people want to use copy and deepcopy?  I think that the issue is
that Python is an imperative language that passes and copies references.
 If a library function doesn't treat its arguments as const, horrible
things could happen.  Compounding this, several standard operations
(such as sort) operate in place, so if you want to use them then you
need to make shallow copies at the very least.  When non-scalar types
nest, the whole structure can be deepcopied or copy can be used
repeatedly in a selective manner (with a high chance of bugs).  Perl
deals with this issue by using standard copy semantics (but
call-by-reference) and a copy-on-write implementation.  Most operations
operate out-of-place.  Pure languages can use reference-based copy
semantics because you can't modify anything, forcing users to create the
copy-on-write implementation when mutating structures.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1983] Return from fork() is pid_t, not int

2008-01-31 Thread Christian Heimes

Christian Heimes added the comment:

I fixed the bug in r60484. Python was already using pid_t on several
occasions like getpid(). I added a test to verify that PyInt_FromLong()
can always handle pid_t.

Do you want to port the fix to 2.5?

--
resolution:  -> fixed
status: open -> pending
versions: +Python 2.5 -Python 2.6, 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



[issue1984] The raw string r'\' fails

2008-01-31 Thread Georg Brandl

Georg Brandl added the comment:

This is not easily fixable -- it has been discussed several times on
python-dev and won't change.

--
nosy: +georg.brandl
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



[issue1515] deepcopy doesn't copy instance methods

2008-01-31 Thread Guido van Rossum

Guido van Rossum added the comment:

On Jan 31, 2008 2:54 PM, Michael Van Biesbrouck wrote:
> Why do people want to use copy and deepcopy?  I think that the issue is
> that Python is an imperative language that passes and copies references.
>  If a library function doesn't treat its arguments as const, horrible
> things could happen.  Compounding this, several standard operations
> (such as sort) operate in place, so if you want to use them then you
> need to make shallow copies at the very least.

I see the point for shallow copies. I just don't see the point for deep copies.

> When non-scalar types
> nest, the whole structure can be deepcopied or copy can be used
> repeatedly in a selective manner (with a high chance of bugs).

I don't understand the use case. I still think this comes primarily
from a lack of familiarity with how Python is typically used.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1482] IMAP4 SSL isn't working

2008-01-31 Thread Bill Janssen

Bill Janssen added the comment:

I guess I'll check it in.  There's no effective test case for the
imaplib module, though.  So if it's broken, we won't know.

When I try connecting to my local IMAP server, I get

>>> c = imaplib.IMAP4("127.0.0.1")
Traceback (most recent call last):
  File "", line 1, in 
  File "/local/python/3k/src/Lib/imaplib.py", line 190, in __init__
raise self.error(self.welcome)
imaplib.error: b'* OK [CAPABILITY IMAP4rev1 LOGINDISABLED STARTTLS]
UpLib IMAP Server (V4r1) ready.'
>>>

I think this is bug 1210.  However, it is able to connect to an
SSL-protected server (not the one above) and get the same error message,
so I think the SSL patch works.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1482] IMAP4 SSL isn't working

2008-01-31 Thread Bill Janssen

Bill Janssen added the comment:

I've committed the patch.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1941] 2.6 stdlib using with statement

2008-01-31 Thread Benjamin Peterson

Benjamin Peterson added the comment:

This new patch removes changes to the platform module.

Added file: http://bugs.python.org/file9342/stdlib-with-stmt2-no-platform.diff

__
Tracker <[EMAIL PROTECTED]>

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



[issue1482] IMAP4 SSL isn't working

2008-01-31 Thread Bill Janssen

Bill Janssen added the comment:

I guess I'll check it in.  There's no effective test case for the
imaplib module, though.  So if it's broken, we won't know.

When I try connecting to my local IMAP server, I get

>>> c = imaplib.IMAP4("127.0.0.1")
Traceback (most recent call last):
  File "", line 1, in 
  File "/local/python/3k/src/Lib/imaplib.py", line 190, in __init__
raise self.error(self.welcome)
imaplib.error: b'* OK [CAPABILITY IMAP4rev1 LOGINDISABLED STARTTLS]
UpLib IMAP Server (V4r1) ready.'
>>>

I think this is bug 1210.  However, it is able to connect to an
SSL-protected server (not the one above) and get the same error message,
so I think the SSL patch works.

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



[issue1482] IMAP4 SSL isn't working

2008-01-31 Thread Bill Janssen

Changes by Bill Janssen:


__
Tracker <[EMAIL PROTECTED]>

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



[issue1941] 2.6 stdlib using with statement

2008-01-31 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Am unassigning because I don't have time for a detailed review.

For the most part, I'm not excited about this patch which targets 
modules that aren't being actively supervised by their original 
contributor.

--
assignee: rhettinger -> 

__
Tracker <[EMAIL PROTECTED]>

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



[issue1983] Return from fork() is pid_t, not int

2008-01-31 Thread Martin v. Löwis

Martin v. Löwis added the comment:

> Do you want to port the fix to 2.5?

I'm not quite sure that the patch actually fixes the
problem. IIUC, HiStar is available in a 32-bit version,
too, yet it may still use a 64-bit pid_t (Ryan, can
you confirm whether that's the case?).

If so, Python would now fail to compile under that
patch. Backporting a change that causes Python to fail
to compile on some systems is not a good idea.

If that aspect was fixed also (e.g. by always returning
long ints on systems where sizeof(pid_t)>sizeof(long)),
a backport would be ok. For a perfect backport, that
change might still cause a behavior change:  on
a system where sizeof(pid_t)>sizeof(long), yet the
system only ever uses pid_t values < INT_MAX, people
would see that the fork return type changes unreasonably;
a perfect backport would only return longs if the values
are out of range. This is probably over-cautious, as
it's fairly unlikely that such systems actually exist.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1983] Return from fork() is pid_t, not int

2008-01-31 Thread Ryan Stutsman

Ryan Stutsman added the comment:

> IIUC, HiStar is available in a 32-bit version,
> too, yet it may still use a 64-bit pid_t (Ryan, can
> you confirm whether that's the case?).

Great point.  pid_t is always 64-bit on HiStar.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1965] Move trunc() to math module

2008-01-31 Thread Jeffrey Yasskin

Jeffrey Yasskin added the comment:

Moved in r60486. I tried to improve the docstring too.

--
resolution: accepted -> 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



[issue1965] Move trunc() to math module

2008-01-31 Thread Raymond Hettinger

Raymond Hettinger added the comment:

It would be nice in the docstring the definition of "truncate" wasn't 
assumed.  It would be more specific to say that it rounds towards zero 
or that it is ceil(x) for negatives and floor(x) for positives.  
Alternatively, state that it returns the integer portion of a Real.  
The word "truncate" in the docstring is close to being a circular 
definition -- if you don't know what math.trunc() does, being told it 
truncates isn't especially informative.

__
Tracker <[EMAIL PROTECTED]>

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