[issue2170] rewrite of minidom.Node.normalize

2009-04-07 Thread A.M. Kuchling

A.M. Kuchling  added the comment:

The new version of the code looks all right, so I
think this patch can be applied.

--

___
Python tracker 

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



[issue3119] pickle.py is limited by python's call stack

2009-04-07 Thread Tennessee Leeuwenburg

Tennessee Leeuwenburg  added the comment:

Aaron,

Could you please upload another patch against the current trunk, then
the issue could be flagged as requiring a patch review?

Thanks,
-Tennessee

--
nosy: +tleeuwenb...@gmail.com

___
Python tracker 

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



[issue5311] bdist_msi generates version number for pure Python packages

2009-04-07 Thread Steven Bethard

Steven Bethard  added the comment:

Ok, I've made some progress on this. The attached patch now generates
MSIs which are version agnostic and look up the appropriate Python
version in the registry. Some things still remaining to do:

* The ProductName needs to be modified at runtime to prefix the "Python
X.Y" for Add/Remove Programs (ARP). I have a custom action making the
appropriate modifications, but this doesn't seem to affect the name in
ARP. Not entirely sure what the problem is, but it seems I may only be
setting the property on the client, and not on the server. I'll continue
looking into this.

* I need to thoroughly test that it does the right thing when a
particular version of Python is required. The code should basically be
there now to do that, but I haven't tested it at all. Probably I need to
play around both with target_version and actually building an extension
module.

Speaking of tests, I have no idea how I would write a unittest for any
of these things. To check some of them, it seems like you'd actually
have to install the .msi onto a Windows machine. So at the moment, all
my tests are by hand. Any better suggestions for testing these kinds of
things would be greatly appreciated.

--
keywords: +patch
Added file: http://bugs.python.org/file13649/bdist_msi.patch

___
Python tracker 

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



[issue5311] bdist_msi generates version number for pure Python packages

2009-04-07 Thread Steven Bethard

Changes by Steven Bethard :


Removed file: http://bugs.python.org/file13536/PythonVersions.vbs

___
Python tracker 

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



[issue4136] merge json library with latest simplejson 2.0.x

2009-04-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Updated patch:
- fixes all failures
- removes bytes input and output "support" (which didn't work but still
involved a lot of code)

To be done:
- remove all traces of the encoding argument, and associated machinery

--
Added file: http://bugs.python.org/file13648/json_py3k-2.patch

___
Python tracker 

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



[issue5703] inside *currentmodule* some links is disabled

2009-04-07 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Sorry, I shouldn't call this a bug. Rather I should use the word
"proposal". I think a link to MIMENonMultipart is also useful. What I
can imagine how to achieve this is...

1. Rewrite MIMENonMultipart to email.mime.MIMENonMultipart
2. Introduce something new directive to sphinx? Like :class:
3. When class is not found in current module, search in document global
module.

How do you think?

--

___
Python tracker 

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



[issue2304] subprocess under windows fails to quote properly when shell=True

2009-04-07 Thread Tennessee Leeuwenburg

Changes by Tennessee Leeuwenburg :


--
stage:  -> patch review

___
Python tracker 

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



[issue5704] Command line option '-3' should imply '-t'

2009-04-07 Thread Georg Brandl

Changes by Georg Brandl :


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

___
Python tracker 

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



[issue5708] Tiny code polishing to unicode_repeat

2009-04-07 Thread Georg Brandl

Changes by Georg Brandl :


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

___
Python tracker 

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



[issue4136] merge json library with latest simplejson 2.0.x

2009-04-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Christian:
1) in py3k, loads and dumps always seem to operate on/produce str
objects, but encode_basestring_ascii returns a bytes object. Why is that?

2) what is the use of the encoding argument in py3k? it looks completely
ignored (bytes objects are not allowed as input and never produced as
output)

--

___
Python tracker 

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



[issue5706] setuptools doesn't honor standard compiler variables

2009-04-07 Thread Georg Brandl

Georg Brandl  added the comment:

Is this about setuptools, or distutils?  setuptools-specific bugs do not
go in this tracker.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue5703] inside *currentmodule* some links is disabled

2009-04-07 Thread Georg Brandl

Georg Brandl  added the comment:

Since NonMultipart is in another module, it is not found automatically
by unqualified name.  This is working as expected.

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

___
Python tracker 

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



[issue2725] Handle ASDLSyntaxErrors gracefully

2009-04-07 Thread Georg Brandl

Changes by Georg Brandl :


--
assignee:  -> georg.brandl

___
Python tracker 

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



[issue4136] merge json library with latest simplejson 2.0.x

2009-04-07 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue5696] test_telnetlib augmentation

2009-04-07 Thread Jack Diederich

Jack Diederich  added the comment:

except when it doesn't!  Still failing on some buildbots.  The couple
places where it expects 1% wibble in timing is far too strict.  I'm
fixing it.

--

___
Python tracker 

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



[issue4136] merge json library with latest simplejson 2.0.x

2009-04-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

There is the problem in the current py3k version of json. b"hi" can be
serialized, but not [b"hi"].

>>> json.dumps(b"hi")
'"hi"'
>>> json.dumps([b"hi"])
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/antoine/py3k/__svn__/Lib/json/__init__.py", line 230, in dumps
return _default_encoder.encode(obj)
  File "/home/antoine/py3k/__svn__/Lib/json/encoder.py", line 367, in encode
chunks = list(self.iterencode(o))
  File "/home/antoine/py3k/__svn__/Lib/json/encoder.py", line 306, in
_iterencode
for chunk in self._iterencode_list(o, markers):
  File "/home/antoine/py3k/__svn__/Lib/json/encoder.py", line 204, in
_iterencode_list
for chunk in self._iterencode(value, markers):
  File "/home/antoine/py3k/__svn__/Lib/json/encoder.py", line 317, in
_iterencode
for chunk in self._iterencode_default(o, markers):
  File "/home/antoine/py3k/__svn__/Lib/json/encoder.py", line 323, in
_iterencode_default
newobj = self.default(o)
  File "/home/antoine/py3k/__svn__/Lib/json/encoder.py", line 344, in
default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: b'hi' is not JSON serializable

--

___
Python tracker 

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



[issue4136] merge json library with latest simplejson 2.0.x

2009-04-07 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Here's a half-baked patch against py3k. It resolves all the conflicts
but still has 15 failing tests. Perhaps someone would like to finish it up.

For example, json.dumps(b"hi") works, but not json.dumps([b"hi", "hi"])

--
Added file: http://bugs.python.org/file13647/json_py3k.patch

___
Python tracker 

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



[issue5696] test_telnetlib augmentation

2009-04-07 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2009/4/7 Jack Diederich :
>
> Jack Diederich  added the comment:
>
> committed some changes in r71377.  This uses Queue.join() to [hopefully]
> eliminate the race condidtions.

Thanks! Works like a charm now.

--

___
Python tracker 

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



[issue5720] ctime: I don't think that word means what you think it means.

2009-04-07 Thread Zooko O'Whielacronx

New submission from Zooko O'Whielacronx :

The stat module currently uses the "st_ctime" slot to hold two kinds
values which are semantically different but which are frequently
confused with one another.  It chooses which kind of value to put in
there based on platform -- Windows gets the file creation time and all
other platforms get the "ctime".  The only sane way to use this API is
then to switch on platform:

if platform.system() == "Windows":
metadata["creation time"] = s.st_ctime
else:
metadata["unix ctime"] = s.st_ctime

(That is an actual code snippet from the Allmydata-Tahoe project.)

Many or even most programmers incorrectly think that unix ctime is file
creation time, so instead of using the sane idiom above, they write the
following:

metadata["ctime"] = s.st_ctime

thus passing on the confusion to the users of their metadata, who may
not know on which platform this metadata was created.  This is the
situation we have found ourselves in for the Allmydata-Tahoe project --
we now have a bunch of "ctime" values stored in our filesystem and no
way to tell which kind they were.

More and more filesystems such as ZFS and Macintosh apparently offer
creation time nowadays.

I propose the following changes:

1.  Add a "st_crtime" field which gets populated on filesystems
(Windows, ZFS, Mac) which can do so.

That is hopefully not too controversial and we could proceed to do so
even if the next proposal gets bogged down:

2.  Add a "st_unixctime" field which gets populated *only* by the unix
ctime and never by any other value (even on Windows, where the unix
ctime *is* available even though nobody cares about it), and deprecate
the hopelessly ambiguous "st_ctime" field.

You may be interested in http://allmydata.org/trac/tahoe/ticket/628
("mtime" and "ctime": I don't think that word means what you think it
means.) where the Allmydata-Tahoe project is carefully unpicking the
mess we made for ourselves by confusing ctime with file-creation time.

--
components: Library (Lib)
messages: 85750
nosy: zooko
severity: normal
status: open
title: ctime: I don't think that word means what you think it means.

___
Python tracker 

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



[issue5710] ctypes should return composite types from callbacks

2009-04-07 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

But isn't this purely a user-side concern?

For example, if I want to use a function such as QBuffer::setBuffer in 
the Qt library:
http://doc.trolltech.com/4.4/qbuffer.html#setBuffer
I must keep a reference to the buffer as long as the QBuffer is alive, 
or expect a crash.

Returning a pointer from a function is always tough, even in C: 
everybody has already tried to return the address of a local variable...
the pointer must belong to some container that outlives the function 
call.
ctypes is not different in this aspect. The same precautions as in C 
apply. And with a warning note in the documentation, there seems to be 
no reason to limit the return type of a callback.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue5716] Overzealous deprecation of BaseException.message

2009-04-07 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue588825] unittest.py, better error message

2009-04-07 Thread Michael Foord

Michael Foord  added the comment:

This feature request was recently implemented using the 'longMessage'
class attribute on TestCase.

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

___
Python tracker 

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



[issue1580] Use shorter float repr when possible

2009-04-07 Thread Jared Grubb

Jared Grubb  added the comment:

The process that you describe in msg85741 is a way of ensuring
"memcmp(&x, &y, sizeof(x))==0", and it's portable and safe and is the
Right Thing that we all want and expect. But that's not "x==y", as that
Sun paper explains. It's close, but not technically accurate, as the
implication arrow only goes one way (just as "x=1/y" implies "xy=1" in
algebra, but not the other way around)

I'd be interested to see if you could say that the Python object
model/bytecode interpretation enforces a certain quauntum of operations
that actually does imply "eval(repr(x))==x"; but I suspect it's
unprovable, and it's fragile as Python grows to have more support in
CLI/LLVM/JVM backends. 

My pedantic mind would strip any and all references to floating-point
equality out of the docs, as it's dangerous and insidiously misleading,
even in "obvious" cases. But, I'll stop now :) (FYI: I've enjoyed the
~100 messages here.. Great stuff!)

--

___
Python tracker 

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



[issue588825] unittest.py, better error message

2009-04-07 Thread Georg Brandl

Changes by Georg Brandl :


--
assignee: collinwinter -> michael.foord
nosy: +michael.foord

___
Python tracker 

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

2009-04-07 Thread Georg Brandl

Georg Brandl  added the comment:

It's not really my call.  Tim is the author of the module and classified
it as a feature request.

Why don't you try to come up with a patch? He might even accept it :D

--
nosy: +georg.brandl

___
Python tracker 

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



[issue658693] cPickle does relative import

2009-04-07 Thread Georg Brandl

Georg Brandl  added the comment:

Probably, but I guess nobody is really interested in fixing it since
it's not in 3.x.

--
nosy: +georg.brandl
resolution:  -> wont fix
status: open -> pending

___
Python tracker 

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



[issue5696] test_telnetlib augmentation

2009-04-07 Thread Jack Diederich

Jack Diederich  added the comment:

committed some changes in r71377.  This uses Queue.join() to [hopefully]
eliminate the race condidtions.

--

___
Python tracker 

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



[issue5099] subprocess.POpen.__del__() AttributeError (os module == None!)

2009-04-07 Thread Hans L

Changes by Hans L :


--
nosy: +hozn

___
Python tracker 

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



[issue2713] Py3k warn on unicode escapes in raw strings

2009-04-07 Thread Georg Brandl

Georg Brandl  added the comment:

I guess it isn't...

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue2519] Typing 'modules' in the interactive help system fails when imports fail

2009-04-07 Thread Georg Brandl

Changes by Georg Brandl :


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

___
Python tracker 

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



[issue3102] ctypes defines global symbols

2009-04-07 Thread Thomas Heller

Thomas Heller  added the comment:

I think simple renaming would be fine.

I do not see how module_methods could be made static; however, the
init_callbacks_in_module function should probably be removed completely.

Some other symbols could be made static because they are only used in a
single source file, Array_Type and CData_Type for example (there may be
more).

For MallocClosure/FreeClosure and the fedoraproject patch: Where does
ffi_closure_alloc and ffi_closure_free come from?

--

___
Python tracker 

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



[issue1580] Use shorter float repr when possible

2009-04-07 Thread Mark Dickinson

Mark Dickinson  added the comment:

> I think ANY attempt to rely on eval(repr(x))==x is asking for trouble,
> and it should probably be removed from the docs.

I disagree.  I've read the paper you refer to; nevertheless, it's still 
perfectly possible to guarantee eval(repr(x)) == x in spite of the 
various floating-point details one has to deal with.   In the worst 
case, assuming that C doubles are IEEE 754 binary64 format, for double -
> string conversion one can simply cast the double to an array of 8 
bytes, extract the sign, exponent and mantissa from those bytes, and 
then compute the appropriate digit string using nothing but integer 
arithmetic;  similarly for the reverse operation: take a digit string, 
do some integer arithmetic to figure out what the exponent, mantissa and 
sign should be, and pack those values back into the double.  Hey presto:  
correctly rounded string -> double and double -> string conversions!  
Add a whole bag of tricks to speed things up in common cases and you end 
up with something like David Gay's code.

It *is* true that the correctness of Gay's code depends on the FPU being 
set to use 53-bit precision, something that isn't true by default on x87 
FPUs.  But this isn't hard to deal with, either:  first, you make sure 
that you're not using the x87 FPU unless you really have to (all Intel 
machines that are newer than Pentium 3 have the SSE2 instruction set, 
which doesn't have the problems that x87 does);  second, if you *really* 
have to use x87 then you figure out how to set its control word to get 
53-bit precision and round-half-to-even rounding;  third, if you can't 
figure out how to set the control word then you use a fallback something 
like that described above.

--

___
Python tracker 

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



[issue5461] python3 symlink

2009-04-07 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Fixed in r71376.

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

___
Python tracker 

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



[issue1580] Use shorter float repr when possible

2009-04-07 Thread Mark Dickinson

Mark Dickinson  added the comment:

> Historically, we've had a stronger requirement: if you print repr(x)
> and ship that string to a different machine, float() of that string
> returns the same value, assuming both systems use the same internal FP
> representation (e.g. IEEE).

Hmm.  With the py3k-short-float-repr stuff, we should be okay moving 
things between different CPython boxes, since float() would use Gay's code 
and so would be correctly rounded for any length input, not just input 
with 17 significant digits.

But for a CPython-generated short repr to give the correct value on some 
other implementation, that implementation would also have to have a 
correctly rounded string->float.

For safety's sake, I'll make sure that marshal (version 1) and pickle 
(protocol 0) are still outputting the full 17 digits.

--

___
Python tracker 

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



[issue1590] "make altinstall" installs pydoc, idle, smtpd.py

2009-04-07 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Fixed in r71372. Thanks for the patch!

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

___
Python tracker 

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



[issue5718] Problem compiling ffi part of build on AIX 5.3.

2009-04-07 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

Can you provide a patch? If not, chances are high that no action is taken.

--
nosy: +loewis

___
Python tracker 

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



[issue1590] "make altinstall" installs pydoc, idle, smtpd.py

2009-04-07 Thread Daniel Diniz

Daniel Diniz  added the comment:

That's good enough a test for me :)
Pinging gutworth so we can have this in 3.1.

--
nosy: +ajaksu2, benjamin.peterson
stage: test needed -> patch review

___
Python tracker 

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



[issue5696] test_telnetlib augmentation

2009-04-07 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2009/4/7 Jack Diederich :
>
> Jack Diederich  added the comment:
>
> Could you try increasing self.blocking_timeout (in the _setUp function)
> to something greater than 0.0 (like 0.1) and see if that works?  I
> picked a constant that was as small as Worked For Me to keep the total
> test time as short as possible.

Nope, still have the same problem.

>
> Unfortunately select() is called in the guts of Telnet so slipping in a
> mock object is difficult.  I could also add more synchronization
> primitives but that is also icky.  Hopefully just upping the constant a
> little does the trick.

You could monkey patch select.select() during the tests or rewrite
telnetlib, so it calls self._select() and make a subclass.

--

___
Python tracker 

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



[issue1590] "make altinstall" installs pydoc, idle, smtpd.py

2009-04-07 Thread David Ripton

David Ripton  added the comment:

I see this has been marked as "test needed", but this patch is a change
to Makefile.pre.in, and it's not clear to me how to unit test it using
the existing Python test framework.

FWIW, I've manually tested it (on Linux) by doing ./configure; make;
sudo make install and verifying the absence of (newly installed) idle,
pydoc, and smtpd.py in /usr/local/bin

--

___
Python tracker 

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



[issue5696] test_telnetlib augmentation

2009-04-07 Thread Jack Diederich

Jack Diederich  added the comment:

Could you try increasing self.blocking_timeout (in the _setUp function)
to something greater than 0.0 (like 0.1) and see if that works?  I
picked a constant that was as small as Worked For Me to keep the total
test time as short as possible.

Unfortunately select() is called in the guts of Telnet so slipping in a
mock object is difficult.  I could also add more synchronization
primitives but that is also icky.  Hopefully just upping the constant a
little does the trick.

--

___
Python tracker 

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



[issue1580] Use shorter float repr when possible

2009-04-07 Thread Jared Grubb

Jared Grubb  added the comment:

I think ANY attempt to rely on eval(repr(x))==x is asking for trouble,
and it should probably be removed from the docs.

Example: The following C code can vary *even* on a IEEE 754 platform,
even in two places in the same source file (so same compile options),
even in the same 5 lines of code recompiled after changing code that
does even not touch/read 'x' or 'y':

double x, y;
x = 3.0/7.0;
y = x;
/* ... code that doesnt touch/read x or y ... */
printf(" x==y: %s", (x==y) ? "true" : "false");

So, how can we hope that eval(repr(x))==x is EVER stable? Equality and
floating point should raise the hairs on the back of everyone's neck...

(Code above based on
http://docs.sun.com/source/806-3568/ncg_goldberg.html in section
"Current IEEE 754 Implementations", along with a great explanation on
why this is true. The code example is a little different, but the same
concept applies.)

--
nosy: +jaredgrubb

___
Python tracker 

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



[issue5710] ctypes should return composite types from callbacks

2009-04-07 Thread Thomas Heller

Thomas Heller  added the comment:

There is a problem returning arbitrary complicated ctypes types from
callbacks.  Consider that a callback function returns a structure; the
structure itself may contain 'char *' field for example.  The callback
function creates the structure and fills in the fields.  The 'char *'
field contains a pointer to a nul-terminated string; the ctypes
structure object must keep the Python string alive as long as the
structure itself.  It does this via the private '_objects' instance
variable.  If the callback function now returns the structure, the
Python ctypes object usually will go out of scope and will be garbage
collected, together with its '_objects'.  So, the pointer(s) contained
in the structure will become invalid now, and even simple structure
fields will become invalid.

However, the callback function result will be used by some other code
and will surely crash.

In principle it should be possible to make code like this work; one
would have to maintain the returned objects elsewhere and clean them up
when they are no longer used anywhere; but I think this gets too
complicated.

--

___
Python tracker 

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



[issue5695] test_logging fails when run twice in a row

2009-04-07 Thread Vinay Sajip

Vinay Sajip  added the comment:

Done, in r71370.

--

___
Python tracker 

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



[issue5714] CGIHTTPServer._url_collapse_path_split should live elsewhere

2009-04-07 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

urlparse.urljoin and urlparse.urlsplit do not do what is required for 
this function.  urljoin does not collapse paths.  urlsplit has nothing 
to do with paths.

I agree r.david.murray that it is odd that it does two functions at once 
(the collapse and the split).  I wrote it specifically for its current 
use case when checking paths to cgi scripts.

The unittests for it describe the exact behavior it needs to implement.  
Trying to implement a separate collapse function is approximately the 
same amount of code because the edge cases such as
'/a/b/' and '/a/b/c/..' which both need to result in it returning 
('/a/b', '') instead of ('/a', 'b') are why it made sense to keep as a 
single function for its current use.

Unittests for the function already exist in Lib/test/test_httpservers.py  
to describe its full behavior.

--

___
Python tracker 

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



[issue5717] os.defpath includes unix /bin on windows

2009-04-07 Thread Guido van Rossum

Guido van Rossum  added the comment:

Can you suggest a fix?

--
nosy: +gvanrossum

___
Python tracker 

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



[issue5359] _dbm extension only built using gdbm on linux

2009-04-07 Thread Matthias Klose

Matthias Klose  added the comment:

> Ok. Just make sure "make clean; make" works.

done. the "make clean" was missing before.

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

___
Python tracker 

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



[issue3379] Option to not-exit on test

2009-04-07 Thread Michael Foord

Michael Foord  added the comment:

Not returning the results is not a problem - if you needed access to the
results you would hardly be using this API in the first place.

The obvious use case if for running tests from an interactive
environment where you are using the visual output on stdout.

If you want to collect the results you do it programmatically.

I wouldn't be opposed to main() returning the results though, but think
we should apply the patch rather than debate further. To action!

--
nosy: +michael.foord

___
Python tracker 

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



[issue5359] _dbm extension only built using gdbm on linux

2009-04-07 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2009/4/7 Matthias Klose :
>
> Matthias Klose  added the comment:
>
> I'm removing the db4.6 check instead. This was useful when building the
> _bsddb3 extension, where threading tests would fail on these
> architectures. It's not necessary for building the _dbm extension.

Ok. Just make sure "make clean; make" works.

--

___
Python tracker 

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



[issue2674] unittest.TestProgram uses sys.exit()

2009-04-07 Thread Daniel Diniz

Daniel Diniz  added the comment:

Closing as issue 3379 has more discussion and patch.

--
nosy: +ajaksu2
priority:  -> normal
resolution:  -> duplicate
status: open -> closed
superseder:  -> Option to not-exit on test

___
Python tracker 

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



[issue5359] _dbm extension only built using gdbm on linux

2009-04-07 Thread Matthias Klose

Matthias Klose  added the comment:

I'm removing the db4.6 check instead. This was useful when building the
_bsddb3 extension, where threading tests would fail on these
architectures. It's not necessary for building the _dbm extension.

--

___
Python tracker 

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



[issue3379] Option to not-exit on test

2009-04-07 Thread Daniel Diniz

Changes by Daniel Diniz :


--
components: +Tests
priority:  -> normal
stage:  -> patch review
versions: +Python 2.7, Python 3.1 -Python 3.0

___
Python tracker 

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



[issue5719] optparse: please provide a usage example in the module docstring

2009-04-07 Thread Marius Gedminas

New submission from Marius Gedminas :

Please add a simple usage example to the module docstring in
optparse.py.  The example available in the Python library reference
would suffice (see http://python.org/doc/current/library/optparse.html).

Rationale: optparse is convenient, but a bit unintuitive.  As a single
data point, it took me a couple of years until I started remembering the
syntax without having to refer to the documentation (compare this with,
e.g. the csv module which you'll remember how to use after reading the
docs once).  Intuitively I always typed pydoc optparse in a terminal
window and was disappointed with the lack of examples.  The online docs
are good, but not as easy to reach as pydoc.

In my experience, it's quite often that when you reach for optparse
you're alreay shaving a yak (solving a problem needed to solve the real
problem), and the five extra mouse clicks needed to find optparse's docs
in the browser are rather disruptive.

--
assignee: georg.brandl
components: Documentation
messages: 85722
nosy: georg.brandl, mgedmin
severity: normal
status: open
title: optparse: please provide a usage example in the module docstring

___
Python tracker 

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



[issue1774840] Not exiting when running tests

2009-04-07 Thread Daniel Diniz

Daniel Diniz  added the comment:

Closing as issue 3379 has discussion and patches.

--
nosy: +ajaksu2
resolution:  -> duplicate
stage: needs patch -> 
status: open -> closed
superseder:  -> Option to not-exit on test

___
Python tracker 

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



[issue4828] patch suggestion for webbrowser

2009-04-07 Thread anatoly techtonik

anatoly techtonik  added the comment:

Windows has a plenty of executable extensions that can be dynamically
added. You may want to look at patch at issue 2200
http://bugs.python.org/file11359/spawn.patch.txt for workaround.

--
nosy: +techtonik

___
Python tracker 

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



[issue3872] Python 2.6rc2: Tix ComboBox error

2009-04-07 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

This is now fixed in 2.6.2c1

--
status: open -> closed

___
Python tracker 

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



[issue5359] _dbm extension only built using gdbm on linux

2009-04-07 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

This should be reverted on the py3k branch. The changes to setup.py
cause the select module to be loaded and that doesn't work when it
hasn't be built!

Traceback (most recent call last):
  File "./setup.py", line 1671, in 
main()
  File "./setup.py", line 1666, in main
'Lib/smtpd.py']
  File
"/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/distutils/core.py",
line 149, in setup
dist.run_commands()
  File
"/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/distutils/dist.py",
line 943, in run_commands
self.run_command(cmd)
  File
"/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/distutils/dist.py",
line 963, in run_command
cmd_obj.run()
  File
"/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/distutils/command/build.py",
line 128, in run
self.run_command(cmd_name)
  File
"/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/distutils/cmd.py",
line 317, in run_command
self.distribution.run_command(command)
  File
"/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/distutils/dist.py",
line 963, in run_command
cmd_obj.run()
  File
"/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/distutils/command/build_ext.py",
line 347, in run
self.build_extensions()
  File "./setup.py", line 103, in build_extensions
missing = self.detect_modules()
  File "./setup.py", line 709, in detect_modules
for x in gen_db_minor_ver_nums(4):
  File "./setup.py", line 686, in gen_db_minor_ver_nums
if allow_db_ver((4, x)):
  File "./setup.py", line 677, in allow_db_ver
arch = platform_machine()
  File
"/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/platform.py",
line 1222, in machine
return uname()[4]
  File
"/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/platform.py",
line 1152, in uname
processor = _syscmd_uname('-p','')
  File
"/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/platform.py",
line 905, in _syscmd_uname
f = os.popen('uname %s 2> /dev/null' % option)
  File
"/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/os.py", line
629, in popen
import subprocess, io
  File
"/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/subprocess.py",
line 373, in 
import select
ImportError: No module named select

--
nosy: +benjamin.peterson
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue3783] dbm.sqlite proof of concept

2009-04-07 Thread Matthias Klose

Matthias Klose  added the comment:

is there any chance for inclusion in 3.1?

--
nosy: +doko

___
Python tracker 

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



[issue5696] test_telnetlib augmentation

2009-04-07 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Jack, this test seems to be very flaky on the buildbots (and my
machine). I see a lot of failures like this:

==
FAIL: test_read_eager_B (test.test_telnetlib.ReadTests)
--
Traceback (most recent call last):
  File "/temp/python/trunk/Lib/test/test_telnetlib.py", line 235, in
test_read_eager_B
self._test_read_any_eager_B('read_eager')
  File "/temp/python/trunk/Lib/test/test_telnetlib.py", line 224, in
_test_read_any_eager_B
self.assertRaises(EOFError, func)
AssertionError: EOFError not raised

==
FAIL: test_read_very_eager_B (test.test_telnetlib.ReadTests)
--
Traceback (most recent call last):
  File "/temp/python/trunk/Lib/test/test_telnetlib.py", line 231, in
test_read_very_eager_B
self._test_read_any_eager_B('read_very_eager')
  File "/temp/python/trunk/Lib/test/test_telnetlib.py", line 224, in
_test_read_any_eager_B
self.assertRaises(EOFError, func)
AssertionError: EOFError not raised

--
Ran 22 tests in 76.712s

FAILED (failures=2)
test test_telnetlib failed -- errors occurred; run in verbose mode for
details
1 test failed:
test_telnetlib

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue5714] CGIHTTPServer._url_collapse_path_split should live elsewhere

2009-04-07 Thread Leonid Vasilev

Leonid Vasilev  added the comment:

Actually urlparse.urljoin implements RFC 2396

Is it true that 'CGIHTTPServer._url_collapse_path_split' is just a
inverted 'urlparse.urljoin' ?
"""
>>> urlparse.urljoin('http://a/b/c/','g')
'http://a/b/c/g'
>>> urlparse.url_collapse_path_split('http://a/b/c/g')
('/http:/a/b/c', 'g')
>>> urlparse.urlsplit('http://a/b/c/g')
SplitResult(scheme='http', netloc='a', path='/b/c/g', query='', fragment='')
"""

And there is existing function 'urlparse.urlsplit'.
I think "CGIHTTPServer._url_collapse_path_split" is just a customized
version of latter, and should be rewritten using 'urlparse.urlsplit'.

--

___
Python tracker 

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



[issue5718] Problem compiling ffi part of build on AIX 5.3.

2009-04-07 Thread David Byrne

New submission from David Byrne :

I am using AIX 5.3 xlc 9.0.  I am unable to get the libffi section to
build.  It also happens with the separate libffi code, so I will try to
report there as well.  I get the following:

cc_r -qlanglvl=extc89 -DNDEBUG -O -I.
-I/appl/bwc/src/Python-2.6.1/./Include
-Ibuild/temp.aix-5.3-2.6/libffi/include -Ibuild/temp.aix-5.3-2.6/libffi
-I/appl/bwc/src/Python-2.6.1/Modules/_ctypes/libffi/src
-I/appl/bwc/local2/include -I. -IInclude -I./Include
-I/usr/local/include -I/appl/bwc/src/Python-2.6.1/Include
-I/appl/bwc/src/Python-2.6.1 -c
/appl/bwc/src/Python-2.6.1/Modules/_ctypes/libffi/src/powerpc/aix_closure.S
-o
build/temp.aix-5.3-2.6/appl/bwc/src/Python-2.6.1/Modules/_ctypes/libffi/src/powerpc/aix_closure.o
Assembler:
/tmp/xlcS00-Mgqd.s: line 111: undefined symbol ".ffi_closure_helper_DARWIN"
/tmp/xlcS00-Mgqd.s: line 111: illegal expression type for branch address

--
assignee: theller
components: ctypes
messages: 85714
nosy: dbyrne, theller
severity: normal
status: open
title: Problem compiling ffi part of build on AIX 5.3.
type: compile error
versions: Python 2.6

___
Python tracker 

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



[issue4751] Patch for better thread support in hashlib

2009-04-07 Thread Lukas Lueg

Changes by Lukas Lueg :


Removed file: http://bugs.python.org/file13057/hashlibopenssl_gil_py27.diff

___
Python tracker 

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



[issue4751] Patch for better thread support in hashlib

2009-04-07 Thread Lukas Lueg

Lukas Lueg  added the comment:

bump

hashlibopenssl_gil_py27.diff has not yet been applied to py27 and does
not apply cleanly any more. Here is an updated version.

--
status: pending -> open
Added file: http://bugs.python.org/file13646/hashlibopenssl_gil_py27_2.diff

___
Python tracker 

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



[issue2771] test issue

2009-04-07 Thread Daniel Diniz

Daniel Diniz  added the comment:

> Quote

Unquote

code snippet:

'b'

--

___
Python tracker 

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



[issue2771] test issue

2009-04-07 Thread Daniel Diniz

Daniel Diniz  added the comment:

> Having them compare unequal means you can't actually trust unbound
> method comparison, nor using unbound methods as keys in a dictionary.

"Trust" is a strong word. You can trust the comparison operator if you
agree with its semantics, you cannot trust it if you want different
semantics. But that doesn't mean it is generally trustworthy or
untrustworthy.

Really, this is the same as with numbers:

'b'

--

___
Python tracker 

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



[issue2771] test issue

2009-04-07 Thread Daniel Diniz

Daniel Diniz  added the comment:

> The reason I noticed this is that since they compare and hash equal, if
> you put two such methods into a set, you end up with a set with one
> method.  Currently, this is preventing me from running two test methods
> because the method itself is defined on a base class and two subclasses
> which customize several other methods inherit it.  I can only run one
> test at a time.

But you acknowledge they are really the same method attached to
different classes, right? The notion of "unbound method" is mostly an
implementation detail. The term occurs only 4 times in the whole Python
documentation (according to Google). And in py3k they are gone. (*)

Moreover, you say you want them to compare unequal because you
*explicitly* want the same method called separately for each class it is
defined on. Is there anything preventing you to have a set of (class,
method) tuples instead? Because it sounds like the logical thing to do
in your case.

> Having them compare unequal means you can't actually trust unbound
> method comparison, nor using unbound methods as keys in a dictionary.

"Trust" is a strong word. You can trust the comparison operator if you
agree with its semantics, you cannot trust it if you want different
semantics. But that doesn't mean it is generally trustworthy or
untrustworthy.

Really, this is the same as with numbers:

'b'

There are probably use cases where the above is annoying. But,
conversely, there are probably use cases where a stricter behaviour
would be annoying too.

> This means some other mapping structure is required if you want to keep
> around a bunch of methods and arguments to pass to them.

I disagree. The general use case of keeping a bunch of callables with
their respective arguments implies storing bound, not unbound, methods.
(how often do you feed an unbound method to an addCallback() ?)

> It also means
> that any time you want to check two methods against each other with the
> goal of eventually calling one or both of them, you need to use
> something other than `==´.

I don't think there are lots of use cases for comparing *unbound*
methods. One such use case is checking for redefinition of inherited
methods, and the current __eq__ semantics look fine for that.

(*)
Python 3.0b2+ (py3k, Jul 29 2008, 20:37:34)
[GCC 4.3.1 20080626 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class A:
...  def f(): pass
...
>>> type(A.f)

>>> a = A()
>>> type(a.f)

>>> def g(): pass
...
>>> class B:
...  g = g
...
>>> B.g is g
True

--

___
Python tracker 

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



[issue5716] Overzealous deprecation of BaseException.message

2009-04-07 Thread Steven Bethard

Steven Bethard  added the comment:

I've run into exactly the same thing. The argparse module's
ArgumentError had a "message" attribute back in Python 2.4, and in
Python 2.6 I get the same warnings Tres is getting.

--
nosy: +bethard

___
Python tracker 

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



[issue5717] os.defpath includes unix /bin on windows

2009-04-07 Thread anatoly techtonik

New submission from anatoly techtonik :

>>> import os
>>> os.defpath
'.;C:\\bin'
>>> os.path.defpath
'.;C:\\bin'
>>>

These are invalid paths on windows.

--
components: Library (Lib)
messages: 85708
nosy: techtonik
severity: normal
status: open
title: os.defpath includes unix /bin on windows
versions: Python 2.5

___
Python tracker 

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



[issue2771] test issue

2009-04-07 Thread Daniel Diniz

Daniel Diniz  added the comment:

>>> Testing how email handles quotes.
>>>
>>> [mailgw]
>>>
>>> # Keep email citations when accepting messages.
>>> # Setting this to "no" strips out "quoted" text from the message.
>>> # Signatures are also stripped.
>>> # Allowed values: yes, no
>>> # Default: yes
>>> keep_quoted_text = yes
>>>
>>> # Preserve the email body as is - that is,
>>> # keep the citations _and_ signatures.
>>> # Allowed values: yes, no
>>> # Default: no
>>> leave_body_unchanged = no
>>>

Bottom posting, less hints about quotes.

--

___
Python tracker 

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



[issue2771] test issue

2009-04-07 Thread Daniel Diniz

Daniel Diniz  added the comment:

Nested quotes.

On Tue, Apr 7, 2009 at 11:53 AM, Daniel Diniz  wrote:
>
> Daniel Diniz  added the comment:
>
> Dumb whole message quote.
>
> On Tue, Apr 7, 2009 at 11:51 AM, Daniel Diniz  wrote:
>>
>> Daniel Diniz  added the comment:
>>
>> Testing how email handles quotes.
>>
>> [mailgw]
>>
>> # Keep email citations when accepting messages.
>> # Setting this to "no" strips out "quoted" text from the message.
>> # Signatures are also stripped.
>> # Allowed values: yes, no
>> # Default: yes
>> keep_quoted_text = yes
>>
>> # Preserve the email body as is - that is,
>> # keep the citations _and_ signatures.
>> # Allowed values: yes, no
>> # Default: no
>> leave_body_unchanged = no
>>
>> --
>>
>> ___
>> Python tracker 
>> 
>> ___
>>
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue1580] Use shorter float repr when possible

2009-04-07 Thread Guido van Rossum

Guido van Rossum  added the comment:

On Tue, Apr 7, 2009 at 3:10 AM, Mark Dickinson  wrote:
> A proposal: I propose that the short float representation should be
> considered an implementation detail for CPython, not a requirement for
> Python the language.  This leaves Jython and IronPython and friends free
> to do as they wish.

In principle that's fine with me.

> All that should be required for Python itself is
> that float(repr(x)) == x for (non-nan, non-infinite) floats x.  Does
> this seem reasonable to people following this issue?  If it's
> controversial I'll take it to python-dev.

Historically, we've had a stronger requirement: if you print repr(x)
and ship that string to a different machine, float() of that string
returns the same value, assuming both systems use the same internal FP
representation (e.g. IEEE). Earlier in this bug (or elsewhere) Tim
Peters has pointed out that on some platforms, in particular Windows,
input conversion doesn't always round correctly and only works
correctly when the input has at least 17 digits (in which case you
apparently don't need to round, and truncation works just as well --
that's all the C standard requires, I believe).

Now that pickle and marshal no longer use repr() for floats I think
this is less important, but still at least worth considering. I think
by having our own input function we solve this if both hosts run
CPython, but it might break for other implementations.

In order to make progress I recommend that we just not this and don't
use it to hold up the implementation, but I think it's worth noticing
in docs somewhere.

--

___
Python tracker 

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



[issue2771] test issue

2009-04-07 Thread Daniel Diniz

Daniel Diniz  added the comment:

Dumb whole message quote.

On Tue, Apr 7, 2009 at 11:51 AM, Daniel Diniz  wrote:
>
> Daniel Diniz  added the comment:
>
> Testing how email handles quotes.
>
> [mailgw]
>
> # Keep email citations when accepting messages.
> # Setting this to "no" strips out "quoted" text from the message.
> # Signatures are also stripped.
> # Allowed values: yes, no
> # Default: yes
> keep_quoted_text = yes
>
> # Preserve the email body as is - that is,
> # keep the citations _and_ signatures.
> # Allowed values: yes, no
> # Default: no
> leave_body_unchanged = no
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue2771] test issue

2009-04-07 Thread Daniel Diniz

Daniel Diniz  added the comment:

Testing how email handles quotes.

[mailgw]

# Keep email citations when accepting messages.
# Setting this to "no" strips out "quoted" text from the message.
# Signatures are also stripped.
# Allowed values: yes, no
# Default: yes
keep_quoted_text = yes

# Preserve the email body as is - that is,
# keep the citations _and_ signatures.
# Allowed values: yes, no
# Default: no
leave_body_unchanged = no

--

___
Python tracker 

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



[issue5359] _dbm extension only built using gdbm on linux

2009-04-07 Thread Matthias Klose

Matthias Klose  added the comment:

fixed on the 3.0 and 3.1 branches

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

___
Python tracker 

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



[issue5714] CGIHTTPServer._url_collapse_path_split should live elsewhere

2009-04-07 Thread R. David Murray

R. David Murray  added the comment:

Yes, unit tests are always needed for any change.

Gregory, why is a function that does two things (collapse and split) a
good candidate for a public API?  It results in a pretty awkward name :)

I'm not saying it's necessarily a bad idea, just looking for motivation.

--
components: +Library (Lib)
nosy: +r.david.murray
stage:  -> test needed

___
Python tracker 

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



[issue4587] Need to rework the dbm lib/include selection process

2009-04-07 Thread Matthias Klose

Matthias Klose  added the comment:

here is an updated patch, adding a new configure option
--with-dbmliborder, and checking the config args in setup.py.

this is the same approach as taken with the --with-system-libffi option.

--
nosy: +doko
Added file: http://bugs.python.org/file13645/dbmliborder.diff

___
Python tracker 

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



[issue5714] CGIHTTPServer._url_collapse_path_split should live elsewhere

2009-04-07 Thread Leonid Vasilev

Leonid Vasilev  added the comment:

I'd Wrote a patch for this.

Perhaps some unittests are needed.

--
keywords: +patch
nosy: +chin
Added file: http://bugs.python.org/file13644/issue5714_withdoc.diff

___
Python tracker 

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



[issue1580] Use shorter float repr when possible

2009-04-07 Thread Mark Dickinson

Mark Dickinson  added the comment:

Those three missing files have now been added to Rietveld.

Just for reference, in case anyone else encounters this: the reason those 
files were missing from the initial upload was that after I svn merge'd 
from py3k-short-float-repr to py3k, those files were being treated (by 
svn) as *copies* from py3k-short-float-repr, rather than new files, so svn 
diff didn't show any output for them.  Doing:

svn revert Python/dtoa.c
svn add Python/dtoa.c

(and similarly for the other two files) fixed this.

--

___
Python tracker 

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



[issue1580] Use shorter float repr when possible

2009-04-07 Thread Mark Dickinson

Mark Dickinson  added the comment:

The Rietveld patch set doesn't show the three new files, which are:

  Python/dtoa.c
  Include/dtoa.h
  Lib/test/formatfloat_testcases.txt

--

___
Python tracker 

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



[issue1580] Use shorter float repr when possible

2009-04-07 Thread Mark Dickinson

Mark Dickinson  added the comment:

I've uploaded the current version to Rietveld:

http://codereview.appspot.com/33084/show

--

___
Python tracker 

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



[issue5716] Overzealous deprecation of BaseException.message

2009-04-07 Thread Tres Seaver

New submission from Tres Seaver :

I'm working on cleaning up deprecations for Zope and related
packages under Python 2.6.  The irony here is that I'm receiving
deprecation warnings for custom exception classes  which had a 'message'
attribute long before the abortive attempt to add them to the
BaseException type, which hardly seems reasonable.

For instance, docutils.parsers.rst defines a DirectiveError which takes
two arguments, 'level' and 'message', and therefore gets hit with the
deprecation (even though it never used the new signature).  Likewise,
ZODB.POSException defines a ConflictError type which takes 'message' as
one of several arguments, all optional, and has since at least 2002.

I don't think either of these classes should be subject to a deprecation
warning for a feature they never used or depended on.

--
components: Library (Lib)
messages: 85695
nosy: tseaver
severity: normal
status: open
title: Overzealous deprecation of BaseException.message
versions: Python 2.6

___
Python tracker 

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



[issue1772721] [python-mode] Properly highlight lambda with no arguments

2009-04-07 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


--
assignee:  -> barry
nosy: +barry

___
Python tracker 

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



[issue1772721] [python-mode] Properly highlight lambda with no arguments

2009-04-07 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Yes, the behavior is the same with latest trunk.
I'd suggest this new patch though, it has the same effect but avoids a
new rule.

--
nosy: +amaury.forgeotdarc
status: pending -> open
Added file: 
http://bugs.python.org/file13643/lambda-with-no-arguments-highlighting-2.patch

___
Python tracker 

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



[issue1054967] bdist_deb - Debian packager

2009-04-07 Thread Tony Meyer

Changes by Tony Meyer :


--
nosy: +anadelonbrin

___
Python tracker 

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



[issue1580] Use shorter float repr when possible

2009-04-07 Thread Mark Dickinson

Mark Dickinson  added the comment:

Changing target Python versions.

I'll upload a patchset to Rietveld sometime soon (later today, I hope).

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

___
Python tracker 

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



[issue1580] Use shorter float repr when possible

2009-04-07 Thread Mark Dickinson

Mark Dickinson  added the comment:

So work on the py3k-short-float-repr branch is nearing completion, and
we (Eric and I) would like to get approval for merging these changes
into the py3k branch before this month's beta.

A proposal: I propose that the short float representation should be
considered an implementation detail for CPython, not a requirement for
Python the language.  This leaves Jython and IronPython and friends free
to do as they wish.  All that should be required for Python itself is
that float(repr(x)) == x for (non-nan, non-infinite) floats x.  Does
this seem reasonable to people following this issue?  If it's
controversial I'll take it to python-dev.

Eric's summarized his changes above.  Here are mine (mostly---some
of this has bits of Eric's work in too):

 - change repr(my_float) to produce output with minimal number of
digits, on IEEE 754 big- and little-endian systems (which includes all
systems we can actually get our hands on right now).

 - there's a new file Python/dtoa.c (and a corresponding file
Include/dtoa.h) with a cut-down version of Gay's dtoa and strtod in it.
There are comments at the top of that file indicating the changes that
have been made from Gay's original code.

 - one minor semantic change:  repr(x) changes to exponential format at
1e16 instead of 1e17.  This avoids a strange situation where Gay's code
produces a 16-digit 'shortest' integer string for a particular float and
Python's formatting code then pads with an incorrect '0':

>>> x = 2e16+8.  # 2e16+8. is exactly representable as a float
>>> x
20010.0

There's no way that this padding with bogus digits can happen for
numbers less than 1e16.

--

___
Python tracker 

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



[issue5482] RFC: improve distutils bdist_rpm so it builds pure python modules as single packages that works across architectures

2009-04-07 Thread Rudd-O

Rudd-O  added the comment:

I saw your talk.  Excellent.  Let's make sysadmins and release managers
happy while keeping the excellent buildout infrastructure for
developers.  I KNOW we can do it, and I'm going to help you get there. 
 And maybe next year we both can do a talk about it all.  And kick
everybody's ass.

--

___
Python tracker 

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



[issue1580] Use shorter float repr when possible

2009-04-07 Thread Eric Smith

Eric Smith  added the comment:

My changes on the py3k-short-float-repr branch include:

- Create a new function PyOS_double_to_string. This will replace
PyOS_ascii_formatd. All existing internal uses of PyOS_ascii_formatd
follow this pattern: printf into a buffer to build up the format string,
call PyOS_ascii_formatd, then parse the format string to determine what
to do. The changes to the API are:
  - discrete parameters instead of a printf-like format string. No
parsing is required.
  - returns PyMem_Malloc'd memory instead of writing into a supplied
buffer.
- Modify all callers of PyOS_ascii_formatd to call PyOS_double_to_string
instead. These are:
  - Modules/_pickle.c
  - Objects/complexobject.c
  - Objects/floatobject.c
  - Objects/stringlib/formatter.h
  - Objects/unicodeobject.c
  - Python/marshal.c

Remaining to be done:
- Re-enable 'n' (locale-aware) formatting in float.__format__().
- Decide what to do about the change in meaning of "alt" formatting with
format code 'g' when an exponent is present, also in float.__format__().
- Have marshal.c deal with potential memory failures returned from
PyOS_double_to_string.
- Deprecate PyOS_ascii_formatd.

--

___
Python tracker 

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