[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 added the comment: > I appreciate your considerations. David, this discussions is certainly out of scope for this issue (which is about the "What's new" document), so I will not consider it further. -- ___ Python tracker

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

2009-03-19 Thread David W. Lambert
David W. Lambert added the comment: My file class extends text files with seek or read through condition or pattern, providing an awk like pattern{action} task separation. If I allow a pre-existing stream into my constructor (subprocess.Popen my favorite) I still suffer the same garbage colle

[issue5524] execfile() removed from Python3

2009-03-19 Thread Martin v. Löwis
Martin v. Löwis added the comment: -1. There is a much simpler solution to the problem: use exec(open(fn, "rb").read()) -- nosy: +loewis ___ Python tracker ___ __

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

2009-03-19 Thread Evan Greensmith
New submission from Evan Greensmith : 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) usi

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

2009-03-19 Thread Luca clementi
New submission from Luca clementi : 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 functio

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

2009-03-19 Thread Rudd-O
Rudd-O 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

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

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

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

2009-03-19 Thread STINNER Victor
STINNER Victor 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 __

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

2009-03-19 Thread STINNER Victor
STINNER Victor 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

[issue5524] execfile() removed from Python3

2009-03-19 Thread STINNER Victor
New submission from STINNER Victor : 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() does

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

2009-03-19 Thread STINNER Victor
STINNER Victor 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 ___

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

2009-03-19 Thread Brett Cannon
Changes by Brett Cannon : -- keywords: -patch stage: test needed -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing l

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

2009-03-19 Thread STINNER Victor
Changes by STINNER Victor : -- keywords: +needs review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

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

2009-03-19 Thread STINNER Victor
STINNER Victor 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

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

2009-03-19 Thread STINNER Victor
STINNER Victor added the comment: This bug was a duplicate of #4626 which was fixed by r70113 ;-) -- resolution: -> fixed status: open -> closed ___ Python tracker ___ _

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

2009-03-19 Thread STINNER Victor
STINNER Victor 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 _

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

2009-03-19 Thread STINNER Victor
STINNER Victor added the comment: Oh, I see that setup.py uses warnings and so linecache is loaded by setup.py. -- ___ Python tracker ___ ___

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

2009-03-19 Thread STINNER Victor
STINNER Victor 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!

[issue4024] float(0.0) singleton

2009-03-19 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> rejected status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue4024] float(0.0) singleton

2009-03-19 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: -haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

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

2009-03-19 Thread STINNER Victor
STINNER Victor 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? -- Adde

[issue1056293] dir() should only return strings

2009-03-19 Thread STINNER Victor
STINNER Victor 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

[issue5521] sqlite3.h missing

2009-03-19 Thread Benjamin Peterson
Benjamin Peterson 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 __

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

2009-03-19 Thread Benjamin Peterson
Benjamin Peterson 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

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

2009-03-19 Thread STINNER Victor
STINNER Victor 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(): posi

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

2009-03-19 Thread Joshua Kugler
New submission from Joshua Kugler : 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: Pyt

[issue5522] HTTPRedirectHandler documentation is wrong

2009-03-19 Thread Joshua Kugler
New submission from Joshua Kugler : 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(s

[issue5521] sqlite3.h missing

2009-03-19 Thread Matt Mendell
New submission from Matt Mendell : 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

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

2009-03-19 Thread Benjamin Peterson
Benjamin Peterson 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

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

2009-03-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Unassigning. This appears to have evolved beyond the original request. -- assignee: rhettinger -> ___ Python tracker ___ __

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

2009-03-19 Thread Benjamin Peterson
Benjamin Peterson 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 ___

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

2009-03-19 Thread STINNER Victor
STINNER Victor 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

[issue5518] cPickle produces inconsistent output

2009-03-19 Thread Martin v. Löwis
Martin v. Löwis 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

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

2009-03-19 Thread STINNER Victor
STINNER Victor added the comment: > Indeed. It happens when the filesystem encoding is not utf-8. How can I test it on Linux? -- ___ Python tracker ___ _

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

[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 added the comment: > Don't you think people ever referred to the type file directly? As in > help(file) Yes, certainly. There is no immediate replacement for that; read the io documentation. > dir(file) Likewise > file.somemethod(receiver, arg)? No. Why would anybody want t

[issue5520] refactor test_datetime.py

2009-03-19 Thread Jess Austin
New submission from Jess Austin : 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: jes

[issue5519] Deletion of some statements in re documentation

2009-03-19 Thread Mitchell Model
New submission from Mitchell Model : 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, th

[issue5381] json needs object_pairs_hook

2009-03-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for looking at this. Fixed the tab/space issue. Committed in r70471 -- resolution: -> accepted status: open -> closed ___ Python tracker

[issue5381] json needs object_pairs_hook

2009-03-19 Thread Bob Ippolito
Bob Ippolito added the comment: This patch looks good to me, my only comment is that the patch mixes tabs and spaces in the C code in a file that had no tabs previously -- ___ Python tracker __

[issue2531] float compared to decimal is silently incorrect.

2009-03-19 Thread Jeremy Dunck
Jeremy Dunck 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. -- __

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

2009-03-19 Thread Eric Smith
Eric Smith 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 ba

[issue2531] float compared to decimal is silently incorrect.

2009-03-19 Thread Mark Dickinson
Mark Dickinson 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 mixe

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

2009-03-19 Thread Mark Dickinson
Mark Dickinson added the comment: I agree that Decimal should be consistent with int and float. I'm not sure I'd classify the current behaviour as a bug, though: presumably this behaviour was intentional at the time it was originally coded? I guess backporting *probably* won't do any harm, sin

[issue5518] cPickle produces inconsistent output

2009-03-19 Thread rb
New submission from rb : The documentation states that the output of pickle and cPickle may be different. However it is implied that the output of a particular module will always be consistent within itself. This expectation fails for the case below. I am using the output of cPickle in order to

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

2009-03-19 Thread David W. Lambert
David W. Lambert 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

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

2009-03-19 Thread Mitchell Model
Mitchell Model added the comment: At 11:03 AM -0400 3/19/09, Mitchell L Model wrote: >>Martin v. Löwis 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. T

[issue5500] tarfile: path problem in arcname under windows

2009-03-19 Thread Elijah Merkin
Elijah Merkin 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

[issue5500] tarfile: path problem in arcname under windows

2009-03-19 Thread Elijah Merkin
Elijah Merkin 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

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

2009-03-19 Thread David W. Lambert
David W. Lambert 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, providi

[issue2170] rewrite of minidom.Node.normalize

2009-03-19 Thread Malte Helmert
Malte Helmert 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. -- _

[issue2170] rewrite of minidom.Node.normalize

2009-03-19 Thread R. David Murray
R. David Murray 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

[issue2170] rewrite of minidom.Node.normalize

2009-03-19 Thread R. David Murray
Changes by R. David Murray : Removed file: http://bugs.python.org/file13352/issue2170.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue2170] rewrite of minidom.Node.normalize

2009-03-19 Thread R. David Murray
Changes by R. David Murray : Removed file: http://bugs.python.org/file13312/test_minidom.patch ___ Python tracker ___ ___ Python-bugs-list mail

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

2009-03-19 Thread Benjamin Peterson
Benjamin Peterson 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: +benja

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

2009-03-19 Thread Eric Smith
Eric Smith 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. -- __

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

2009-03-19 Thread Tarek Ziadé
Tarek Ziadé 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 __

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

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

2009-03-19 Thread Haoyu Bai
New submission from Haoyu Bai : 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", lin