[issue5513] What's New should say VERY CLEARLY that the type file is gone

2009-03-19 Thread Martin v. Löwis

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

 The Python 3 What's New should SCREAM that the type file is gone

I don't think the documentation should ever SCREAM.

 The type file has been replaced by _ioTextIOWrapper; use open() to 
 open a file; open returns an instance of _ioTextIOWrapper.

That would be an incorrect statement: there are multiple types that
replace the 2.x file type. See the documentation of the io module for
details.

--
nosy: +loewis
title: What's New should say VERY CLEARLY that the type file is gone - 
What's New should say VERY CLEARLY that the type file   is gone

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



[issue5517] 2to3 haven't convert buffer object to memoryview

2009-03-19 Thread Haoyu Bai

New submission from Haoyu Bai divine...@gmail.com:

The following example is valid in Python 2.6:

a = 'abc'
b = buffer(a)
print([repr(c) for c in b])

After 2to3 it, the 'buffer' isn't changed to memoryview, so then it is
not valid program in Python 3:

Traceback (most recent call last):
  File bufferobj3.py, line 2, in module
b = buffer(a)
NameError: name 'buffer' is not defined

However even it changed to memoryview the program still not valid because:

 memoryview('a')
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: cannot make memory view because object does not have the
buffer interface


I can reporduce this on both Python 3.0.1 and Python 3.1a1+ (py3k:70310).

Thanks!

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 83802
nosy: bhy
severity: normal
status: open
title: 2to3 haven't convert buffer object to memoryview
type: feature request
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1

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



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

2009-03-19 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

Hi Rudd-O. Sorry i didn't look at your patches and idea yet, I am
preparing Pycon.

Make sur you write your patches against Python truk, not Python 2.4.
For example the current has already -O enabled for build_rpm

--
versions: +Python 2.7, Python 3.1

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



[issue5474] distutils produces invalid RPM packages of prerelease python packages

2009-03-19 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

Please write your patches against the trunk. I'll start to look at them
after Pycon. Regards

--
versions: +Python 2.7, Python 3.1 -Python 2.4

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



[issue5515] 'n' formatting for int and float handles leading zero padding poorly

2009-03-19 Thread Eric Smith

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

C# doesn't seem to have the issue because they don't allow any modifies
when specifying locale-aware formatting. Specifying a picture seems to
be the only way to get leading zeros added.

Similarly, Java looks to be picture-based.

--

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



[issue2170] rewrite of minidom.Node.normalize

2009-03-19 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


Removed file: http://bugs.python.org/file13312/test_minidom.patch

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



[issue2170] rewrite of minidom.Node.normalize

2009-03-19 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


Removed file: http://bugs.python.org/file13352/issue2170.patch

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



[issue2170] rewrite of minidom.Node.normalize

2009-03-19 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Removed old patches, updated patch to remvoe the unnecessary local
variable assignment (also pushed to launchpad).

--
Added file: http://bugs.python.org/file13374/issue2170.patch

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



[issue5517] 2to3 haven't convert buffer object to memoryview

2009-03-19 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

2to3 will convert buffer to memoryview, but not by default because as
you can see, it can be wrong. (Pass -f buffer to 2to3.) You can only
use memoryviews on bytes-like objects like b'a', and not unicode strings
(This is like 2.x.).

--
nosy: +benjamin.peterson
resolution:  - invalid
status: open - closed

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



[issue2170] rewrite of minidom.Node.normalize

2009-03-19 Thread Malte Helmert

Malte Helmert helm...@informatik.uni-freiburg.de added the comment:

Short review: code looks good to me, patch applies cleanly to trunk,
passes tests.

@akuchling: I don't know if you remember, but this rewrite was
originally suggested by you on a bug day some time ago. I think David's
patch is ready to be applied.

--

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



[issue5513] What's New should say VERY CLEARLY that the type file is gone

2009-03-19 Thread David W. Lambert

David W. Lambert lamber...@corning.com added the comment:

# With py3Krc1 it took me days to figure out how to
# replace my base class file.   Granted, there were
# issues with io module at the time.  Following met
# my need.


import io

class File(io.TextIOWrapper):

'''Open a text file with read access, providing...'''

def __init__(self,name):
super().__init__(open(name).buffer)

--
nosy: +LambertDW

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



[issue5500] tarfile: path problem in arcname under windows

2009-03-19 Thread Elijah Merkin

Elijah Merkin e...@transas.com added the comment:

Tested again under Python 2.6.1 on Windows XP (added Python 2.6 to
versions).

An archive I attached to the issue contains a .py file that reproduces
the bug and an archive created by it.

In my case I just put the .py file to C:\testtarfile\ directory and run it.

When I open the file by any archive manager I have in Windows, I see.
When I view the file contents in a hex viewer, I also see
'C:\\testtarfile\...', so the problem really exists. However, when
uncompressing the archive on Linux (tar -xzf ...) I get
'test/testtarfile.py' as initially expected.

 The archive is created, and the path in the archive is
'C:\\testtarfile\\testtarfile.py', not 'test/testtarfile.py' as I would
expect.

--
versions: +Python 2.6
Added file: http://bugs.python.org/file13375/reproduce_issue5500.zip

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



[issue5500] tarfile: path problem in arcname under windows

2009-03-19 Thread Elijah Merkin

Elijah Merkin e...@transas.com added the comment:

Sorry for not explaining properly, I was distracted.

1. The absolute path really exists in the .tar.gz file when I view it in
a hex editor.
2. Windows archive managers I tried see that absolute path.
3. Linux tar utility, however, somehow manages to extract the file
correctly to the original relative path.

That's very strange...

--

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



[issue5513] What's New should say VERY CLEARLY that the type file is gone

2009-03-19 Thread Mitchell Model

Mitchell Model m...@acm.org added the comment:

At 11:03 AM -0400 3/19/09, Mitchell L Model wrote:
Martin v. Löwis mar...@v.loewis.de added the comment:

 The Python 3 What's New should SCREAM that the type file is gone

I don't think the documentation should ever SCREAM.

No, of course not. I was being extreme. The problem with the laconic alternative
is that it sets traps for people. It reminds me of wrestling Stroustrop's first 
book
on C++ where all this weird behavior happened and when you went back to the
book you could find one sentence whose third-level implication was consistent
with the explanation. What I'm saying is that it's not enough to say to use 
open().
Don't you think people ever referred to the type file directly? As in 
help(file) or
dir(file) or file.somemethod(receiver, arg)? Or even storing a file method in a
dictionary for dispatch? It doesn't matter whether any of these were a good 
idea,
I claim they were quite ingrained in Python 2 user's minds. The changes in the
sequence types are quite substantial, but they are explained in detail. This 
isn't.

In reviewing the What's New for the purpose of this reponse I noticed an
earlier mention of sys.stdin, sys.stdout, and sys.stderr, where it says they
are now instances of TextIOBase. (They are actually instances of TextIOWrapper,
just like the result of open().) So why can't the documentation of open() say
that it returns an instance of TextIOBase too?

At least add to the paragraph of PEP 3116 that the old file type is gone.
Maybe that's better than discussing it in conjunction with open(), in which
case the statement using open() instead of file should read that open replaces
file(), not file.

It just seems like a very wide trap to never mention that the whole file type 
is gone.
It does not follow from the two facts that one should use open() instead of 
file()
and that the IO system has been rewritten, that there is no file type. Even if
whatever open returns has the same interface as the old file type.


  The type file has been replaced by _ioTextIOWrapper; use open() to
  open a file; open returns an instance of _ioTextIOWrapper.

That would be an incorrect statement: there are multiple types that
replace the 2.x file type. See the documentation of the io module for
details.

OK, I didn't follow the technical details through and, as I said above, I hadn't
noticed the earlier mention of TextIOBase for sys.stdout, etc. So just say
something like The type file is gone, replaced by classes in the IO module.
Use open() to open a file. And maybe add that it returns an instance of
TextIOBase or TextIOWrapper, whichever is deemed more appropriate.

Whatever else it says with regard to the above comments the What's New
really needs to explicitly say that the file type is gone.

And I apologize for screaming in my entry. I was just so incredibly shocked when
I figured out what was going on.
-- 

--- Mitchell

--
title: What's New should say VERY CLEARLY that the type file  is gone - 
What's New should say VERY CLEARLY that the type   fileis gone

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



[issue5513] What's New should say VERY CLEARLY that the type file is gone

2009-03-19 Thread David W. Lambert

David W. Lambert lamber...@corning.com added the comment:

#OOPS!  I forgot the subtlety.
#I must also retain the stream
#else it gets collected.
#Nasty.


import io

class file(io.TextIOWrapper):

'''condensing code for this list without test is a no no!'''

def __init__(self,name):
self.stream = open(name)   # SAVE THE STREAM!
super().__init__(self.stream.buffer)

--

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

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

Making float - Decimal comparisons return the 'right' answer in 2.x does 
look attractive at first sight, but the more I think about it the more it 
seems a bad idea.  Having the comparisons work in 2.x but not in 3.x seems 
especially nasty, and allowing mixed-type comparisons but not mixed-type 
arithmetic operations also seems somehow unclean.  So -1 from me.  (And 
no, I don't want to add full float - Decimal interaction: the Decimal 
module is quite complicated enough as it is.)

Are there many cases where float - Decimal comparisons are useful?  The 
only uses I can think of would also involve a need for mixed-type
arithmetic.  In the few cases where it's really needed I don't think it's 
a problem to explicitly convert one or the other type.

The current bogus comparison results also suck, but they're just one 
aspect of a known Python 2.x gotcha.

Would it be possible to raise a warning for Decimal - float comparisons?
Does -3 already do this?

--

___
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



[issue2531] float compared to decimal is silently incorrect.

2009-03-19 Thread Jeremy Dunck

Jeremy Dunck jdu...@gmail.com added the comment:

I hear you on the 2.x to 3.x transition-- I'm not really asking for
mixed-mode arithmetic.  I'd be perfectly happy if float  decimal raised
TypeError, as float + decimal does.

My complaint is that it is silently wrong.

--

___
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



[issue5515] 'n' formatting for int and float handles leading zero padding poorly

2009-03-19 Thread Eric Smith

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

Oops, assigning it to you was an error. I was just trying to figure out
what your userid is so I could add you to Nosy, and I was using
Assigned To to find it. I've fixed that.

The current behavior is an accident of the implementation. The
implementation isn't based on anything else, and there was no
requirement to have the output that it does. And as far as I know, there
are no tests that test for the current behavior.

Right now I'm +0 on backporting. What I'll do is fix it for 2.7/3.1 and
see how big the patch is. I suspect it will be a pretty big, invasive
patch. If so, I'll change my backport vote to -1.

--
assignee: marketdickinson - eric.smith

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



[issue5381] json needs object_pairs_hook

2009-03-19 Thread Raymond Hettinger

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

Thanks for looking at this.
Fixed the tab/space issue.
Committed in r70471

--
resolution:  - accepted
status: open - closed

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



[issue5519] Deletion of some statements in re documentation

2009-03-19 Thread Mitchell Model

New submission from Mitchell Model m...@acm.org:

The second sentence of the re module documentation --  The re module is 
always available. seems extraneous at best. What is it saying? What 
modules are not always available? Do other always available modules say 
that they are always available?

Also, the reference to kodos should probably be removed. It hasn't been 
updated since 2006, and it doesn't work with PyQT4.

--
assignee: georg.brandl
components: Documentation
messages: 83821
nosy: MLModel, georg.brandl
severity: normal
status: open
title: Deletion of some statements in re documentation
versions: Python 3.0, Python 3.1

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



[issue5520] refactor test_datetime.py

2009-03-19 Thread Jess Austin

New submission from Jess Austin jess.aus...@gmail.com:

I've broken out this refactoring from some of the other datetime stuff
I'm doing.  The patch needn't be applied until the other issues that
depend on it are.

--
components: Library (Lib)
files: test_datetime.diff
keywords: patch
messages: 83822
nosy: jess.austin
severity: normal
status: open
title: refactor test_datetime.py
versions: Python 3.1
Added file: http://bugs.python.org/file13376/test_datetime.diff

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



[issue5513] What's New should say VERY CLEARLY that the type file is gone

2009-03-19 Thread Martin v. Löwis

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

 class file(io.TextIOWrapper):
 
 '''condensing code for this list without test is a no no!'''
 
 def __init__(self,name):
 self.stream = open(name)   # SAVE THE STREAM!
 super().__init__(self.stream.buffer)

I don't know what this is supposed to achieve, but it looks incorrect.
I would write it as

py class file(io.TextIOWrapper):
...   def __init__(self, name):
... super().__init__(io.BufferedReader(io.FileIO(name, r)))
...

Your version creates a separate TextIOWrapper for no apparent reason.

--

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



[issue5518] cPickle produces inconsistent output

2009-03-19 Thread Martin v. Löwis

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

I'm not quite sure why you expect them to be the same. The inputs are
different, after all - in one case, you have a Unicode object with a
single reference to it (from the tuple), in the second case, you have a
Unicode object with many more references:

py sys.getrefcount(key[1])
2
py sys.getrefcount((1,u'foo')[1])
5

That makes a difference for cPickle.

--
nosy: +loewis
resolution:  - invalid
status: open - pending

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



[issue4352] imp.find_module() fails with a UnicodeDecodeError when called with non-ASCII search paths

2009-03-19 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Oh, I found sys.setfilesystemencoding(latin-1)! But even with that, 
your example find_module.py works correctly with py3k trunk. The 
problem has maybe gone?

--

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



[issue4352] imp.find_module() fails with a UnicodeDecodeError when called with non-ASCII search paths

2009-03-19 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

Well, latin-1 can decode any arbitrary array of bytes, so of course it
won't fail. :)

--
nosy: +benjamin.peterson

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



[issue5513] What's New should say VERY CLEARLY that the type file is gone

2009-03-19 Thread Raymond Hettinger

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

Unassigning.  This appears to have evolved beyond the original request.

--
assignee: rhettinger - 

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



[issue5513] What's New should say VERY CLEARLY that the type file is gone

2009-03-19 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

It might be helpful to provide a table in the open() docs saying what
classes in io exactly are returned for different modes.

--
nosy: +benjamin.peterson

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



[issue5521] sqlite3.h missing

2009-03-19 Thread Matt Mendell

New submission from Matt Mendell matthew.mend...@gmail.com:

File sqlite3.h missing from Python-3.0.1.
setup.py looks for this file.

Is this intentional?

--
components: None
messages: 83831
nosy: mendell
severity: normal
status: open
title: sqlite3.h missing
type: compile error
versions: Python 3.0

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



[issue5522] HTTPRedirectHandler documentation is wrong

2009-03-19 Thread Joshua Kugler

New submission from Joshua Kugler jkug...@bigfoot.com:

On the page lib/http-redirect-handler.html it says the signature of 
redirect_request is:

redirect_request(  req, fp, code, msg, hdrs)

It is actually:

redirect_request(req, fp, code, msg, hdrs, newurl)

Well, technically the signature is:

redirect_request(self, req, fp, code, msg, hdrs, newurl)

but it is called as the six-argument version.

--
assignee: georg.brandl
components: Documentation
messages: 83832
nosy: georg.brandl, jkugler
severity: normal
status: open
title: HTTPRedirectHandler documentation is wrong
versions: Python 2.5

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



[issue5523] Python bug tracker won't let you edit your profile

2009-03-19 Thread Joshua Kugler

New submission from Joshua Kugler jkug...@bigfoot.com:

I tried to edit my e-mail address in the python bug tracker 
(under Your Details), but when I hit submit, it tells me:

You do not have permission to edit user

--
components: None
messages: 83833
nosy: jkugler
severity: normal
status: open
title: Python bug tracker won't let you edit your profile
type: behavior
versions: 3rd party

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



[issue5006] Duplicate UTF-16 BOM if a file is open in append mode

2009-03-19 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

@pitrou: You're right, but the state have to be changed for the 
encoder, not the decoder. I added the following code to TextIOWrapper 
constructor (for the C and the Python version of io library):

if self._seekable and self.writable():
position = self.buffer.tell()
if position != 0:
self._encoder = self._get_encoder()
self._encoder.setstate(0)

--
keywords: +patch
Added file: http://bugs.python.org/file13377/append_bom.patch

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



[issue5523] Python bug tracker won't let you edit your profile

2009-03-19 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

This should go on the meta-tracker, not the Python tracker. See
http://psf.upfronthosting.co.za/roundup/meta

--
nosy: +benjamin.peterson
resolution:  - invalid
status: open - closed

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



[issue5521] sqlite3.h missing

2009-03-19 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

That's because it's trying to find the location of the sqlite3.h header
which the sqlite3 extension links to. That's part of sqlite, so it's no
included in Python.

--
nosy: +benjamin.peterson
resolution:  - invalid
status: open - closed

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



[issue1056293] dir() should only return strings

2009-03-19 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

It's a feature request and it looks like except of Skip Montanaro in 
2004, nobody requires this feature. I don't like my patch because it 
slows down Python just for a very rare case (this issue).

I choose to close it. Reopen this issue if you think that this feature 
(check type of dir() result) is a must have ;-)

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

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



[issue1726687] Bug found in datetime for Epoch time = -1

2009-03-19 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

New version of my fix:
 - the test doesn't depend on _my_ local anymore: it uses localtime() 
to get the time tuple in the host local
 - ignore the test if mktime(-2) raise an OverflowError: avoid the 
test on Windows

Is it now ok for everyone?

--
Added file: http://bugs.python.org/file13378/fix_mktime-2.patch

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



[issue4024] float(0.0) singleton

2009-03-19 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
nosy:  -haypo

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



[issue4024] float(0.0) singleton

2009-03-19 Thread Raymond Hettinger

Changes by Raymond Hettinger rhettin...@users.sourceforge.net:


--
resolution:  - rejected
status: open - closed

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



[issue4016] improve linecache: reuse tokenize.detect_encoding() and io.open()

2009-03-19 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

@benjamin.peterson: The second version of my patch works correctly 
with the bootstraping.

 I also think we should consider hard adding more modules 
 that are loaded at startup time to py3k already huge list.

linecache is not loaded at startup time in py3k! I see that linecache 
is loaded by the warnings module, but the warnings module 
(Lib/warnings.py) is not loaded at startup. It was maybe the case with 
Python 2.x or older version of Python 3.x?

With my patch, loading linecache loads 2 extra modules: tokenize and 
token. It only impacts code using directly linecache or the warnings 
module.

--

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



[issue4016] improve linecache: reuse tokenize.detect_encoding() and io.open()

2009-03-19 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Oh, I see that setup.py uses warnings and so linecache is loaded by 
setup.py.

--

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



[issue4121] open(): use keyword only for arguments other than file and mode

2009-03-19 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Guido Beyond 3.0, I'm still rather reluctant

Ok ok, let's close this bad idea.

--
resolution:  - rejected
status: open - closed

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



[issue4282] exec(unicode): invalid charset when #coding:xxx spec is used

2009-03-19 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

This bug was a duplicate of #4626 which was fixed by r70113 ;-)

--
resolution:  - fixed
status: open - closed

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



[issue4282] profile doesn't support non-UTF8 source code

2009-03-19 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
keywords: +needs review

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



[issue4282] profile doesn't support non-UTF8 source code

2009-03-19 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Oops, benjamin noticed that it doesn't work with Windows end of line 
(\r\n). New patch reads the file encoding instead of reading file 
content as bytes.

--
keywords: +patch
Added file: http://bugs.python.org/file13379/profile_encoding-2.patch

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



[issue4282] profile doesn't support non-UTF8 source code

2009-03-19 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Oops, i misread this issue (wrong title!). #4626 is related, but this 
issue is about the profile module. The problem is that profile open 
the source code as text (with the default charset: UTF-8).

Attached patch fixes the problem.

Example:
--- x.py (ISO-8859-1 text file) ---
#coding: ISO-8859-1
print(hé hé)
---

Run: python -m profile x.py

Current result:
  (...)
  File .../py3k/Lib/profile.py, line 614, in main
script = fp.read()
  File .../Lib/codecs.py, line 300, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode bytes (...)

With my patch, it works as expected.

--
dependencies: +compile() doesn't ignore the source encoding when a string is 
passed in
resolution: fixed - 
status: closed - open
title: exec(unicode): invalid charset when #coding:xxx spec is used - profile 
doesn't support non-UTF8 source code

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



[issue5524] execfile() removed from Python3

2009-03-19 Thread STINNER Victor

New submission from STINNER Victor victor.stin...@haypocalc.com:

In What’s New In Python 3.0 document, I can read Removed 
execfile(). Instead of execfile(fn) use exec(open(fn).read()). The 
new syntax has two problems:
 - if the file is not encoding in UTF-8, we get an unicode error. Eg. 
see issue #4282
 - exec() doesn't support newline different than \n, see issue #4628

We need a short function which opens the Python file with the right 
encoding. Get Python file encoding and open it with the right encoding 
is a command pattern.

Attached patch proposes a function open_script() to open a Python 
script with the correct encoding. Using it, execfile() can be replaced 
by exec(open_script(fn).read()) which doesn't have to two binary file 
problems.

--
files: open_script.patch
keywords: patch
messages: 83845
nosy: haypo
severity: normal
status: open
title: execfile() removed from Python3
versions: Python 3.0, Python 3.1
Added file: http://bugs.python.org/file13380/open_script.patch

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



[issue4282] profile doesn't support non-UTF8 source code

2009-03-19 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

This regression was introduced by the removal of execfile() in 
Python3. The proposed replacement of execfile() is wrong. I propose a 
generic fix in the issue #5524.

--

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



[issue4628] No universal newline support for compile() when using bytes

2009-03-19 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

This problem is not new. exec() in Python 2.x doesn't accept \r\n 
newlines.

See also related(?) issue: #5524

--
nosy: +haypo

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



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

2009-03-19 Thread Rudd-O

Rudd-O rud...@rudd-o.com added the comment:

patch does what others did, plus this time it lets the specfile
autodiscover the python abi so the name is correct regardless of against
whichever python interpreter the package is built.

--
Added file: 
http://bugs.python.org/file13381/python-2.4-distutils-bdist_rpm-autonames+optimize-v3.patch

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



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

2009-03-19 Thread Rudd-O

Rudd-O rud...@rudd-o.com added the comment:

about python trunk...

gimme some time to port them incrementally to all popular stable pythons
first, then to trunk.  will be glad to do this.

Now, by trunk, do you mean python 3.x?

--

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



[issue5474] distutils produces invalid RPM packages of prerelease python packages

2009-03-19 Thread Rudd-O

Rudd-O rud...@rudd-o.com added the comment:

about python trunk...

gimme some time to port them incrementally to all popular stable pythons
first, then to trunk.  will be glad to do this.

Now, by trunk, do you mean python 3.x?

--

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



[issue5525] Problem with email.MIME* library, using wrong new line

2009-03-19 Thread Luca clementi

New submission from Luca clementi luca.cleme...@gmail.com:

I'm running Python 2.5.2 under Ubuntu 8.10.

In the file email/generator.py from the core library at line 228 in the
function _handle_multipart()
# delimiter transport-padding CRLF
print  self._fp, '\n--' + boundary
but if this function is run under Unix it print only the LF and not the
CRLF as by required by the standard. 

My guess is that this error is also in other part of the library.
SMTP (as HTTP) requires CRLF as new line, by standard, while I see that
at the beginning of the generator.py
NL = '\n'

Am I missing something?

Luca

--
components: Library (Lib)
messages: 83851
nosy: lclement
severity: normal
status: open
title: Problem with email.MIME* library, using wrong new line
type: behavior
versions: Python 2.5

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



[issue5526] Local variables unavailable for operation of list comprehension when using eval()

2009-03-19 Thread Evan Greensmith

New submission from Evan Greensmith evan.greensm...@gmail.com:

In python 3.0 and 3.1, attempting to access a local variable from within
a list comprehension in a string passed to eval() causes a NameError. 
Doesn't seem to be a problem in python 2.6

I have attempted to run the attached test cases (test_eval_comp.py)
using the following builds of python:

Python 2.6.1 (r261:67517, Dec  4 2008, 16:51:00) [MSC v.1500 32 bit
(Intel)] on win32

Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
(Intel)] on win32

Python 3.1a1 (r31a1:70244, Mar  8 2009, 18:15:03) [MSC v.1500 32 bit
(Intel)] on win32

All tests passed with Python 2.6.1.  The following five tests failed
with Python 3.0.1 and 3.1a1

EvalWithComprehensionTestCase.test_local_var
NameError: global name 'value' is not defined
EvalWithComprehensionTestCase.test_function_arg
NameError: global name 'value' is not defined
EvalWithComprehensionTestCase.test_self_attrib
NameError: global name 'self' is not defined
ExampleFromDocsTestCase.test_local_var
NameError: global name 'vec1' is not defined
NestedComprehensionExampleFromDocsTestCase.test_local_var
NameError: global name 'mat' is not defined

--
files: test_eval_comp.py
messages: 83852
nosy: evan.greensmith
severity: normal
status: open
title: Local variables unavailable for operation of list comprehension when 
using eval()
versions: Python 3.0, Python 3.1
Added file: http://bugs.python.org/file13382/test_eval_comp.py

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



[issue5524] execfile() removed from Python3

2009-03-19 Thread Martin v. Löwis

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

-1. There is a much simpler solution to the problem: use exec(open(fn,
rb).read())

--
nosy: +loewis

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