[issue532631] Confusions in formatfloat

2009-02-13 Thread Mark Dickinson

Changes by Mark Dickinson :


--
assignee: nnorwitz -> marketdickinson

___
Python tracker 

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



[issue5216] distutils.tests.test_build_ext.BuildExtTestCase fails when srcdir != builddir

2009-02-13 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Matthias, can you confirm the test passes now on your side, so I close
this issue. Thanks

___
Python tracker 

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



[issue2279] distutils sdist add_defaults does not add data_files

2009-02-13 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

I'll change add_defaults() so it includes package_data.

I don't think though, that MANIFEST.in is an ugly hack. Imho the best
practice is an explicit MANIFEST.in (and not use the .svn browsing
setuptools do)

--
priority:  -> high
resolution:  -> accepted

___
Python tracker 

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



[issue5216] distutils.tests.test_build_ext.BuildExtTestCase fails when srcdir != builddir

2009-02-13 Thread Tarek Ziadé

Changes by Tarek Ziadé :


--
priority:  -> low

___
Python tracker 

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



[issue5201] Using LDFLAGS='-rpath=\$$LIB:/some/other/path' ./configure breaks the build

2009-02-13 Thread Tarek Ziadé

Changes by Tarek Ziadé :


--
priority:  -> normal
versions: +Python 3.1 -Python 2.5

___
Python tracker 

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



[issue2624] swig support in distutils should use the build and temp dirs

2009-02-13 Thread Tarek Ziadé

Changes by Tarek Ziadé :


--
priority:  -> normal

___
Python tracker 

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



[issue5158] Document distutils 'depends' option for extensions

2009-02-13 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Added in r69566,  thanks for the contribution !

--
status: open -> closed

___
Python tracker 

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



[issue5242] eval() function in List Comprehension doesn't work

2009-02-13 Thread Jiafei Peng

New submission from Jiafei Peng :

eval() function in List Comprehension doesn't work.
please see the under codes:

canBusType = 'CANdiag'
result = [eval('canBusType') for i in range(3)]
NameError: name 'canBusType' is not defined

It did work in Python2.5 or 2.6. The expected result is 
['CANdiag', 'CANdiag', 'CANdiag'].

--
messages: 81890
nosy: JiafeiPeng
severity: normal
status: open
title: eval() function in List Comprehension doesn't work
versions: Python 3.0

___
Python tracker 

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



[issue5237] Allow auto-numbered replacement fields in str.format() strings

2009-02-13 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue5242] eval() function in List Comprehension doesn't work

2009-02-13 Thread Hagen Fürstenau

Hagen Fürstenau  added the comment:

I can't reproduce this. For me it works as expected.

--
nosy: +hagen

___
Python tracker 

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



[issue5243] Missing dependency in distutils build

2009-02-13 Thread Patrick Gerken

New submission from Patrick Gerken :

When running the command install_lib, the command build_clib is not run.
If a package contains clibs they can be dependencies for extension libs,
at least that is stated in the module docstring of build_clib.

In real life you can see it when trying to run the command install_lib
on the current reportlab2.3.

The patch provided needs do be applied in the distutils dir directly with

patch install_lib.py dependency.patch

As requested, I asked on the mailing list first, whether this really is
a bug. 
http://mail.python.org/pipermail/distutils-sig/2009-February/010974.html

I am half finished writing a test case, that I'll append to this ticket
later.

--
assignee: tarek
components: Distutils
files: dependency.patch
keywords: patch
messages: 81892
nosy: do3cc, tarek
severity: normal
status: open
title: Missing dependency in distutils build
type: behavior
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7
Added file: http://bugs.python.org/file13064/dependency.patch

___
Python tracker 

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



[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-13 Thread Mark Miller

Mark Miller  added the comment:

This still occurs in the latest SVN checkout, and is preventing Python
from building on ARMV4L and ARMV5L OABI, dying during the test_float.py
compilation. The patch appears to solve this problem, however I have not
run a full suite of tests to ensure it doesn't have any regression issues.

Since this has been broken since 2007, could this be looked at in
getting merged?

--
nosy: +mirell
type:  -> compile error
versions: +Python 2.6, Python 2.7

___
Python tracker 

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



[issue5243] Missing dependency in distutils build

2009-02-13 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

be careful to write your test in distutils (setuptools is not part of
Python)

___
Python tracker 

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



[issue5242] eval() function in List Comprehension doesn't work

2009-02-13 Thread Ezio Melotti

Ezio Melotti  added the comment:

I can't reproduce it either, tested with Py3 (on Linux and Windows) and
with Py2.[456], it worked fine everywhere.

Does your eval() work properly outside listcomps?

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue5242] eval() function in List Comprehension doesn't work

2009-02-13 Thread Jiafei Peng

Jiafei Peng  added the comment:

Hallo Mr. Fürstenau,

thank you for the quick response.
Have you tried it with Python 3.0

The Error report is truely:
NameError: name 'canBusType' is not defined

Someone else reported the same problem in internet too.

Best regards, mit freundlichen Grüßen,

Jiafei Peng

Softwareentwickler / Embedded System Software (EF-F2)
Software developer / Embedded System Software 

IAV GmbH
Nordhoffstr. 5
38518 Gifhorn
GERMANY

Phone: +49 5371  805-2817
Fax:+49 5371  805-1330

E-mail:  
Internet: http://www.iav.de

IAV GmbH
Sitz/Registered Office: Berlin
Registergericht/Registration Court: Amtsgericht Charlottenburg
Registernummer/Company Registration Number: HRB 21 280
Geschäftsführer/Managing Directors: Kurt Blumenröder, Michael Schubert

Hagen Fürstenau  
13.02.2009 10:54
Bitte antworten an
Python tracker 

An
jiafei.p...@iav.de
Kopie

Thema
[issue5242] eval() function in List Comprehension doesn't work 

Hagen Fürstenau  added the comment:

I can't reproduce this. For me it works as expected.

--
nosy: +hagen

___
Python tracker 

___

Added file: http://bugs.python.org/file13065/unnamed

___
Python tracker 

___
Hallo Mr. Fürstenau,

thank you for the quick response.
Have you tried it with Python 3.0

The Error report is truely:
NameError: name 'canBusType'
is not defined

Someone else reported the same problem
in internet too.


Best regards, mit freundlichen Grüßen,

Jiafei Peng

Softwareentwickler / Embedded System Software (EF-F2)
Software developer / Embedded System Software 

IAV GmbH
Nordhoffstr. 5
38518 Gifhorn
GERMANY

Phone: +49 5371  805-2817
Fax:+49 5371  805-1330

E-mail:  ;
Internet: http://www.iav.de

IAV GmbH
Sitz/Registered Office: Berlin
Registergericht/Registration Court: Amtsgericht Charlottenburg
Registernummer/Company Registration Number: HRB 21 280
Geschäftsführer/Managing Directors: Kurt Blumenröder, Michael Schubert
 





Hagen Fürstenau 


13.02.2009 10:54



Bitte antworten an
Python tracker 





An
jiafei.p...@iav.de


Kopie



Thema
[issue5242] eval() function in List
Comprehension doesn't work 









Hagen Fürstenau  added the comment:

I can't reproduce this. For me it works as expected.

--
nosy: +hagen

___
Python tracker 
;
___

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



[issue5242] eval() function in List Comprehension doesn't work

2009-02-13 Thread Jiafei Peng

Jiafei Peng  added the comment:

Yes
it does work properly outside listcomps.

canBusType = 'CANdiag'
result1 = eval('canBusType')
result2 = [eval('canBusType'), eval('canBusType'), eval(
'canBusType')]
result3 = [eval('canBusType') for i in range(3)]

result1 = 'CANdiag'
result2 =['CANdiag' 'CANdiag' 'CANdiag']
for result3:
NameError: name 'canBusType' is not defined

Best regards, mit freundlichen Grüßen,

Jiafei Peng

Softwareentwickler / Embedded System Software (EF-F2)
Software developer / Embedded System Software 

IAV GmbH
Nordhoffstr. 5
38518 Gifhorn
GERMANY

Phone: +49 5371  805-2817
Fax:+49 5371  805-1330

E-mail:  
Internet: http://www.iav.de

IAV GmbH
Sitz/Registered Office: Berlin
Registergericht/Registration Court: Amtsgericht Charlottenburg
Registernummer/Company Registration Number: HRB 21 280
Geschäftsführer/Managing Directors: Kurt Blumenröder, Michael Schubert

Ezio Melotti  
13.02.2009 11:04
Bitte antworten an
Python tracker 

An
jiafei.p...@iav.de
Kopie

Thema
[issue5242] eval() function in List Comprehension doesn't work 

Ezio Melotti  added the comment:

I can't reproduce it either, tested with Py3 (on Linux and Windows) and
with Py2.[456], it worked fine everywhere.

Does your eval() work properly outside listcomps?

--
nosy: +ezio.melotti

___
Python tracker 

___

Added file: http://bugs.python.org/file13066/unnamed

___
Python tracker 

___
Yes
it does work properly outside 
listcomps.

         
  canBusType = 'CANdiag'
         
  result1 = eval('canBusType')
         
  result2 = [eval('canBusType'),
eval('canBusType'),
eval('canBusType')]
         
  result3 = [eval('canBusType')
for
i in
range(3)]

result1 = 'CANdiag'
result2 =['CANdiag'
'CANdiag' 'CANdiag']
for result3:
NameError: name 'canBusType'
is not defined


Best regards, mit freundlichen Grüßen,

Jiafei Peng

Softwareentwickler / Embedded System Software (EF-F2)
Software developer / Embedded System Software 

IAV GmbH
Nordhoffstr. 5
38518 Gifhorn
GERMANY

Phone: +49 5371  805-2817
Fax:+49 5371  805-1330

E-mail:  ;
Internet: http://www.iav.de

IAV GmbH
Sitz/Registered Office: Berlin
Registergericht/Registration Court: Amtsgericht Charlottenburg
Registernummer/Company Registration Number: HRB 21 280
Geschäftsführer/Managing Directors: Kurt Blumenröder, Michael Schubert
 





Ezio Melotti 


13.02.2009 11:04



Bitte antworten an
Python tracker 





An
jiafei.p...@iav.de


Kopie



Thema
[issue5242] eval() function in List
Comprehension doesn't work 









Ezio Melotti  added the comment:

I can't reproduce it either, tested with Py3 (on Linux and Windows) and
with Py2.[456], it worked fine everywhere.

Does your eval() work properly outside listcomps?

--
nosy: +ezio.melotti

___
Python tracker 
;
___

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



[issue5242] eval() function in List Comprehension doesn't work

2009-02-13 Thread Georg Brandl

Georg Brandl  added the comment:

Ezio: this happens inside a function, like this:

def f():
canBusType = 'CANdiag'
result = [eval('canBusType') for i in range(3)]

This is expected, and won't easily fix.  The reason is that list
comprehensions in 3.x use a function namespace "under the hood" (in 2.x,
they were implemented like a simple for loop). Because inner functions
need to know what names to get from what enclosing namespace, the names
referenced in eval() can't come from enclosing functions. They must
either be locals or globals.

Of course, the question to the OP is why eval() is needed anyway.

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



[issue5244] Python 3.0 eval() function in List Comprehension doesn't work

2009-02-13 Thread Georg Brandl

Georg Brandl  added the comment:

Please don't open duplicates.

--
nosy: +georg.brandl
resolution:  -> duplicate
status: open -> closed
superseder:  -> eval() function in List Comprehension doesn't work

___
Python tracker 

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



[issue4894] Docs for urllib.request.HTTPRedirectHandler.redirect_request missing "hdrs" paramether

2009-02-13 Thread Georg Brandl

Georg Brandl  added the comment:

Applied in r69570, r69571.

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



[issue3734] subclassing complex

2009-02-13 Thread Georg Brandl

Georg Brandl  added the comment:

Applied doc patch in r69573.

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



[issue5202] wave.py cannot write wave files into a shell pipeline

2009-02-13 Thread David Jones

David Jones  added the comment:

On 12 Feb 2009, at 09:00, David Jones wrote:

>
> David Jones  added the comment:
>
> The following program does a very basic do-i-get-back-what-i-wrote  
> test.
> sunau can't cope; I am investigating.

I see.  sunau uses mu-law compression by default which makes it non- 
invertable.  How stupid.  Inserting:

 w.setcomptype('NONE', 'Pointless Argument')

just after setframerate fixes the tests so that all 3 modules pass.

Of course, this is still only the most very basic test that one might  
want to do.  And it doesn't cover the case mentioned in this bug  
report anyway.

(drat, just found this, should've sent it yesterday)

___
Python tracker 

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



[issue3613] base64.encodestring does not actually accept strings

2009-02-13 Thread Georg Brandl

Georg Brandl  added the comment:

Applied the patch in r69575.

___
Python tracker 

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



[issue5244] Python 3.0 eval() function in List Comprehension doesn't work

2009-02-13 Thread Jiafei Peng

New submission from Jiafei Peng :

Jiafei Peng  added the comment:

Yes
it does work properly outside listcomps.

canBusType = 'CANdiag'
result1 = eval('canBusType')
result2 = [eval('canBusType'), eval('canBusType'), eval(
'canBusType')]
result3 = [eval('canBusType') for i in range(3)]

result1 = 'CANdiag'
result2 =['CANdiag' 'CANdiag' 'CANdiag']
for result3:
NameError: name 'canBusType' is not defined

Best regards, mit freundlichen Grüßen,
Jiafei Peng
IAV GmbH
Nordhoffstr. 5
38518 Gifhorn
GERMANY
Phone: +49 5371  805-2817
Fax:+49 5371  805-1330

Ezio Melotti  
13.02.2009 11:04
Bitte antworten an
Python tracker 

An
jiafei.p...@iav.de
Kopie

Thema
[issue5242] eval() function in List Comprehension doesn't work 

Ezio Melotti  added the comment:

I can't reproduce it either, tested with Py3 (on Linux and Windows) and
with Py2.[456], it worked fine everywhere.

Does your eval() work properly outside listcomps?

--
messages: 81899
nosy: JiafeiPeng
severity: normal
status: open
title: Python 3.0 eval() function in List Comprehension doesn't work

___
Python tracker 

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



[issue1537445] urllib2 httplib _read_chunked timeout

2009-02-13 Thread Georg Brandl

Georg Brandl  added the comment:

I agree.

--
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue1661108] base64.urlsafe_b64encode() shouldn't use the = character

2009-02-13 Thread Georg Brandl

Georg Brandl  added the comment:

Added a short note in r69576.

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



[issue3694] Undetected error in _struct.pack_into

2009-02-13 Thread Georg Brandl

Georg Brandl  added the comment:

Applied in r69577, r69578.

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



[issue5208] urllib2.build_opener([handler, ...]) incorrect signature in docs

2009-02-13 Thread Georg Brandl

Georg Brandl  added the comment:

Why is that ambiguous? Can you come up with a better short form?

___
Python tracker 

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



[issue5208] urllib2.build_opener(

2009-02-13 Thread Senthil

Senthil  added the comment:

And that is how it is at all others places too.  Optionals are placed inside [].

--
nosy: +orsenthil
title: urllib2.build_opener([handler, ...]) incorrect signature in docs -> 
urllib2.build_opener(

___
Python tracker 

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



[issue5237] Allow auto-numbered replacement fields in str.format() strings

2009-02-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

+1 for the general idea from me too, assuming that all the details can
be worked out in a sane manner.

Is it worth opening a discussion about this on comp.lang.python?

--
nosy: +marketdickinson

___
Python tracker 

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



[issue3694] Undetected error in _struct.pack_into

2009-02-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

> BTW, there's a warning in _struct.c:180 -> warning: ‘get_ulong’
> defined but not used, should I open a new issue?

Sure.  Please could you add me to the nosy list if you do.

In my opinion, the struct module *really* needs an overhaul, especially
for py3k; there's a lot of inconsistency in the behaviour with respect
to different integer types, and there's a lot of code that seems to be
there purely for backwards compatibility that could be removed for 3.1
(and probably for 2.7 as well):  for example, allowing floats when
packing integer types, and allowing overflow to wraparound rather than
raising an exception.

Would it be worth opening a general 'overhaul the struct module' issue
and marking all the current struct bugs as dependencies for this issue?

___
Python tracker 

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



[issue5245] PyRun_SimpleStringFlags() documentation

2009-02-13 Thread Rogi

New submission from Rogi :

From teh docs:
http://docs.python.org/c-api/veryhigh.html

int PyRun_SimpleStringFlags(const char *command, PyCompilerFlags *flags)¶
Executes the Python source code from command in the __main__ module
according to the flags argument. If __main__ does not already exist, it
is created. Returns 0 on success or -1 if an exception was raised. If
there was an error, there is no way to get the exception information.
For the meaning of flags, see below.

In case of a SystemExit it will not return. This detail, along another
issue with Py_Main() and SystemExit, made me google around for a while.

--
assignee: georg.brandl
components: Documentation
messages: 81912
nosy: Rogi, georg.brandl
severity: normal
status: open
title: PyRun_SimpleStringFlags() documentation
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



[issue5214] Add KOI8-RU as a known encoding

2009-02-13 Thread Dwayne Bailey

Dwayne Bailey  added the comment:

@haypo: The encoding works and doesn't throw and error, my guess is that
aliases should be updated to cover the variant namings of -R and -U.

I also found glibc points to this reference
http://cad.ntu-kpi.kiev.ua/multiling/koi8-ru/ which seems to have
disappeared.  I couldn't find a way to validate that the glibc code
points where the same as the ones you have.

My iconv --version is 2.9

Apart from that I can't vouch for its correctness

@lemburg: I can't comment on the status of the standard.  I would assume
that like most 8 bit encodings that these are falling away and being
replaced by Unicode.

Why I'm interested in these issues is that our Python tools are used to
recover translations from installed .mo files on Linux.  I look for
encoding issues on a semi-regularly basis and fix any ones that present
issues. This is the first I've found that is missing in Python.

For us its useful in that we present a path for people to move from an
old encoding into Unicode if needed.

___
Python tracker 

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



[issue3992] removed custom log from distutils

2009-02-13 Thread Tarek Ziadé

Changes by Tarek Ziadé :


--
priority:  -> normal

___
Python tracker 

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



[issue3985] removed string module from distutils [patch]

2009-02-13 Thread Tarek Ziadé

Changes by Tarek Ziadé :


--
priority:  -> normal

___
Python tracker 

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



[issue5227] Py_Main() does not return on sys.exit()

2009-02-13 Thread Rogi

Changes by Rogi :


--
assignee:  -> georg.brandl
components: +Documentation -None
nosy: +georg.brandl

___
Python tracker 

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



[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

I'll take a look at this, provided Tim doesn't mind me stealing his
issue.  (Please steal it back if so.)

Mark, could you please post the output from test_float?

--
assignee: tim_one -> marketdickinson
nosy: +marketdickinson

___
Python tracker 

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



[issue5216] distutils.tests.test_build_ext.BuildExtTestCase fails when srcdir != builddir

2009-02-13 Thread Matthias Klose

Matthias Klose  added the comment:

no, still seen on the branches. I'll have a look at backporting these
changes to the 2.6 branch before 2.6.2.

--
versions:  -Python 2.7, Python 3.1

___
Python tracker 

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



[issue5186] Reduce hash collisions for objects with no __hash__ method

2009-02-13 Thread Mark Dickinson

Changes by Mark Dickinson :


Removed file: http://bugs.python.org/file12978/time_object_hash.py

___
Python tracker 

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



[issue5240] time.strptime fails to match data and format with Unicode whitespaces (Py3)

2009-02-13 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

By quick observation, I found this problem goes away if following change
is applied.

Index: Lib/_strptime.py
===
--- Lib/_strptime.py(revision 69496)
+++ Lib/_strptime.py(working copy)
@@ -262,7 +262,7 @@
 
 def compile(self, format):
 """Return a compiled re object for the format string."""
-return re_compile(self.pattern(format), IGNORECASE | ASCII)
+return re_compile(self.pattern(format), IGNORECASE)
 
 _cache_lock = _thread_allocate_lock()
 # DO NOT modify _TimeRE_cache or _regex_cache without acquiring the
cache lock

But this is just an observation. I don't call this *fix* because I'm not
familier with unicode, this change might cause another problem if applied.

--
dependencies: +re.IGNORECASE not Unicode-ready
nosy: +ocean-city

___
Python tracker 

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



[issue5216] distutils.tests.test_build_ext.BuildExtTestCase fails when srcdir != builddir

2009-02-13 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

can you tell where xxmodule.c is in your installation ?

(in 'builddir' ?)

___
Python tracker 

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



[issue5242] eval() function in List Comprehension doesn't work

2009-02-13 Thread Tim Gordon

Tim Gordon  added the comment:

If you know what variable you are going to be eval-ing, or at least, 
have a list of those that might be eval-ed, you can get around this 
issue by making sure they are explicitly referenced in the inner scope 
(i.e., in the list comprehension).  For example, even though list 
comprehensions work in 2.x, generator expressions don't, but this hack 
does (on 2.4 at least):

def f():
  canBusType = 'CANdiag'
  return (eval('canBusType') for i in range(3) if True or canBusType)

By putting a semantically vacuous reference to canBusType (and any 
other variables you want) you make sure they are usable from within the 
eval as well.

--
nosy: +QuantumTim

___
Python tracker 

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



[issue5240] time.strptime fails to match data and format with Unicode whitespaces (Py3)

2009-02-13 Thread Ezio Melotti

Ezio Melotti  added the comment:

I think you have found the problem, strptime probably uses \s with the
re.ASCII flag and fails to match all the Unicode whitespaces:
>>> l
['\x1c', '\x1d', '\x1e', '\x1f', '%', '\x85', '\xa0', '\u1680',
'\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006',
'\u2007', '\u2008', '\u2009', '\u200a', '\u200b', '\u2028', '\u2029',
'\u202f', '\u205f', '\u3000']
>>> [bool(re.match('^\s$', char, re.ASCII)) for char in l]
[False, False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False, False,
False, False, False, False, False]
>>> [bool(re.match('^\s$', char)) for char in l]
[True, True, True, True, False, True, True, True, True, True, True,
True, True,True, True, True, True, True, True, True, True, True, True,
True, True]

This bug is then related #5239 and the proposed fix should work for both.
We can close this as duplicate and include this problem in #5239.

Good work!

___
Python tracker 

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



[issue5237] Allow auto-numbered replacement fields in str.format() strings

2009-02-13 Thread Eric Smith

Eric Smith  added the comment:

The attached file is a mostly working version that inherits from
string.Formatter. It has the following shortcomings, which would all be
addressed if we go forward:

- Doesn't handle escaping '{' or '}'
- Doesn't handle conversion specifiers, like '!s'

These are all a function of me being too lazy to write a complete
parser. If anyone really wants them, I could add them. But this is just
a proof of concept.

Admittedly this isn't a drop-in replacement for ''.format(), but it
should give a taste of what using it would be like.

Added file: http://bugs.python.org/file13067/auto_number_formatter.py

___
Python tracker 

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



[issue5186] Reduce hash collisions for objects with no __hash__ method

2009-02-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

> Apart from the misindentation 

Apologies.  My fault for editing Python files while at work, with a
substandard editor configuration...

> have you run the benchmark script with it?

I have now.  See attached file for 3 sets of results (original, xor
version, and rotate) on 64-bit Linux/Core 2 Duo.

Summary: rotate is uniformly and significantly faster than xor;  xor is
uniformly and significantly faster than the unpatched version.

Added file: http://bugs.python.org/file13068/linux_x86_64_timings.txt

___
Python tracker 

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



[issue5186] Reduce hash collisions for objects with no __hash__ method

2009-02-13 Thread Mark Dickinson

Changes by Mark Dickinson :


Added file: http://bugs.python.org/file13069/pointer_hash5_xor.patch

___
Python tracker 

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



[issue5186] Reduce hash collisions for objects with no __hash__ method

2009-02-13 Thread Mark Dickinson

Changes by Mark Dickinson :


Added file: http://bugs.python.org/file13070/pointer_hash5_rotate.patch

___
Python tracker 

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



[issue5186] Reduce hash collisions for objects with no __hash__ method

2009-02-13 Thread Mark Dickinson

Changes by Mark Dickinson :


Removed file: http://bugs.python.org/file13054/pointer_hash5.patch

___
Python tracker 

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



[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-13 Thread Mark Miller

Mark Miller  added the comment:

The following is where it fails un-patched:

Compiling /usr/local/lib/python2.6/test/test_float.py ...
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/compileall.py", line 156, in 
exit_status = int(not main())
  File "/usr/local/lib/python2.6/compileall.py", line 146, in main
force, rx, quiet):
  File "/usr/local/lib/python2.6/compileall.py", line 83, in compile_dir
if not compile_dir(fullname, maxlevels - 1, dfile, force, rx, quiet):
  File "/usr/local/lib/python2.6/compileall.py", line 65, in compile_dir
ok = py_compile.compile(fullname, None, dfile, True)
  File "/usr/local/lib/python2.6/py_compile.py", line 138, in compile
marshal.dump(codeobject, fc)
ValueError: unmarshallable object
make: *** [libinstall] Error 1

This is both on armv4l and armv5l OABI.

___
Python tracker 

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



[issue5186] Reduce hash collisions for objects with no __hash__ method

2009-02-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, so the rotate version is really significantly faster (and, as Adam
pointed out, it's also theoretically better).

___
Python tracker 

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



[issue5240] time.strptime fails to match data and format with Unicode whitespaces (Py3)

2009-02-13 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

OK, I'll close this entry as duplicated.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> time.strptime("2009", "%Y") raises a value error

___
Python tracker 

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



[issue5246] test.test_hashlib.HashLibTestCase fails on darwin

2009-02-13 Thread Tarek Ziadé

New submission from Tarek Ziadé :

The check_no_unicode('md5') fails under darwin (in the trunk)

(Pdb) hashlib.md5(u'spam')   <--- suppose to raise a TypeError here

(Pdb) hashlib.md5('spam') 



traceback :

==
FAIL: test_no_unicode (test.test_hashlib.HashLibTestCase)
--
Traceback (most recent call last):
  File
"/Volumes/MacDev/svn.python.org/python-trunk2/Lib/test/test_hashlib.py",
line 75, in test_no_unicode
self.check_no_unicode('md5')
  File
"/Volumes/MacDev/svn.python.org/python-trunk2/Lib/test/test_hashlib.py",
line 71, in check_no_unicode
self.assertRaises(TypeError, getattr(hashlib, algorithm_name), u'spam')
AssertionError: TypeError not raised

--
components: Library (Lib)
messages: 81925
nosy: tarek
severity: normal
status: open
title: test.test_hashlib.HashLibTestCase fails on darwin
versions: Python 2.7

___
Python tracker 

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



[issue5242] eval() function in List Comprehension doesn't work

2009-02-13 Thread Ezio Melotti

Ezio Melotti  added the comment:

eval() is probably already an hack, there's no need to add another hack
to make it work. It's better to just get rid of eval() and find a better
way to do what you want to do.

___
Python tracker 

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



[issue5186] Reduce hash collisions for objects with no __hash__ method

2009-02-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

Antoine, please check in a patch of your choice.  I think we've beaten
this issue to death already. :-)

___
Python tracker 

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



[issue5186] Reduce hash collisions for objects with no __hash__ method

2009-02-13 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee:  -> pitrou

___
Python tracker 

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



=?utf-8?q?[issue5239]_time.strptime("=EF=BC=92=EF=BC=90=EF=BC=90=EF=BC=99", _"%Y")_raises_a_value_error?=

2009-02-13 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

This patch comes from issue5240. I think testcase is needed. I'll try if
I can.

--
dependencies: +re.IGNORECASE not Unicode-ready
keywords: +patch
nosy: +ocean-city
Added file: http://bugs.python.org/file13071/remove_ascii_flag.patch

___
Python tracker 

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



[issue5239] Change time.strptime() to make it work with Unicode chars

2009-02-13 Thread Ezio Melotti

Changes by Ezio Melotti :


--
title: time.strptime("2009", "%Y") raises a value error -> Change 
time.strptime() to make it work with Unicode chars

___
Python tracker 

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



[issue2834] re.IGNORECASE not Unicode-ready

2009-02-13 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue5246] test.test_hashlib.HashLibTestCase fails on darwin

2009-02-13 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +ebfe, gregory.p.smith

___
Python tracker 

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



[issue5186] Reduce hash collisions for objects with no __hash__ method

2009-02-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

pointer_hash5_rotate.patch has been committed to trunk and py3k. Thanks!

___
Python tracker 

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



[issue5186] Reduce hash collisions for objects with no __hash__ method

2009-02-13 Thread Antoine Pitrou

Changes by Antoine Pitrou :


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



[issue5237] Allow auto-numbered replacement fields in str.format() strings

2009-02-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Unfortunately, `'{d}{s}{f}'.format(3, 'foo', 3.14)` can't work as you
expect it to, because it already means "display the keyword arguments
named `d`, `s` and `f`.

(I agree that the syntax for format() strings is exceedingly tedious)

On the other hand, `'{:d}{:s}{:f}'.format(3, 'foo', 3.14)` should be
possible.

--
nosy: +pitrou

___
Python tracker 

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



[issue5247] Unhelpful error message with str.format()

2009-02-13 Thread Antoine Pitrou

New submission from Antoine Pitrou :

>>> "{0:f}".format(2.5)
'2.50'
>>> "{0:f}".format("spam")
Traceback (most recent call last):
  File "", line 1, in 
ValueError: Unknown conversion type f

The error message should mention the type of the argument that doesn't
support the given conversion type (e.g. "Unknown conversion type f for
object of type 'float'"). Otherwise it can be very confusing.

--
components: Interpreter Core
messages: 81931
nosy: pitrou
priority: normal
severity: normal
status: open
title: Unhelpful error message with str.format()
type: behavior
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1

___
Python tracker 

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



[issue5239] Change time.strptime() to make it work with Unicode chars

2009-02-13 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Hmm, this fails on python2 too. Maybe re.ASCII is added for backward
compatibility? Again, I'm not familiar with unicode, so I won't call
remove_ascii_flag.patch as *fix*.

--
nosy: +pitrou

___
Python tracker 

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



[issue5246] test.test_hashlib.HashLibTestCase fails on darwin

2009-02-13 Thread Lukas Lueg

Lukas Lueg  added the comment:

test_case_md5_0 (__main__.HashLibTestCase) ... ok
test_case_md5_1 (__main__.HashLibTestCase) ... ok
test_case_md5_2 (__main__.HashLibTestCase) ... ok
test_case_md5_huge (__main__.HashLibTestCase) ... ok
test_case_md5_uintmax (__main__.HashLibTestCase) ... ok
test_case_sha1_0 (__main__.HashLibTestCase) ... ok
test_case_sha1_1 (__main__.HashLibTestCase) ... ok
test_case_sha1_2 (__main__.HashLibTestCase) ... ok
test_case_sha1_3 (__main__.HashLibTestCase) ... ok
test_case_sha224_0 (__main__.HashLibTestCase) ... ok
test_case_sha224_1 (__main__.HashLibTestCase) ... ok
test_case_sha224_2 (__main__.HashLibTestCase) ... ok
test_case_sha224_3 (__main__.HashLibTestCase) ... ok
test_case_sha256_0 (__main__.HashLibTestCase) ... ok
test_case_sha256_1 (__main__.HashLibTestCase) ... ok
test_case_sha256_2 (__main__.HashLibTestCase) ... ok
test_case_sha256_3 (__main__.HashLibTestCase) ... ok
test_case_sha384_0 (__main__.HashLibTestCase) ... ok
test_case_sha384_1 (__main__.HashLibTestCase) ... ok
test_case_sha384_2 (__main__.HashLibTestCase) ... ok
test_case_sha384_3 (__main__.HashLibTestCase) ... ok
test_case_sha512_0 (__main__.HashLibTestCase) ... ok
test_case_sha512_1 (__main__.HashLibTestCase) ... ok
test_case_sha512_2 (__main__.HashLibTestCase) ... ok
test_case_sha512_3 (__main__.HashLibTestCase) ... ok
test_hexdigest (__main__.HashLibTestCase) ... ok
test_large_update (__main__.HashLibTestCase) ... ok
test_no_unicode (__main__.HashLibTestCase) ... ok
test_unknown_hash (__main__.HashLibTestCase) ... ok

--
Ran 29 tests in 0.399s

OK
[22842 refs]


mac-lueg:py27 llueg$ ./python.exe 
Python 2.7a0 (trunk:69584, Feb 13 2009, 15:12:58) 
[GCC 4.0.1 (Apple Inc. build 5484)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
[36860 refs]
>>> hashlib.md5(u'spam')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: Unicode-objects must be encoded before hashing
[36893 refs]

___
Python tracker 

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



[issue5239] Change time.strptime() to make it work with Unicode chars

2009-02-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Hmm, this fails on python2 too. Maybe re.ASCII is added for backward
> compatibility? Again, I'm not familiar with unicode, so I won't call
> remove_ascii_flag.patch as *fix*.

re.ASCII was added to many stdlib modules because I wanted to minimize
the potential for breakage when I converted the re library to use
unicode matching by default.

If it is desireable for strptime() and friends to match unicode digits
as well as pure-ASCII digits (which sounds like a reasonable request to
me), then re.ASCII can probably be dropped without any regret.

(py3k doesn't have to be 100% compatible with python2 :-))

___
Python tracker 

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



[issue5237] Allow auto-numbered replacement fields in str.format() strings

2009-02-13 Thread David W. Lambert

David W. Lambert  added the comment:

Answering first question msg81873.

Without colon separator, this might be considered confusing:

>>> (
... '{d}{s}{f}{f}'.format(3, 'foo', 3.14, 2.72),
... '{d}{s}{f}{f}'.format(d=3, s='foo', f=3.14)
... )
('3foo3.142.72', '3foo3.143.14')

___
Python tracker 

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



[issue5246] test.test_hashlib.HashLibTestCase fails on darwin

2009-02-13 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

I have rebuilt a fresh trunk from scratch and it is not reproductible
anymore. It was my environment with no doubt.

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue5246] test.test_hashlib.HashLibTestCase fails on darwin

2009-02-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Perhaps it's because of missing dependencies in the Makefile?
(just trying to guess)

--
nosy: +pitrou

___
Python tracker 

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



[issue5239] Change time.strptime() to make it work with Unicode chars

2009-02-13 Thread Ezio Melotti

Ezio Melotti  added the comment:

I think Py3 with re.ASCII is the same as Py2 without re.UNICODE (and Py3
without re.ASCII is the same as Py2 with re.UNICODE).

It's probably a good idea to have a coherent behavior between Py2 and
Py3, so if we remove re.ASCII from Py3 we should add re.UNICODE to Py2.

___
Python tracker 

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



[issue5239] Change time.strptime() to make it work with Unicode chars

2009-02-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le vendredi 13 février 2009 à 14:44 +, Ezio Melotti a écrit :
> It's probably a good idea to have a coherent behavior between Py2 and
> Py3, so if we remove re.ASCII from Py3 we should add re.UNICODE to Py2.

Removing re.ASCII in py3k is a no-brainer, because unicode is how
strings work by default.
On the other hand, strings in 2.x are 8-bit, so it would probably be
better to keep strptime as is.
As I said, py3k doesn't have to be compatible with 2.x, that's even the
whole point of it.

___
Python tracker 

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



[issue5247] Unhelpful error message with str.format()

2009-02-13 Thread David W. Lambert

Changes by David W. Lambert :


--
nosy: +LambertDW

___
Python tracker 

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



[issue5239] Change time.strptime() to make it work with Unicode chars

2009-02-13 Thread Ezio Melotti

Ezio Melotti  added the comment:

> Removing re.ASCII in py3k is a no-brainer, because unicode is how
> strings work by default.

I meant from the line 265 of _strptime.py, not from Python :P

___
Python tracker 

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



[issue5239] Change time.strptime() to make it work with Unicode chars

2009-02-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> > Removing re.ASCII in py3k is a no-brainer, because unicode is how
> > strings work by default.
> 
> I meant from the line 265 of _strptime.py, not from Python :P

That's what I understood.

___
Python tracker 

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



[issue5248] Adding T_SIZET to structmember.h

2009-02-13 Thread Lisandro Dalcin

New submission from Lisandro Dalcin :

structmember.h lacks a 'T_SIZET' define in order to properly support
struct fields of type 'size_t'  within PyMemberDef.

If this feature request is accepted, I can provide the patches. 

For 2.7, It would be nice to do:

#define T_SIZET  20  /* size_t */

However, this value is already used in 3.0 for 'T_NONE'. Perhaps T_NONE
should be backported to 2.7?

To avoid future merge conflicts, I would vote for this definition:

#define T_SIZET  21  /* size_t */

--
components: Interpreter Core
messages: 81942
nosy: dalcinl, marketdickinson
severity: normal
status: open
title: Adding T_SIZET to structmember.h
type: feature request
versions: Python 2.7, Python 3.1

___
Python tracker 

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



[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

Thanks, Mark.

A few comments:

- The patch seems incomplete.  There are other places in the source tree 
that care about endianness.  I haven't done a thorough search, but the 
native endianness support in the struct module comes to mind.  There are 
also some more obscure places---for example, there's at least one piece of 
code (in Python/compile.c) that tries to distinguish between the doubles 
0.0 and -0.0 by looking only at the first and last bytes of the double, 
and that doesn't work for this particular mixed-endian format.
I guess the patch could go in as it is, but adding only partial support 
for mixed-endian doubles seems dangerous.

- I know very little about ARM, so please correct me if I'm talking 
rubbish here.  But if I understand correctly, this mixed-endian format is 
only an issue for the old ABI, and isn't relevant for the newer "Embedded" 
ABIs.  So the need for this is likely to diminish over the next few years.  
Is that correct?

- Adding support for mixed-endian doubles probably has to be considered a 
new feature, so could not go in until 2.7, which is probably still a good 
few months away (I'm guessing a year or more, but there's no roadmap at 
the moment).

How prevalent is the old ABI?  How widespread do you think it's likely to 
be in, say, 3 or 5 years' time?  Is there going to be a real need to be 
able to run Python 2.7 and Python 3.1 on mixed-endian platforms?

I'm -1 on adding mixed-endian support, especially if all that's gained is 
an ability to deal with infinities, nans and signed zeros.  It would mean 
adding a significant amount of code that's going to be awkward to maintain 
and test, and that seems likely to become redundant within a few years.

I'd upgrade that -1 to a -0 in the presence: of (1) an OABI ARM buildbot, 
(2) a developer who's available to do testing on ARM, and (3) a more 
complete patch.

___
Python tracker 

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



[issue5248] Adding T_SIZET to structmember.h

2009-02-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Do we really want size_t or rather Py_ssize_t?

--
nosy: +pitrou

___
Python tracker 

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



[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

> native endianness support in the struct module comes to mind

Sorry:  ignore that.  The patch already covers this, since the struct 
module just uses _PyFloat_{Unp,P}ack8.

___
Python tracker 

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



[issue5249] Fix strftime on windows.

2009-02-13 Thread Hirokazu Yamamoto

New submission from Hirokazu Yamamoto :

On windows, format string should be encoded as mbcs. Otherwise, result
of strftime would be broken. Here is the patch.

--
components: Extension Modules, Windows
files: fix_strftime_on_windows.patch
keywords: patch
messages: 81946
nosy: ocean-city
severity: normal
stage: commit review
status: open
title: Fix strftime on windows.
type: behavior
versions: Python 3.0, Python 3.1
Added file: http://bugs.python.org/file13072/fix_strftime_on_windows.patch

___
Python tracker 

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



[issue5237] Allow auto-numbered replacement fields in str.format() strings

2009-02-13 Thread Eric Smith

Eric Smith  added the comment:

Right. The colon would be required if there's a format specifier. Or an
exclamation if there's just a conversion specifier:

"{!r}{:f}{!s:^10}".format('foo', 3, 10)
would give:
"'foo'3.0010"

I've attached a new version that includes format specifiers.

Added file: http://bugs.python.org/file13073/auto_number_formatter_1.py

___
Python tracker 

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



[issue5239] Change time.strptime() to make it work with Unicode chars

2009-02-13 Thread Ezio Melotti

Ezio Melotti  added the comment:

Sorry, I misunderstood the meaning of "no-brainer".

If we add re.UNICODE on Py2, strptime should work fine with unicode
strings, but it could fail somehow with normal strings. Is it more
important to provide a way to use Unicode chars that works only with
unicode strings or to have a coherent behavior between str and unicode?

I don't think that adding re.UNICODE will break any existing code, but
it may cause problems if someone tries to use encoded str instead of
unicode (but shouldn't work already).

Also note that encoded strings should be a problem only if they have to
match a strptime directive (e.g. %Y), the other chars should be compared
as they are, so it should work with str and unicode as long as they are
not mixed (I think that whitespaces are treated differently though).

I'll try to add re.UNICODE and see what happens.

___
Python tracker 

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



[issue5239] Change time.strptime() to make it work with Unicode chars

2009-02-13 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

I added test. But this requires issue5249 fix to be passed on windows.

(I used "\u3000" instead of "\xa0" because "\xa0" cannot be decoded on
windows mbcs)

--
dependencies: +Fix strftime on windows.
Added file: http://bugs.python.org/file13074/remove_ascii_flag.patch

___
Python tracker 

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



[issue5239] Change time.strptime() to make it work with Unicode chars

2009-02-13 Thread Hirokazu Yamamoto

Changes by Hirokazu Yamamoto :


Removed file: http://bugs.python.org/file13071/remove_ascii_flag.patch

___
Python tracker 

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



[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2009-02-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

We still need to fix the compile failure somehow, though...

Mark, is there any way you can isolate the test(s) in test_float that are 
causing compile failure?  I'm suspicious of test_inf_as_str and 
test_nan_as_str.  Does test_float compile if you remove these two tests?

___
Python tracker 

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



[issue5249] Fix strftime on windows.

2009-02-13 Thread Hirokazu Yamamoto

Changes by Hirokazu Yamamoto :


--
priority:  -> high

___
Python tracker 

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



[issue5237] Allow auto-numbered replacement fields in str.format() strings

2009-02-13 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

All I am requesting is that
'{} {} {}'.format(3, 'pi', 3.14) work as

>>> '%s %s %s' % (3, 'pi', 3.14)
'3 pi 3.14'
>>> '{0} {1} {2}'.format(3, 'pi', 3.14)
'3 pi 3.14'

do today (3.0).

I should note that the difference between typing {}, which is easy, and
{1}, is more than just one keystroke because the latter requires
unshift-1-shift

___
Python tracker 

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



[issue5239] Change time.strptime() to make it work with Unicode chars

2009-02-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> If we add re.UNICODE on Py2, strptime should work fine with unicode
> strings, but it could fail somehow with normal strings. Is it more
> important to provide a way to use Unicode chars that works only with
> unicode strings or to have a coherent behavior between str and unicode?

I'd say the latter, since str and unicode are often interchangeable in
2.x.

___
Python tracker 

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



[issue5248] Adding T_SIZET to structmember.h

2009-02-13 Thread Lisandro Dalcin

Lisandro Dalcin  added the comment:

In 2.6 and 3.0, we already have 'Py_ssize_t', see 'T_PYSSIZET'
definition on Include/structmember.h. I'm asking for 'size_t' support.

___
Python tracker 

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



[issue5148] gzip.open breaks with 'U' flag

2009-02-13 Thread Radek

Radek  added the comment:

Same bug in 2.5, I don't know if the patch applies to 2.5

--
nosy: +radek768

___
Python tracker 

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



[issue5249] Fix strftime on windows.

2009-02-13 Thread Kevin Watters

Changes by Kevin Watters :


--
nosy: +kevinwatters

___
Python tracker 

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



[issue5218] Check for tp_iter in ceval:ext_do_call before overriding exception message

2009-02-13 Thread Guilherme Polo

Changes by Guilherme Polo :


Removed file: 
http://bugs.python.org/file13035/check_tpiter_before_overriding_msg.diff

___
Python tracker 

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



[issue5248] Adding T_SIZET to structmember.h

2009-02-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> In 2.6 and 3.0, we already have 'Py_ssize_t', see 'T_PYSSIZET'
> definition on Include/structmember.h. I'm asking for 'size_t' support.

Oops, sorry for the noise then.

___
Python tracker 

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



[issue5250] Document __instancecheck__ and __subclasscheck__

2009-02-13 Thread Terry J. Reedy

New submission from Terry J. Reedy :

http://www.python.org/dev/peps/pep-3119/#overloading-isinstance-and-issubclass
(GvR and Talin)
"The primary mechanism proposed here is to allow overloading the
built-in functions isinstance() and issubclass(). The overloading works
as follows: The call isinstance(x, C) first checks whether
C.__instancecheck__ exists, and if so, calls C.__instancecheck__(x)
instead of its normal implementation. Similarly, the call issubclass(D,
C) first checks whether C.__subclasscheck__ exists, and if so, calls
C.__subclasscheck__(D) instead of its normal implementation."

These two new special methods are not documented (for 3.x at least.  A
post on python-list today verifies that at least .__instancecheck__ was
implemented (version not specified).  I assume .__subclasscheck__ was
also.  This issue perhaps applies to 2.6/2.7 also.

I suggest either adding "Customizing instance and subclass checks" after
"Customizing class creation" or add to that section and rename it to
"Customizing class creation and checks" since the needed addition seems
too small for its own section.  Something like

The result of isinstance(object, class) can be modified by giving the
*class* a .__instancecheck__(object) method.  The result of
issubclass(sub,super) can be modified by giving the *superclass* a
.__subclasscheck__(sub) method.

--
assignee: georg.brandl
components: Documentation
messages: 81956
nosy: georg.brandl, tjreedy
severity: normal
status: open
title: Document __instancecheck__ and __subclasscheck__
versions: Python 3.0, Python 3.1

___
Python tracker 

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



[issue5251] contextlib.nested inconsistent with, well, nested with statements due exceptions raised in __enter__

2009-02-13 Thread James William Pye

New submission from James William Pye :

Basically, nested() doesn't seem to be consistent with explicitly nested
with-statements when an exception is thrown in a CM's __enter__.

Consider a pair of nested CMs, the inner __enter__ raises an exception
trapped by the outer. In the situation of explicitly nested
with-statements, the inner's block will not be ran as an exception was
raised prior to the block. The outer traps the exception and code
continues to flow after the outer's block because the exception was
*not* raised.
Currently, if contextlib.nested() is used in such a situation, it blows
up with a RuntimeError("generator didn't yield").

See the attached file for a set of naive variations and their resulting
exceptions or lack thereof in the situation of explicitly nested CMs.

Despite the RuntimeError raised by nested(), I'm not sure it's
*currently* possible for an implementation of nested() to be *totally*
consistent with explicitly nested with-statements. It would seem that an
additional facility(AbortBlock exception?) would be needed to
communicate that the block should not actually be ran, and that no
exception should be raised as it was consumed by an "outer" CM.


If this is considered to be the intended behavior, I would think the
doc-string on contextlib.nested should be updated to document the
inconsistency as it currently states that nested() and nested with
statements are equivalent. Based on the results of the attached file in
Python 3.0, they are clearly not.

Cheers folks; lovin' CMs. And, of course, apologies if this has already
been discussed. :P

--
components: None
files: nested_issue.py
messages: 81957
nosy: jwp
severity: normal
status: open
title: contextlib.nested inconsistent with, well, nested with statements due 
exceptions raised in __enter__
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file13075/nested_issue.py

___
Python tracker 

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



[issue2459] speedup for / while / if with better bytecode

2009-02-13 Thread Collin Winter

Collin Winter  added the comment:

I don't see the changes to the lnotab format being a roadblock; just
mention it in NEWS. Likewise, the pure-Python compiler package shouldn't
be a high priority; your changes to that package look good enough.

I'm seeing encouraging speed-ups out of this (with gcc 4.3.1 x86_64,
compiling Python as 64-bit):
Django templates (render a 150x150 table 100 times):
Min: 0.595 -> 0.589: 0.94% faster
Avg: 0.599 -> 0.591: 1.30% faster

Spitfire templates (render a 1000x1000 table 100 times):
Min: 0.751 -> 0.729: 2.98% faster
Avg: 0.753 -> 0.730: 3.09% faster

None of the apps I've benchmarked are negatively impacted. I only have
two minor comments. Please commit this.


Review comments:
- The changes to Python/compile.c:compiler_if(), compiler_for(),
compiler_while() have some indentation issues (tabs and such).
- Functions like
def foo():
  while True:
pass
have a useless JUMP_FORWARD 0 instruction, but I don't think it's worth
teaching the peepholer to remove them since it doesn't happen in other
circumstances (that I can tell).

___
Python tracker 

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



[issue5252] 2to3 should detect and delete import of removed statvfs module

2009-02-13 Thread Stephen J. Turnbull

New submission from Stephen J. Turnbull :

It should also try to convert stuff like

from statvfs import F_BAVAIL, F_FRSIZE
status = os.statvfs(directory)
available = status[F_BAVAIL]/((1024*1024)/status[F_FRSIZE]

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 81959
nosy: sjt
severity: normal
status: open
title: 2to3 should detect and delete import of removed statvfs module
type: feature request
versions: Python 3.0

___
Python tracker 

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



[issue2899] Fixers find, rfind, etc in 'string' module

2009-02-13 Thread Stephen J. Turnbull

Stephen J. Turnbull  added the comment:

Maybe 2to3 could get a --pedantic or even an --annoying option?  I agree 
that it should be noisy about removed features even if actually fixing 
this kind of thing would be hard to do reliably.

--
nosy: +sjt

___
Python tracker 

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



[issue5237] Allow auto-numbered replacement fields in str.format() strings

2009-02-13 Thread Eric Smith

Eric Smith  added the comment:

Terry J. Reedy wrote:
> Terry J. Reedy  added the comment:
> 
> All I am requesting is that
> '{} {} {}'.format(3, 'pi', 3.14) work as
> 
 '%s %s %s' % (3, 'pi', 3.14)
> '3 pi 3.14'
 '{0} {1} {2}'.format(3, 'pi', 3.14)
> '3 pi 3.14'
> 
> do today (3.0).

My string.Formatter subclass (attached to this bug report) does do this:

$ ./python.exe 
Python 2.7a0 (trunk:69516, Feb 11 2009, 14:30:31) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from auto_number_formatter_1 import MyFormatter
>>> f = MyFormatter()
>>> f.format('{} {} {}', 3, 'pi', 3.14)
'3 pi 3.14'
>>> 

This is just for vetting the concept, if it's accepted I'll modify
''.format(). It's not a huge change. I just want to make sure that this
implements what people are expecting.

The talk about '{:d}' and the like is just to make sure all the cases
are addressed. I doubt it would often be used that way.

> I should note that the difference between typing {}, which is easy, and
> {1}, is more than just one keystroke because the latter requires
> unshift-1-shift

Agreed.

___
Python tracker 

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



[issue2459] speedup for / while / if with better bytecode

2009-02-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Hello Collin,

Thanks for taking a look.

> I don't see the changes to the lnotab format being a roadblock; just
> mention it in NEWS. Likewise, the pure-Python compiler package shouldn't
> be a high priority; your changes to that package look good enough.

Well, I have good news: the fixes to the pure Python compiler have been
accepted and committed by Neil Schemenauer in r69373.

> I'm seeing encouraging speed-ups out of this (with gcc 4.3.1 x86_64,
> compiling Python as 64-bit):
> Django templates (render a 150x150 table 100 times):
> Min: 0.595 -> 0.589: 0.94% faster
> Avg: 0.599 -> 0.591: 1.30% faster
> 
> Spitfire templates (render a 1000x1000 table 100 times):
> Min: 0.751 -> 0.729: 2.98% faster
> Avg: 0.753 -> 0.730: 3.09% faster

Not a tremendous speedup but not totally insignificant either.
(I see you like Spitfire :-))

> None of the apps I've benchmarked are negatively impacted. I only have
> two minor comments. Please commit this.

Before committing I want to know what to do with the new jump opcodes,
with respect to the alternative proposal I've made in #4715.
Ideally, I should fold the #4715 patch back into the present patch,
since I think the #4715 approach is more thought out.

___
Python tracker 

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



[issue5253] os.environ.get() doesn't handle default value

2009-02-13 Thread Mary Stern

New submission from Mary Stern :

os.environ.get('ENV_VAR, 'mydefault')

returns '' rather than 'mydefault' if not set.

It would be nice if this standard dict-style behavior was supported.

--
messages: 81963
nosy: marystern
severity: normal
status: open
title: os.environ.get() doesn't handle default value
type: feature request
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



[issue5236] time.strptime should reject bytes arguments on Py3

2009-02-13 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon
nosy: +brett.cannon
stage:  -> test needed

___
Python tracker 

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



  1   2   >