[issue4305] ctypes fails to build on mipsel-linux-gnu (detects mips instead of mipsel)

2009-04-17 Thread Joshua Kinard

Joshua Kinard ku...@gentoo.org added the comment:

Is there any movement on this perchance?  Just bumped into this on my
MIPS platform and discovered this bug.

--
nosy: +kumba

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



[issue5776] RPM build error with python-2.6.spec

2009-04-17 Thread Yasushi Iwata

New submission from Yasushi Iwata yasu...@lowlife.jp:

I found some typo and mistakes in python-2.6.spec.

--
components: Demos and Tools
files: python-2.6.spec.patch
keywords: patch
messages: 86056
nosy: yasusii
severity: normal
status: open
title: RPM build error with python-2.6.spec
versions: Python 2.6
Added file: http://bugs.python.org/file13710/python-2.6.spec.patch

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



[issue5777] unable to search in python V3 documentation

2009-04-17 Thread Andreas Otto

New submission from Andreas Otto aotto1...@users.sourceforge.net:

Hi,

  if I search for sys.argv I get


Your search did not match any documents. Please make sure that all words
are spelled correctly and that you've selected enough categories.

but its available at: http://docs.python.org/3.0/library/sys.html

--
assignee: georg.brandl
components: Documentation
messages: 86057
nosy: aotto1968, georg.brandl
severity: normal
status: open
title: unable to search in python V3 documentation
type: resource usage
versions: Python 3.0

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



[issue2531] float compared to decimal is silently incorrect.

2009-04-17 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

On Fri, Apr 17, 2009 at 3:45 AM, Raymond Hettinger
rep...@bugs.python.org wrote:
 Mark, any thoughts?  I would like to apply this patch for ordering
 comparisons other than __eq__ and __ne__.

Hi Raymond,

Sorry for not responding to this sooner. I'll post something to
the issue tracker. In brief, this seems an improvement over
the earlier proposal, just because there are no problems with
hashes or container confusion.  I'm still -0 on it, though---it
just seems like too much magic:  confusion will happen
much more rarely, but it'll be that much more difficult to
explain when it does occur.

IOW I wouldn't do this if it were just up to me, but not going
to object if there's support from you and others.

Mark

--

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



[issue5778] sys.version format differs between MSC and GCC

2009-04-17 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
assignee:  - loewis
nosy: +loewis

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



[issue5779] _elementtree import can fail silently

2009-04-17 Thread Matteo Bertini

New submission from Matteo Bertini matt...@naufraghi.net:

(the patch is old, I forwarded it to Fredrik but I forgot to open the bug)

Playing with PyInstaller I have found that the final part of _elementtree.c:

Index: Modules/_elementtree.c
===
--- Modules/_elementtree.c  (revisione 59540)
+++ Modules/_elementtree.c  (copia locale)
@@ -2780,7 +2780,10 @@

);

-PyRun_String(bootstrap, Py_file_input, g, NULL);
+if (PyRun_String(bootstrap, Py_file_input, g, NULL) == NULL) {
+m = PyErr_Occurred();
+return;
+}

 elementpath_obj = PyDict_GetItemString(g, ElementPath);

executes a bit of python code without checking the return value.
That can lead to weird things playing with import hooks,
for example an assert like this can fail:

Index: Lib/test/test_elemettree.py
===
--- Lib/test/test_elemettree.py (revisione 0)
+++ Lib/test/test_elemettree.py (revisione 0)
@@ -0,0 +1,21 @@
+#! /usr/bin/env python
+
+def importHook(*args, **kwargs):
+if 'xml.etree' in args:
+raise ImportError
+else:
+return __real__import__(*args, **kwargs)
+
+import os
+import __builtin__
+__real__import__ = __builtin__.__import__
+__builtin__.__import__ = importHook
+
+try:
+import xml.etree.cElementTree as cET
+except ImportError:
+pass
+else:
+out = os.popen(python -c 'import xml.etree.cElementTree as cET;
print dir(cET)').read().strip()
+assert str(dir(cET)) == out, (str(dir(cET)), out)
+

Quite a novice with python internals, so comments are welcome.
Matteo Bertini

--
components: XML
messages: 86062
nosy: naufraghi
severity: normal
status: open
title: _elementtree import can fail silently

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



[issue4305] ctypes fails to build on mipsel-linux-gnu (detects mips instead of mipsel)

2009-04-17 Thread Thomas Heller

Thomas Heller thel...@ctypes.org added the comment:

Joshua Kinard schrieb:
 Joshua Kinard ku...@gentoo.org added the comment:
 
 Is there any movement on this perchance?  Just bumped into this on my
 MIPS platform and discovered this bug.

There is no MIPS buildbot at the moment, and I'm unclear which one
of the patches solves the issue.

--
title: ctypes fails to build on mipsel-linux-gnu (detects mips instead of 
mipsel) - ctypes fails to build on mipsel-linux-gnu (detects mipsinstead 
of mipsel)

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



[issue5778] sys.version format differs between MSC and GCC

2009-04-17 Thread Toshihiro Kamiya

New submission from Toshihiro Kamiya t-kam...@aist.go.jp:

The value of sys.version includes a new-line char in GCC build.
'2.5.2 (r252:60911, Oct  5 2008, 19:24:49) \n[GCC 4.3.2]'

MSC build doesn't.
'2.6.2 (r262:71605, Apr 14 2009, 22:46:50) [MSC v.1500 64 bit (AMD64)]'

This seems a kind of pitfall for the developers who use this variable.

--
components: Build
messages: 86060
nosy: t-kamiya
severity: normal
status: open
title: sys.version format differs between MSC and GCC
versions: Python 2.5

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



[issue2531] float compared to decimal is silently incorrect.

2009-04-17 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

I'm not seeing the downside.  This gives better answers than it does now
but doesn't commit us to anything else.

--

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



[issue5779] _elementtree import can fail silently

2009-04-17 Thread Matteo Bertini

Matteo Bertini matt...@naufraghi.net added the comment:

Ups, I duplicated myself... issue3475

--
status: open - closed

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



[issue5780] test_float fails for 'legacy' float repr style

2009-04-17 Thread Mark Dickinson

New submission from Mark Dickinson dicki...@gmail.com:

After:

 CC=gcc -DPY_NO_SHORT_FLOAT_REPR ./configure  make

test_format_testfile in test_float fails with:

test.support.TestFailed: Traceback (most recent call last):
  File Lib/test/test_float.py, line 341, in test_format_testfile
self.assertEqual(fmt % float(arg), rhs)
AssertionError: '1000.0' != '1e+11'

The problem is that for str(float), the new formatting code switches to 
exponential notation at 1e11, not 1e12; the legacy code does not.

A similar issue exists for repr: repr(1e16) should now produce '1e+16'.

--
assignee: marketdickinson
components: Interpreter Core
messages: 86066
nosy: eric.smith, marketdickinson
priority: normal
severity: normal
stage: patch review
status: open
title: test_float fails for 'legacy' float repr style
type: behavior
versions: Python 3.1

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



[issue5780] test_float fails for 'legacy' float repr style

2009-04-17 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

On second thoughts, I think that repr shouldn't change:  'legacy'
repr format should mean that it *is* exactly the same as before,
including the switch at 1e17 instead of 1e16.  Otherwise there will be 3 
possibilities for repr output: 'short' repr, 'legacy' repr and pre-3.1 
repr will all be different.

Here's a new patch, which leaves repr alone and fixes up the Misc/NEWS 
entries accordingly.

--
Added file: http://bugs.python.org/file13712/issue5780.patch

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



[issue5780] test_float fails for 'legacy' float repr style

2009-04-17 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


Removed file: http://bugs.python.org/file13711/issue5780.patch

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



[issue5780] test_float fails for 'legacy' float repr style

2009-04-17 Thread Eric Smith

Eric Smith e...@trueblade.com added the comment:

Also, remove_trailing_zeros should go inside the #ifdef so it's not
included if Gay's code is being used.

--

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



[issue5780] test_float fails for 'legacy' float repr style

2009-04-17 Thread Eric Smith

Eric Smith e...@trueblade.com added the comment:

I agree that there should be 2 behaviors, not 3.

This patch looks okay to me, and tests pass both with and without
defining PY_NO_SHORT_FLOAT_REPR.

One nit: You don't need to use Py_CHARMASK when using the ISDIGIT macro
locally defined in pystrtod.c. On the other hand, that macro (ISDIGIT)
should completely go away. I think it's there because this file is
trying to be locale-unaware, but isdigit from ctype.h is defined as
being locale-unaware (at least on all platforms I have access to and a
search on the net; my copy of C89 is at home and I can't triple-check
just yet).

--

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



[issue2531] float compared to decimal is silently incorrect.

2009-04-17 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

The downside is the potential confusion arising from
using one method (comparison of actual numerical value)
for , =, , =, and a different method (decimals
and floats are never equal) for == and !=.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2531
___
___
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-17 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Closing this.  There are a few known problems remaining, but they've all 
got their own issue numbers:  see issue 5780, issue 4482.

--
resolution:  - accepted
stage:  - committed/rejected
status: open - closed

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



[issue5780] test_float fails for 'legacy' float repr style

2009-04-17 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Here's a patch.  Eric, do you have time to check this over for general 
sanity?

--
keywords: +patch
Added file: http://bugs.python.org/file13711/issue5780.patch

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



[issue5780] test_float fails for 'legacy' float repr style

2009-04-17 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

I seem to recall that despite the C standards, there are platforms around
where isdigit and isxdigit are still locale aware.  This bit me when I 
implemented float.fromhex:  see r65964.

And my man page for isdigit says:

COMPATIBILITY
 The 4.4BSD extension of accepting arguments outside of the range of 
the unsigned char type in locales with large character sets
 is considered obsolete and may not be supported in future releases.  
The iswdigit() function should be used instead.


So I'm tempted to go the other way and say that all uses of isdigit should 
be replaced by ISDIGIT.


I'll fix the Py_CHARMASK and move remove_trailing_zeros inside the ifdef.

--

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



[issue5781] Legacy float repr is used unnecessarily on some platforms

2009-04-17 Thread Mark Dickinson

New submission from Mark Dickinson dicki...@gmail.com:

The current defines in pyport.h mean that we don't use Gay's code
for short float repr if there's evidence of double rounding.

However, there's one situation where double rounding occurs and we can 
still use Gay's code: namely, when the configure script has worked out how 
to get and set the x87 control word.

The pyport.h code should be fixed so that we use Gay's code in that 
situation.

--
assignee: marketdickinson
components: Interpreter Core
keywords: easy
messages: 86073
nosy: eric.smith, marketdickinson
priority: normal
severity: normal
stage: needs patch
status: open
title: Legacy float repr is used unnecessarily on some platforms
type: behavior
versions: Python 3.1

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



[issue5780] test_float fails for 'legacy' float repr style

2009-04-17 Thread Eric Smith

Eric Smith e...@trueblade.com added the comment:

I definitely think that if you go with isdigit, you need the macro. I've
been bitten by this in 3.0.

My actual suggestion is to go with isdigit and the macro everywhere in
this file and all files.

But for just this checkin, ISDIGIT is probably best.

--

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



[issue5782] ',' formatting with empty format type '' (PEP 378)

2009-04-17 Thread Eric Smith

New submission from Eric Smith e...@trueblade.com:

PEP 378 says that the ',' format option applies to types 'd', 'e', 'f',
'g', 'E', 'G', '%' and 'F'. I think this should also be extended to
include the empty type ''.

This only makes a difference for floats. For ints, '' is the same as
'd', but for floats '' is distinct. In 3.1 we get this behavior:

 format(1.2, '010.2')
'0001.2'
 format(1.2, '010,.2')
Traceback (most recent call last):
  File stdin, line 1, in module
ValueError: Cannot specify ',' with ''.

I think the second example should be valid.

--
assignee: eric.smith
components: Interpreter Core
keywords: easy
messages: 86075
nosy: eric.smith, marketdickinson, rhettinger
priority: normal
severity: normal
status: open
title: ',' formatting with empty format type '' (PEP 378)
type: behavior
versions: Python 3.1

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



[issue708320] DistributionMetaData error ?

2009-04-17 Thread Vah Rashim

Vah Rashim d233...@bsnow.net added the comment:

I'm running py2exe on python 2.6 and have this error, too. I'm look 
through distutils/dist.py and read following:

self.metadata = DistributionMetadata()
method_basenames = dir(self.metadata) + \
['fullname', 'contact', 'contact_email']

for basename in method_basenames:
method_name = get_ + basename
setattr(self, method_name, getattr(self.metadata, method_name))

I'm printing dir(self.metadata) and get this lines:
['__doc__', '__init__', '__module__', 'author', 'author_email', 
'description', 'get_author', 'get_author_email', 'get_co
ntact', 'get_contact_email', 'get_description', 'get_fullname', 
'get_keywords', 'get_licence', 'get_long_description', '
get_maintainer', 'get_maintainer_email', 'get_name', 'get_platforms', 
'get_url', 'get_version', 'keywords', 'licence', '
long_description', 'maintainer', 'maintainer_email', 'name', 
'platforms', 'url', 'version', 'write_pkg_info']

code in dist.py trying add all methods from metadata to self, even 
'magic' and getters. I think, that's wrong, because no method like 
get___doc, get_get_contact and other.
I'm solve this problem by adding regexp for checking is this method 
allow for adding to self.

this is my (ugly, i think) code:
for basename in method_basenames:
if re.match(r'(__|get_|write_)\w+', basename) is None: #MY FIXES!
method_name = get_ + basename
setattr(self, method_name, getattr(self.metadata, method_name))

With this change, all py2exe works work correctly (and i don't try 
distutils in other cases).
P.S. i don't know, is this python or py2exe problem: maybe py2exe 
replcae nature python distutils module.

--
nosy: +varash

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



[issue4482] 10e667.__format__('+') should return 'inf'

2009-04-17 Thread Daniel Stutzbach

Daniel Stutzbach dan...@stutzbachenterprises.com added the comment:

I used 'inf' instead of +inf' because the original bug report states
that the docs say it should be 'inf'.

Now that I actually look at the docs, I don't agree with the original
report's interpretation and agree that '+inf' is better.

--

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



[issue3754] minimal cross-compilation support for configure

2009-04-17 Thread Victor Godoy Poluceno

Changes by Victor Godoy Poluceno victorpoluc...@gmail.com:


--
nosy: +victorpoluceno

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3754
___
___
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-17 Thread Thomas Heller

Thomas Heller thel...@ctypes.org added the comment:

Here is a quite large patch (300 lines) against svn trunk that renames a
lot of symbols.
The list of symbols, listed by 'nm -g --defined-only _ctypes.so' is as
follows:

thel...@tubu32:~/devel/trunk$ find . -name _ctypes.so | xargs nm -g
--defined-only
00011d07 T My_PyUnicode_AsWideChar
00011c6e T My_PyUnicode_FromWideChar
000136e2 T PyCArgObject_new
000236e0 D PyCArg_Type
000225a0 D PyCArrayType_Type
f86a T PyCArrayType_from_ctype
00022e40 D PyCArray_Type
b0b0 T PyCData_AtAddress
ae6f T PyCData_FromBaseObj
00022980 D PyCData_Type
b274 T PyCData_get
b82d T PyCData_set
000181bf T PyCField_FromDesc
00023ae0 D PyCField_Type
000227e0 D PyCFuncPtrType_Type
00022b60 D PyCFuncPtr_Type
00022440 D PyCPointerType_Type
00023220 D PyCPointer_Type
00022700 D PyCSimpleType_Type
00023920 D PyCStgDict_Type
0001627a T PyCStgDict_clone
00022200 D PyCStructType_Type
00017223 T PyCStructUnionType_update_stgdict
00023300 D PyCThunk_Type
4fe4 T PyDict_GetItemProxy
4dd1 T PyDict_SetItemProxy
00023e18 B PyExc_ArgError
0001660e T PyObject_stgdict
0001658c T PyType_stgdict
00023de8 A __bss_start
0001221b T _ctypes_add_traceback
00012f75 T _ctypes_alloc_callback
0001d737 T _ctypes_alloc_closure
506e T _ctypes_alloc_format_string
0001469d T _ctypes_callproc
00023dec B _ctypes_conversion_encoding
00023df0 B _ctypes_conversion_errors
000143f5 T _ctypes_extend_error
0001d70a T _ctypes_free_closure
00013318 T _ctypes_get_errobj
00013f41 T _ctypes_get_ffi_type
0001d5be T _ctypes_get_fielddesc
000237c0 D _ctypes_module_methods
00023e14 B _ctypes_ptrtype_cache
b204 T _ctypes_simple_instance
00023de8 A _edata
00023e1c A _end
0001e264 T _fini
3f48 T _init
0001dbda T ffi_call
0001e080 T ffi_call_SYSV
0001d9fc T ffi_prep_args
0001d883 T ffi_prep_cif
0001db62 T ffi_prep_cif_machdep
0001d9ba T ffi_prep_closure
0001de09 T ffi_prep_closure_loc
0001dea0 T ffi_prep_raw_closure_loc
0001df8b T ffi_raw_call
00023a64 D ffi_type_double
00023a58 D ffi_type_float
00023a70 D ffi_type_longdouble
00023a7c D ffi_type_pointer
00023a1c D ffi_type_sint16
00023a34 D ffi_type_sint32
00023a4c D ffi_type_sint64
00023a04 D ffi_type_sint8
00023a10 D ffi_type_uint16
00023a28 D ffi_type_uint32
00023a40 D ffi_type_uint64
000239f8 D ffi_type_uint8
000239ec D ffi_type_void
000115ec T init_ctypes
thel...@tubu32:~/devel/trunk$

doko, loewis, what do you think?

--
keywords: +patch
Added file: http://bugs.python.org/file13713/rename.patch

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



[issue5782] ',' formatting with empty format type '' (PEP 378)

2009-04-17 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

I concur.

--

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



[issue5782] ',' formatting with empty format type '' (PEP 378)

2009-04-17 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Sounds good to me, too.

It looks as though the Decimal type already does this:

Python 3.1a2+ (py3k:71669:71684M, Apr 17 2009, 19:23:53) 
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type help, copyright, credits or license for more information.
 from decimal import Decimal
 format(Decimal('1.2'), '010.2')
'0001.2'
 format(Decimal('1.2'), '010,.2')
'0,000,001.2'

--

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



[issue5782] ',' formatting with empty format type '' (PEP 378)

2009-04-17 Thread Eric Smith

Eric Smith e...@trueblade.com added the comment:

I updated the PEP in r71686. I'll fix the code and add a test after I
backport the entire thing to 2.7.

--

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



[issue5783] IDLE cannot find windows chm file

2009-04-17 Thread Raymond Hettinger

New submission from Raymond Hettinger rhettin...@users.sourceforge.net:

The Doc/Python262.chm file needs to be named Doc/Python26.chm so that
IDLE can find it.  The current release cannot find the chm file at all
so it falls back to the on-line docs at http://www.python.org/doc/current .

--
assignee: benjamin.peterson
components: Build
messages: 86082
nosy: benjamin.peterson, rhettinger
priority: critical
severity: normal
status: open
title: IDLE cannot find windows chm file
versions: Python 2.6

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



[issue5783] IDLE cannot find windows chm file

2009-04-17 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

This also applies to Python31a2.chm -- Python31.chm

--
versions: +Python 3.1

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



[issue5783] IDLE cannot find windows chm file

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

Martin v. Löwis mar...@v.loewis.de added the comment:

It's actually vice versa - IDLE should open the file under its correct name.

--
nosy: +loewis

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



[issue5764] 2.6.2 Python Manuals CHM file seems broken

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

Martin v. Löwis mar...@v.loewis.de added the comment:

On

http://www.python.org/download/releases/2.6.2/

we now provide a fixed version of the CHM file.

--
nosy: +loewis

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



[issue5783] IDLE cannot find windows chm file

2009-04-17 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

What changed here?  ISTM that IDLE was always looking for the same name
and that the new part is that the build procedure has been been changed
(the step where the make htmlhelp output file is moved to ./Doc and
renamed).

--

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



[issue5764] 2.6.2 Python Manuals CHM file seems broken

2009-04-17 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Are you also going to update the original MSI file so that people get a
correct installation straight-away?

--
nosy: +rhettinger

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



[issue1869] Builtin round function is sometimes inaccurate for floats

2009-04-17 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Here's a patch that improves float rounding in a number of respects:

(1) (when available) it uses the recently added correctly-rounded str -
 float conversions in Python/dtoa.c.  This means that:

- round(x, n) finally does what the docs say it does:  rounds x to the 
closest multiple of 10**-n (and then returns the closest float to the
result).

- for n  0, the digits of round(x, n) will always agree with those
  of %.nf % x.

One *really* nice feature is that since e.g. round(x, 2) will always be 
the closest float to a multiple of 0.01, thanks to the recent repr 
changes it'll always be output with at most two places following the 
decimal point, and so will appear to be properly rounded...

Other changes. round(x, n) now:

(2) deals correctly with large values of n

(3) deals correctly with infinities and nans for x

(4) deals correctly with overflow (e.g. round(1.5e308, -308))

(5) doesn't have the weird exception for n = -2**31+1, which was
treated as a single-parameter round.

Still needs tests.  I'm working on them.

--
stage:  - test needed
Added file: http://bugs.python.org/file13714/issue1869.patch

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



[issue1869] Builtin round function is sometimes inaccurate for floats

2009-04-17 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Note that the correctly rounded string-decimal code only
exists in 3.1, so it won't be possible to backport all this good
stuff to 2.7.

--

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



[issue5734] BufferedRWPair broken

2009-04-17 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I've uploaded the patch for code review here:
http://codereview.appspot.com/40126

--

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



[issue5734] Fix BufferedRWPair

2009-04-17 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Reviewers: report_bugs.python.org,

Message:
Here are some comments. In general, I think the changes to _pyio.py are
unwarranted (even though I dislike the naming of _checkReadable and
_checkWritable).

http://codereview.appspot.com/40126/diff/1/2
File Lib/_pyio.py (left):

http://codereview.appspot.com/40126/diff/1/2#oldcode370
Line 370: def _checkReadable(self, msg=None):
Not sure why you're removing it. Currently it's used in Lib/socket.py.

http://codereview.appspot.com/40126/diff/1/2#oldcode384
Line 384: def _checkWritable(self, msg=None):
Same question as for _checkReadable().

http://codereview.appspot.com/40126/diff/1/3
File Lib/test/test_io.py (right):

http://codereview.appspot.com/40126/diff/1/3#newcode1121
Line 1121: self.assertTrue(pair.readable)
This is probably `pair.readable()` and not `pair.readable`.

http://codereview.appspot.com/40126/diff/1/3#newcode1125
Line 1125: self.assertTrue(pair.writable)
Same comment as for readable above.

http://codereview.appspot.com/40126/diff/1/3#newcode1126
Line 1126:
There should probably be a test for seekable() as well.

http://codereview.appspot.com/40126/diff/1/4
File Modules/_io/bufferedio.c (right):

http://codereview.appspot.com/40126/diff/1/4#newcode1876
Line 1876: Py_DECREF(self-reader);
You must use Py_CLEAR so that there is no double free when calling
BufferedRWPair_dealloc().

Please review this at http://codereview.appspot.com/40126

Affected files:
   M Lib/_pyio.py
   M Lib/test/test_io.py
   M Modules/_io/bufferedio.c

--
title: BufferedRWPair broken - Fix BufferedRWPair

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



[issue5773] Crash on shutdown after os.fdopen(2) in debug builds

2009-04-17 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I thought there was a _PyVerify_Fd() just for that, why couldn't it be
used here too?
(not that I think sparkling _PyVerify_Fd() everywhere in our code base
is reasonable and maintainable, but I didn't make that choice :-))

--
nosy: +pitrou

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



[issue1869] Builtin round function is sometimes inaccurate for floats

2009-04-17 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
components: +Interpreter Core

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



[issue5784] raw deflate format and zlib module

2009-04-17 Thread paul rubin

New submission from paul rubin p...@users.sourceforge.net:

The zlib module doesn't support raw deflate format, so it doesn't
completely interoperate with php's gzdeflate function and fails to
decompress some strings that web browsers can decompress.

A workaround is to use a special zlib feature and pass the value -15 as
the wbits arg: 

plaintext = zlib.deflate(compressed_text, wbits=-15)

I don't know if it's appropriate to mess with the code, but at minimum I
urge that the workaround be mentioned in the docs.  We had a tremendous
distruption where I work because of a malicious raw-deflated PHP script
that we couldn't decompress with Python for analysis.  We had to resort
to decompressing in a PHP container that (through my slipping up) it
proceeded to escape from.  

Help us Python-Kenobi, save us from PHP ;-)

--
messages: 86094
nosy: phr
severity: normal
status: open
title: raw deflate format and zlib module

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



[issue5784] raw deflate format and zlib module

2009-04-17 Thread paul rubin

Changes by paul rubin p...@users.sourceforge.net:


--
components: +Library (Lib)
type:  - feature request
versions: +Python 2.5

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



[issue5784] raw deflate format and zlib module

2009-04-17 Thread paul rubin

paul rubin p...@users.sourceforge.net added the comment:

I should have mentioned, the docs do say When wbits is negative, the
standard gzip header is suppressed; this is an undocumented feature of
the zlib library, used for compatibility with unzip‘s compression file
format but this wasn't enough at the time to figure out the issue.  I
suggest adding something like and the 'raw deflate' format supported by
PHP and some web browsers.  

I better see if I can research the exact situation a bit further, for
the sake of documenting it accurately, if others here think it's a good
idea.

--

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



[issue5780] test_float fails for 'legacy' float repr style

2009-04-17 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Committed, with the fixups Eric pointed out, in r71692.

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue5778] sys.version format differs between MSC and GCC

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

Changes by Martin v. Löwis mar...@v.loewis.de:


--
type:  - feature request

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



[issue5778] sys.version format differs between MSC and GCC

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

Changes by Martin v. Löwis mar...@v.loewis.de:


--
priority:  - low

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



[issue5778] sys.version format differs between MSC and GCC

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

Changes by Martin v. Löwis mar...@v.loewis.de:


--
assignee: loewis - 

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



[issue5783] IDLE cannot find windows chm file

2009-04-17 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

It looks like IDLE has been the same since 2004:
 
http://svn.python.org/view/python/trunk/Lib/idlelib/EditorWindow.py?view=diffr1=36600r2=36601

The correct filename is what has changed.  

The release process needs to have a step that validates that the CHM
file works from IDLE.

FWIW, I think the version naming convention is unnecessary and makes the
IDLE linkage too fragile.  It would be better to just always call the
file Python.chm.  By way of comparison, the regular html docs do not get
custom names -- they are just index.html in a doc directory.

--
priority: critical - release blocker
versions: +Python 3.0

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



[issue5783] IDLE cannot find windows chm file

2009-04-17 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Just checked Python2.5.4 and its CHM file is Python25.chm.  So
everything is fine with that release.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5783
___
___
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-17 Thread Martin v. Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Looks fine to me, except that I wouldn't call things My* (but I do
understand that this unrelated to this issue).

--

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



[issue5783] IDLE cannot find windows chm file

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

Martin v. Löwis mar...@v.loewis.de added the comment:

 What changed here?

We switched to sphinx, and the makefiles put the full version into the
output files.

 ISTM that IDLE was always looking for the same name
 and that the new part is that the build procedure has been been changed
 (the step where the make htmlhelp output file is moved to ./Doc and
 renamed).

No, the make htmlhelp output is already called python262.chm. So no
renaming occurs.

--

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



[issue5764] 2.6.2 Python Manuals CHM file seems broken

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

Martin v. Löwis mar...@v.loewis.de added the comment:

 Are you also going to update the original MSI file so that people get a
 correct installation straight-away?

No.

--

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



[issue5783] IDLE cannot find windows chm file

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

Martin v. Löwis mar...@v.loewis.de added the comment:

 The release process needs to have a step that validates that the CHM
 file works from IDLE.

I personally can't perform such testing steps, perhaps unless somebody
maintains a list of such steps for me.

Instead, I think such problems must be detected during beta testing.
The fact that it hasn't been detected so far, even though it existed
since 2.6.0, indicates that the problem can't be that serious.

 FWIW, I think the version naming convention is unnecessary and makes the
 IDLE linkage too fragile.  It would be better to just always call the
 file Python.chm.  By way of comparison, the regular html docs do not get
 custom names

That's not true: they are called e.g.

python-2.6.2-docs-html.tar.bz2
(see http://docs.python.org/download.html)

I believe that the rationale for calling the CHM file that way is the
same as for putting a version number into any other output.

FWIW, the renaming had caused some troubles in the past, but most of
it is over. Renaming it back will cause more troubles for sure.

--

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



[issue5783] IDLE cannot find windows chm file

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

Martin v. Löwis mar...@v.loewis.de added the comment:

 Just checked Python2.5.4 and its CHM file is Python25.chm.  So
 everything is fine with that release.

True. The renaming happened with the switch to sphinx.

--

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