[issue7902] relative import broken

2010-02-12 Thread Oren Held

Changes by Oren Held :


--
nosy: +Oren_Held

___
Python tracker 

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



[issue5651] OS X Installer: add checks to ensure proper Tcl configuration during build

2010-02-12 Thread Katrine Whiteson

Katrine Whiteson  added the comment:

Hi,

I am having a related issue installing Tkinter (which I need to install 
matplotlib).

I am running Mac OS X 10.4.11, and just installed Python 2.6.4 .

After several other fights, one remaining battle for me to get matlotlib 
installed is to have a working version of Tkinter, although there are several 
in my Mac from Xcode and also Python, I guess they just aren't installed in 
useful places? After I installed Python 2.6.4, import _tkinter failed. So I 
installed Tcl 8.5 from active state.

Now, I make it to the Tkinter test:

Tkinter._test() Traceback (most recent call last): File "", line 1, 
in File 
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py",
 line 3746, in _test root = Tk() File 
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py",
 line 1645, in init self._loadtk() File 
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py",
 line 1659, in _loadtk % (_tkinter.TK_VERSION, tk_version) RuntimeError: tk.h 
version (8.4) doesn't match libtk.a version (8.5)

I realize you have discussed the exact error I am describing here: 
http://bugs.python.org/issue4017

but those errors arose from a problem with an earlier version of python, where 
setup.py reversed the order of where to look. The advice in your previous post 
is to fix this order in setup.py and rebuild python, but my setup.py is already 
looking good - it includes these lines:

def detect_tkinter_darwin(self, inc_dirs, lib_dirs): # The _tkinter module, 
using frameworks. Since frameworks are quite # different the UNIX search logic 
is not sharable. from os.path import join, exists framework_dirs = [ 
'/Library/Frameworks', '/System/Library/Frameworks/', join(os.getenv('HOME'), 
'/Library/Frameworks')

I would really appreciate any insight on how to handle this!( I am a 
biologist...)

While I'm at it, I'll include what is going on when I try to install m 
matplotlib in case it is useful...matplotlib thinks I have Tkinter 8.4 
(ironically, only after I installed 8.5, before that it always said it could 
not find Tkinter):

Tkinter: Tkinter: 65971, Tk: 8.4, Tcl: 8.4

also, here is the error I run into when trying to build matplotlib:

powerpc-apple-darwin8-g++-4.0.1: unrecognized option 
'-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk' i686-apple-darwin8-g++-4.0.1: 
unrecognized option '-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk' /usr/bin/ld: 
-syslibroot: multiply specified collect2: ld returned 1 exit status 
/usr/bin/ld: -syslibroot: multiply specified collect2: ld returned 1 exit 
status lipo: can't open input file: /var/tmp//ccrblCgU.out (No such file or 
directory) error: command 'g++' failed with exit status 1 make: * [mpl_build] 
Error 1

thank you!!

Katrine

--
nosy: +Katrine.Whiteson

___
Python tracker 

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



[issue7906] float("INFI") returns inf on certain platforms

2010-02-12 Thread Zsolt Cserna

Zsolt Cserna  added the comment:

This issue doesn't seem to cause any problems in our production code, however I 
haven't tested it.

Btw what is the status of the solaris support? According to wiki page it should 
be supported by python, in real it seems it's not really supported (I mean not 
just this bug, but others related to solaris).

--

___
Python tracker 

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



[issue5651] OS X Installer: add checks to ensure proper Tcl configuration during build

2010-02-12 Thread Ned Deily

Ned Deily  added the comment:

If you have installed Python 2.6.4 using the python.org OS X installer, it was 
linked with Tk 8.4, and will not use Tk 8.5.  OS X 10.4 has an old version of 
Tk 8.4; your best bet is to install the most recent Tcl/Tk 8.4 from ActiveState 
Tcl/Tk.

--

___
Python tracker 

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



[issue7916] zipfile.ZipExtFile passes long to fileobj.read()

2010-02-12 Thread Matt Joiner

New submission from Matt Joiner :

When reading from the fileobj passed in it's constructor, zipfile.ZipExtFile 
passes a long into fileobj.read(). This is not normally an issue, except in 
io.BytesIO, for which the source is in C, and throws TypeError for 
type(bufsize) != int.

>From what I can ascertain from the source, io.BytesIO.read() only expects an 
>int because this type is merged with long in Python3*. I also believe 
>io.BytesIO may have been backported and so this difference in the treatment of 
>int and long was not picked up.

I have attached a test demonstrating the type failure, with comments for it's 
testing under Python3, where this evidently doesn't occur. It also compares 
results with io.BytesIO's predecessors, StringIO and cStringIO.

I would attach a patch but I'm unsure of the general process, so here instead 
are relevant lines of interest from the 2.6.4 vanilla source:
zipfile.py:447 ZipExtFile.bytes_read is assigned a long
zipfile.py:594 a long is passed to a fileobj (such as io.BytesIO)
_bytesio.c:222 the type of the argument to io.BytesIO.read() is checked to be 
an int

--
components: Library (Lib)
files: zipfile_testcase.py
messages: 99260
nosy: anacrolix
severity: normal
status: open
title: zipfile.ZipExtFile passes long to fileobj.read()
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file16217/zipfile_testcase.py

___
Python tracker 

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



[issue7906] float("INFI") returns inf on certain platforms

2010-02-12 Thread Eric Smith

Eric Smith  added the comment:

I agree that backporting the various parts needed to get this working would be 
risky and shouldn't be done.

As for Solaris sure, I'm not sure. You might ask on python-dev. I get the 
impression that few (if any) core developers have access to a Solaris machine.

--

___
Python tracker 

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



[issue5651] OS X Installer: add checks to ensure proper Tcl configuration during build

2010-02-12 Thread Katrine Whiteson

Katrine Whiteson  added the comment:

Thanks very much for your helpful and quick reply!

I installed Tcl8.4 from activestate, and had the same version  
conflict error when I did the Tkinter test in Python. So I  
uninstalled both Tcl8.4 and Tcl8.5 (I did sudo ./uninstall while in  
this directory, the 8.4 and 8.5 versions:  /Library/Receipts/ 
ActiveTcl-8.4.pkg/Contents/Resources)

Then I reinstalled Tcl8.4 from active state, and now it still seems  
to look for Tcl8.5 when I say "import _tkinter" in Python:

katrine-whitesons-computer:/Applications/Q/matplotlib-0.99.1.1  
katrinewhiteson$ python
Python 2.6 (trunk:66714:66715M, Oct  1 2008, 18:36:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import _tkinter
Traceback (most recent call last):
   File "", line 1, in 
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/ 
lib/python2.6/lib-dynload/_tkinter.so, 2): Library not loaded: / 
Library/Frameworks/Tcl.framework/Versions/8.5/Tcl
   Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/ 
lib/python2.6/lib-dynload/_tkinter.so
   Reason: image not found



I looked in /Library/Frameworks/Tcl.framework

and found 2 folders, "8.4" and "Current", the latter does not contain  
anything that says 8.5.

How can I get python to stop looking for 8.5?

thank you!
Katrine

On Feb 12, 2010, at 11:32 AM, Ned Deily wrote:

>
> Ned Deily  added the comment:
>
> If you have installed Python 2.6.4 using the python.org OS X  
> installer, it was linked with Tk 8.4, and will not use Tk 8.5.  OS  
> X 10.4 has an old version of Tk 8.4; your best bet is to install  
> the most recent Tcl/Tk 8.4 from ActiveState Tcl/Tk.
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue7916] zipfile.ZipExtFile passes long to fileobj.read()

2010-02-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

This was fixed with issue7249 and will be available with 2.6.5

--
nosy: +amaury.forgeotdarc
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue7906] float("INFI") returns inf on certain platforms

2010-02-12 Thread R. David Murray

R. David Murray  added the comment:

My feeling from watching bug reports is that Solaris is no less well supported 
than other non-linux, non-windows platforms.  When you look at the number of 
open Solaris bug reports, also consider the number of open bug reports over 
all.  We just don't have enough developer resources to close them all :(  And 
yes, developer access to appropriate test systems is one of the big issues.

If you have time to actively participate in resolving Solaris bugs by testing 
and proposing patches, my guess is you will get cooperation (and gratitude) 
from the dev team.

--
nosy: +r.david.murray
priority:  -> normal
stage:  -> committed/rejected

___
Python tracker 

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



[issue7904] urlparse.urlsplit mishandles novel schemes

2010-02-12 Thread R. David Murray

R. David Murray  added the comment:

I think Mark is correct.  RFC 3986 says:

When authority is present, the path must either be empty or begin with a slash 
("/") character.  When authority is not present, the path cannot begin with two 
slash characters ("//").

I think it would make sense to have urlparse fall back to doing a generic RFC 
3986 parse when it does not recognize the scheme.

--
nosy: +r.david.murray
versions: +Python 3.1, Python 3.2

___
Python tracker 

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



[issue7917] list of list created by *

2010-02-12 Thread Andrew Chong

Changes by Andrew Chong :


--
nosy: sledge76
severity: normal
status: open
title: list of list created by *
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



[issue7917] list of list created by *

2010-02-12 Thread Andrew Chong

New submission from Andrew Chong :

This shows unexpected behavior.

>>> data2 = [[]] * 4
>>> print data2
[[], [], [], []]
>>> data2[0] += [(0,1)]
>>> print data2
[[(0, 1)], [(0, 1)], [(0, 1)], [(0, 1)]]

I added a tuple to only 0th list, but it got added to all the lists in the 
global list.

--
components: +None
type:  -> behavior

___
Python tracker 

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



[issue7917] list of list created by *

2010-02-12 Thread Andrew Chong

Andrew Chong  added the comment:

But this works fine.

>>> data = []
>>> data += [[]]
>>> data += [[]]
>>> data += [[]]
>>> data += [[]]
>>> print data  
[[], [], [], []]
>>> data[0] += [(0,1)]
>>> print data
[[(0, 1)], [], [], []]

--

___
Python tracker 

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



[issue7917] list of list created by *

2010-02-12 Thread Florent Xicluna

Florent Xicluna  added the comment:

It is by design.

Please read the documentation:
http://docs.python.org/library/stdtypes.html#sequence-types-str-unicode-list-tuple-buffer-xrange

--
nosy: +flox
resolution:  -> invalid

___
Python tracker 

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



[issue7917] list of list created by *

2010-02-12 Thread Florent Xicluna

Changes by Florent Xicluna :


--
status: open -> closed

___
Python tracker 

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



[issue7712] Add a context manager to change cwd in test.test_support and run the test suite in a temp dir.

2010-02-12 Thread Florent Xicluna

Florent Xicluna  added the comment:

Fixed on trunk with r78136.

Before closing this issue, we may apply additional cleanup on regrtest:
 - the "sys.path" hack is not needed anymore (no risk of relative imports)
 - the hack for sys.argv[0] could be removed too, and use __file__ instead

--
Added file: 
http://bugs.python.org/file16218/issue7712_regrtest_remove_hacks.diff

___
Python tracker 

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



[issue7712] Add a context manager to change cwd in test.test_support and run the test suite in a temp dir.

2010-02-12 Thread Florent Xicluna

Changes by Florent Xicluna :


Removed file: 
http://bugs.python.org/file16218/issue7712_regrtest_remove_hacks.diff

___
Python tracker 

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



[issue7712] Add a context manager to change cwd in test.test_support and run the test suite in a temp dir.

2010-02-12 Thread Florent Xicluna

Changes by Florent Xicluna :


Added file: http://bugs.python.org/file16219/issue7712_regrtest_rm_hacks.diff

___
Python tracker 

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



[issue7805] test_multiprocessing failure

2010-02-12 Thread Stefan Krah

Stefan Krah  added the comment:

I can reproduce it almost always under these conditions:

System: Ubuntu Intrepid 64-bit, running on the actual hardware.
CPU: Core 2 Duo.
Load: At least one core maxed out by another process.

On an empty machine I haven't reproduced it yet.

--
nosy: +skrah

___
Python tracker 

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



[issue7805] test_multiprocessing failure

2010-02-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Indeed, I forgot to mention that the Debian Lenny install I reproduce the bug 
on is a single core (virtual) machine.

--

___
Python tracker 

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



[issue5651] OS X Installer: add checks to ensure proper Tcl configuration during build

2010-02-12 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

Katherine: how did you install Python, did you use the installer on the 
python.org website or some other installer (or even by building from source)?

--

___
Python tracker 

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



[issue7918] distutils always ignores compile errors

2010-02-12 Thread Oliver Jeeves

New submission from Oliver Jeeves :

When trying to build a python package for distribution, compile errors are 
always ignored. The setup function will return successfully even if it was 
unable to compile some modules due to, for example, indentation errors.

The specific situation I'm trying to deal with, is a script that builds a large 
number of eggs, and trying to detect if something went wrong.

I see that this has been raised as a bug for setuptools:

http://bugs.python.org/setuptools/issue61

But it's not considered an issue because it's how distutils works.

distutils.util.byte_compile calls py_compile.compile, but does not pass a 
doraise argument to it.

The only suggestion for how to get tools that use distutils.util.byte_compile 
(like setuptools.setup and distutils.core.setup) to exit on an error is to 
monkey patch py_compile.compile to change its default doraise argument to True. 
That suggestion came from here:

http://stackoverflow.com/questions/2230843/how-can-i-detect-errors-programatically-when-building-an-egg-with-setuptools

supressing compile errors when making a distribution seems like a bug to me, 
but just having the option to easily change this behaviour would be great.

--
assignee: tarek
components: Distutils
messages: 99273
nosy: Oliver.Jeeves, tarek
severity: normal
status: open
title: distutils always ignores compile errors
type: feature request
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



[issue7900] posix.getgroups() failure on Mac OS X

2010-02-12 Thread Shashwat Anand

Shashwat Anand  added the comment:

I don't see any issue here, runs perfectly fine on Mac OS X (Snow Leopard)

Shashwat-Anands-MacBook-Pro:test l0nwlf$ pwd
/Users/l0nwlf/python-svn/Lib/test
Shashwat-Anands-MacBook-Pro:test l0nwlf$ python2.7 test_posix.py
testNoArgFunctions (__main__.PosixTester) ... ok
test_access (__main__.PosixTester) ... ok
test_chdir (__main__.PosixTester) ... ok
test_chflags (__main__.PosixTester) ... ok
test_chown (__main__.PosixTester) ... ok
test_confstr (__main__.PosixTester) ... ok
test_dup (__main__.PosixTester) ... ok
test_dup2 (__main__.PosixTester) ... ok
test_fchown (__main__.PosixTester) ... ok
test_fdopen (__main__.PosixTester) ... ok
test_fstat (__main__.PosixTester) ... ok
test_fstatvfs (__main__.PosixTester) ... ok
test_ftruncate (__main__.PosixTester) ... ok
test_getcwd_long_pathnames (__main__.PosixTester) ... ok
test_initgroups (__main__.PosixTester) ... ok
test_lchflags (__main__.PosixTester) ... ok
test_lchown (__main__.PosixTester) ... ok
test_lsdir (__main__.PosixTester) ... ok
test_osexlock (__main__.PosixTester) ... ok
test_osshlock (__main__.PosixTester) ... ok
test_pipe (__main__.PosixTester) ... ok
test_stat (__main__.PosixTester) ... ok
test_statvfs (__main__.PosixTester) ... ok
test_strerror (__main__.PosixTester) ... ok
test_tempnam (__main__.PosixTester) ... ok
test_tmpfile (__main__.PosixTester) ... ok
test_umask (__main__.PosixTester) ... ok
test_utime (__main__.PosixTester) ... ok

--
Ran 28 tests in 0.025s

OK

Shashwat-Anands-MacBook-Pro:test l0nwlf$ python2.7 --versionPython 2.7a3+
Shashwat-Anands-MacBook-Pro:test l0nwlf$ python2.7 
Python 2.7a3+ (trunk:78165, Feb 12 2010, 22:36:03) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import posix
>>> posix.getgroups()
[20, 204, 100, 98, 81, 80, 79, 61, 12, 402, 401]
>>>

--
nosy: +l0nwlf

___
Python tracker 

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



[issue7909] os.path.abspath(os.devnull) returns \\\\nul should be nul?

2010-02-12 Thread Shashwat Anand

Shashwat Anand  added the comment:

Seems fine to me, does not raise any errors. My OS is OS X Snow Leopard. I 
checked it in python 2.5, 2.6, 2.7 too, no issues raised.

Shashwat-Anands-MacBook-Pro:test l0nwlf$ python2.6
Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os,logging
>>> logging.basicConfig(level=logging.CRITICAL,
... format='%(asctime)s %(levelname)-8s %(message)s',
... datefmt='%a, %d %b %Y %H:%M:%S',
... filename=os.devnull,
... filemode='w')
>>>

--
nosy: +l0nwlf

___
Python tracker 

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



[issue7909] os.path.abspath(os.devnull) returns \\\\nul should be nul?

2010-02-12 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

>From the bug report, it look likes its specific to windows, not OS X.

--
nosy: +orsenthil

___
Python tracker 

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



[issue7900] posix.getgroups() failure on Mac OS X

2010-02-12 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

What is the (Apple Inc. build 5646) (dot 1) vs normal (Apple Inc. build 5646). ?

While, ronald.oussoren did make a lot some changes recently (r78149 to 
r78152).This fix could have been a side-effect of one of it, thought I could 
not find the direct correlation.

--
nosy: +orsenthil, ronaldoussoren

___
Python tracker 

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



[issue7909] os.path.abspath(os.devnull) returns \\\\nul should be nul?

2010-02-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

nul is a special "dos device"
_getfullpathname() correctly returns \\.\nul, but normpath() then simplifies it 
to \\nul

I suggest that normpath() be changed to consider \\.\ as a special prefix, and 
keep it intact when it appears at the start of the path. See also
http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx

--
keywords: +easy
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue7900] posix.getgroups() failure on Mac OS X

2010-02-12 Thread Michael Foord

Michael Foord  added the comment:

I still see it on trunk (revision 78165). No idea what the (dot 1) means.

--

___
Python tracker 

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



[issue5651] OS X Installer: add checks to ensure proper Tcl configuration during build

2010-02-12 Thread Ned Deily

Ned Deily  added the comment:

Ah, earlier you said you installed Python 2.6.4 but, in your most recent 
message, it shows:

katrinewhiteson$ python
Python 2.6 (trunk:66714:66715M, Oct  1 2008, 18:36:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin

I'm not sure what that is but it's not python 2.6.4 nor a python.org python nor 
an Apple-supplied python.  So chances are it was linked with Tk 10.5 present on 
the system.  Type:
which python
to find out where this one is installed and, if necessary, remove it and 
re-install a python, like from the python.org installer, that was linked with 
Tk 8.4.  You then should see something like this:

Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin

--

___
Python tracker 

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



[issue7919] reading scientific notation using d instead of e on max osx

2010-02-12 Thread ricitron

New submission from ricitron :

I would like to be able to read in data that uses scientific notation with a D 
instead of an E. This is possible on windows and other builds, but not on Mac 
OSX. 

example:
float('1.23D+04')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: invalid literal for float(): 1.23D+04

--
assignee: ronaldoussoren
components: Macintosh
messages: 99281
nosy: ricitron, ronaldoussoren
severity: normal
status: open
title: reading scientific notation using d instead of e on max osx
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



[issue7919] reading scientific notation using d instead of e on max osx

2010-02-12 Thread Eric Smith

Eric Smith  added the comment:

str->float conversions have been reworked in 2.7 and 3.1. The 'D' exponent will 
not on any platform starting with those versions.

So, this would be a non-platform specific feature request.

--
assignee: ronaldoussoren -> 
components: +Interpreter Core -Macintosh
nosy: +eric.smith, mark.dickinson
versions: +Python 2.7, Python 3.2 -Python 2.5

___
Python tracker 

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



[issue7919] reading scientific notation using d instead of e on max osx

2010-02-12 Thread Eric Smith

Eric Smith  added the comment:

That was supposed to say:

The 'D' exponent will not work on any platform starting with those versions.

--

___
Python tracker 

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



[issue7919] reading scientific notation using d instead of e on max osx

2010-02-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

Out of curiosity, where are your data coming from?

For Python, this seems like a needless complication.  It should be simple 
enough to replace the 'D's with 'E's prior to passing the strings to float.

I notice that some varieties of Lisp and Scheme use 's', 'f', 'd', 'l' as the 
exponent marker for floats of different precisions (short, single, double, long 
double).  But Python only has one precision of float.

--

___
Python tracker 

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



[issue7919] reading scientific notation using d instead of e on max osx

2010-02-12 Thread ricitron

ricitron  added the comment:

I am running python 2.5.4. While it works on linux and windows, it does not 
work on mac. 

Fortran doubles are output using the D notation. If I am importing a large 
amount of data, I would rather not do a search and replace every time before 
reading in the data.

--

___
Python tracker 

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



[issue7505] ctypes not converting None to Null in 64-bit system

2010-02-12 Thread Stefan Krah

Stefan Krah  added the comment:

Confirm that 2.5 is the only troublesome version, but also when compiled from 
source (Ubuntu 64-bit, 2.5.5).

--
nosy: +skrah
versions: +Python 2.5 -Python 2.6

___
Python tracker 

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



[issue7919] reading scientific notation using d instead of e on max osx

2010-02-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

Sorry, I'm -1 on this:  outside Fortran, using 'E' for the exponent marker 
seems to be near universal.  It just doesn't seem worth adding the extra 
complication to the Python code, or going through all the various places that 
expect an 'e' (float literals in Python source, inputs to the float function, 
Decimal and Fraction inputs, complex numbers, etc.) and trying to decide 
whether 'd' should be supported there too.

Even in Fortran, isn't it normal to output floats and doubles using the 'E' 
format specifier?

--

___
Python tracker 

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



[issue7919] reading scientific notation using d instead of e on max osx

2010-02-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

> I would rather not do a search and replace every time before reading in > the 
> data.

There's no need to do a search and replace *before* reading the data:  read the 
data first, then have Python do the replace for you before passing each string 
to float:

>>> t = string.maketrans('d', 'e')
>>> '-14.235d+03'.translate(t)
'-14.235e+03'

--

___
Python tracker 

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



[issue7919] reading scientific notation using d instead of e on max osx

2010-02-12 Thread Eric Smith

Eric Smith  added the comment:

Unless and until we implement 'd' exponents, we should add a test to make sure 
they don't work. That they ever worked on any platform was a surprise. 
--
Eric.

--
title: reading scientific notation using d instead of e on max osx -> reading 
scientific notation using d instead of e on max   osx

___
Python tracker 

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



[issue7904] urlparse.urlsplit mishandles novel schemes

2010-02-12 Thread mARK

mARK  added the comment:

The case which prompted this issue was a purely private set of URLs, sent to me 
by a client but never sent to Amazon or anywhere else outside our systems 
(though I'm sure many others have invented this particular scheme for their own 
use).  It would have been convenient if urlparse had handled it properly.  That 
is true for any scheme one may invent at need.

On second thought it does make sense to enforce the use of :// for the schemes 
in uses_netloc, but still not to ignore its meaning for other schemes.  It also 
makes sense to add s3 to uses_netloc despite the fact that it is not (afaik) 
registered, since it is an obvious invention.

I'll make another patch, but I don't have time to do it just now.

--
components: +Extension Modules -Library (Lib)
versions:  -Python 3.1, Python 3.2

___
Python tracker 

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



[issue7904] urlparse.urlsplit mishandles novel schemes

2010-02-12 Thread mARK

Changes by mARK :


--
components: +Library (Lib) -Extension Modules
versions: +Python 3.1, Python 3.2

___
Python tracker 

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



[issue7919] reading scientific notation using d instead of e on max osx

2010-02-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

Done in r78166 (trunk), r78167 (py3k).

--

___
Python tracker 

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



[issue7920] urllib2.HTTPRedirectHandler incorrect redirect

2010-02-12 Thread Andres Riancho

New submission from Andres Riancho :

Buggy code:

"""
if 'location' in headers:
newurl = headers.getheaders('location')[0]
elif 'uri' in headers:
newurl = headers.getheaders('uri')[0]
else:
return
newurl = urlparse.urljoin(req.get_full_url(), newurl)
"""

You might end up being redirected to some "strange" location if for some reason 
the value of "location" is C:\boot.ini, and you urlparse.urljoin the current 
URL with that one, you end up with C:\boot.ini . When the urllib2 library opens 
that, it will open a local file. What I did to fix it, is to verify that the 
protocol of the newurl is http or https.

"""
correct_protocol = newurl.startswith('http://')  or 
newurl.startswith('https://') 
if not correct_protocol:
return

"""

The fix should be applied just below the dangerous urlparse.urljoin.

--
components: Library (Lib)
messages: 99292
nosy: andresriancho
severity: normal
status: open
title: urllib2.HTTPRedirectHandler incorrect redirect
versions: Python 2.5, Python 2.6

___
Python tracker 

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



[issue7921] executemany() link in Connection.executemany should point to Cursor.executemany

2010-02-12 Thread Ville Skyttä

New submission from Ville Skyttä :

http://docs.python.org/dev/library/sqlite3.html#sqlite3.Connection.executemany

The executemany() link in "... then calls the cursor’s executemany() method 
..." points to Connection.executemany (itself), it should point to 
Cursor.executemany instead.

--
assignee: georg.brandl
components: Documentation
messages: 99293
nosy: georg.brandl, scop
severity: normal
status: open
title: executemany() link in Connection.executemany should point to 
Cursor.executemany
versions: Python 3.2

___
Python tracker 

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



[issue7920] urllib2.HTTPRedirectHandler incorrect redirect

2010-02-12 Thread Shashwat Anand

Shashwat Anand  added the comment:

In Python 2.7a3+, trunk:78165 the code is as follows: (note that there is a 
segment of code to fix malformed URLs)

"""
if 'location' in headers:
newurl = headers.getheaders('location')[0]
elif 'uri' in headers:
newurl = headers.getheaders('uri')[0]
else:
return

# fix a possible malformed URL
urlparts = urlparse.urlparse(newurl)
if not urlparts.path:
urlparts = list(urlparts)
urlparts[2] = "/"
newurl = urlparse.urlunparse(urlparts)

newurl = urlparse.urljoin(req.get_full_url(), newurl)

"""

--
nosy: +l0nwlf

___
Python tracker 

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



[issue7712] Add a context manager to change cwd in test.test_support and run the test suite in a temp dir.

2010-02-12 Thread Ezio Melotti

Ezio Melotti  added the comment:

I'm not sure it's safe to remove those hacks, they might be necessary in some 
corner case.
I'll also port this to py3k before closing the issue.

--

___
Python tracker 

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



[issue3132] implement PEP 3118 struct changes

2010-02-12 Thread Meador Inge

Meador Inge  added the comment:

Is anyone working on implementing these new struct modifiers?  If not, then I 
would love to take a shot at it.

--
nosy: +minge

___
Python tracker 

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



[issue3132] implement PEP 3118 struct changes

2010-02-12 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2010/2/12 Meador Inge :
>
> Meador Inge  added the comment:
>
> Is anyone working on implementing these new struct modifiers?  If not, then I 
> would love to take a shot at it.

Not to my knowledge.

--

___
Python tracker 

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



[issue7922] Python 3's 2to3 does not handle non-ascii source files

2010-02-12 Thread mike bayer

New submission from mike bayer :

given the following Python 2 source file:

# -*- encoding: utf-8

print 'bien mangé'

It can be converted to Python 3 using 2's 2to3 tool:

classic$ 2to3 test.py
 ... omitted ...
--- test.py (original)
+++ test.py (refactored)
@@ -1,3 +1,3 @@
 # -*- encoding: utf-8
 
-print 'bien mangé'
+print('bien mangé')

However that of Python 3.1.1 fails:

classic$ 2to3-3.1 test.py
   ... omitted ...
--- test.py (original)
+++ test.py (refactored)
@@ -1,3 +1,3 @@
 # -*- encoding: utf-8
 
Traceback (most recent call last):
  File "/usr/local/bin/2to3-3.1", line 6, in 
sys.exit(main("lib2to3.fixes"))
  File 
"/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib2to3/main.py",
 line 159, in main
options.processes)
  File 
"/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib2to3/refactor.py",
 line 616, in refactor
items, write, doctests_only)
  File 
"/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib2to3/refactor.py",
 line 276, in refactor
self.refactor_file(dir_or_file, write, doctests_only)
  File 
"/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib2to3/refactor.py",
 line 656, in refactor_file
*args, **kwargs)
  File 
"/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib2to3/refactor.py",
 line 332, in refactor_file
write=write, encoding=encoding)
  File 
"/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib2to3/refactor.py",
 line 432, in processed_file
self.print_output(old_text, new_text, filename, equal)
  File 
"/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib2to3/main.py",
 line 64, in print_output
print(line)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 
17: ordinal not in range(128)

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 99298
nosy: zzzeek
severity: normal
status: open
title: Python 3's 2to3 does not handle non-ascii source files
type: crash
versions: Python 3.1

___
Python tracker 

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



[issue7922] Python 3's 2to3 does not handle non-ascii source files

2010-02-12 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Please try 2to3 from 2.7a3 or the 2to3 trunk.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue7922] Python 3's 2to3 does not handle non-ascii source files

2010-02-12 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Sorry, I meant from the py3k branch.

--

___
Python tracker 

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



[issue7922] Python 3's 2to3 does not handle non-ascii source files

2010-02-12 Thread mike bayer

mike bayer  added the comment:

yes, its handled:

WARNING: couldn't encode test.py's diff for your terminal

is that fix specific to 2to3 or is that just how "print" works in 3.2 ?

--

___
Python tracker 

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



[issue7922] Python 3's 2to3 does not handle non-ascii source files

2010-02-12 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2010/2/12 mike bayer :
>
> mike bayer  added the comment:
>
> yes, its handled:
>
> WARNING: couldn't encode test.py's diff for your terminal
>
> is that fix specific to 2to3 or is that just how "print" works in 3.2 ?

It's just that whatever python guesses your terminal encoding is (try
print(sys.stdin.encoding)) might not be able to handle whatever
characters are in the source file, so we just don't print it. You can
change the default encoding with the PYTHONIOENCODING env var.

--

___
Python tracker 

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



[issue7922] Python 3's 2to3 does not handle non-ascii source files

2010-02-12 Thread Benjamin Peterson

Changes by Benjamin Peterson :


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

___
Python tracker 

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



[issue7922] Python 3's 2to3 does not handle non-ascii source files

2010-02-12 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

You can just use the --no-diffs option, btw, to avoid this problem on earlier 
versions.

--

___
Python tracker 

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



[issue7900] posix.getgroups() failure on Mac OS X

2010-02-12 Thread Shashwat Anand

Shashwat Anand  added the comment:

It seems they are basically the same thing, the version of GCC and the build of 
OS X(latest in the case here). Was not able to figure out the (dot 1) stuff 
though.

--
nosy:  -loewis, michael.foord, orsenthil, ronaldoussoren

___
Python tracker 

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



[issue7919] reading scientific notation using d instead of e on max osx

2010-02-12 Thread Eric Smith

Eric Smith  added the comment:

I'm -1 on this, too. Closing.

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

___
Python tracker 

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



[issue7900] posix.getgroups() failure on Mac OS X

2010-02-12 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

please not remove the nosy list. ( I guess, you did it by accident).
let's wait for ronald's response.

--
nosy: +loewis, michael.foord, orsenthil, ronaldoussoren

___
Python tracker 

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



[issue7900] posix.getgroups() failure on Mac OS X

2010-02-12 Thread Shashwat Anand

Shashwat Anand  added the comment:

Thanks for correcting it back. I did not even realized it.

--

___
Python tracker 

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



[issue7921] Some sqlite3 Connection methods point to themselves

2010-02-12 Thread Brian Curtin

Brian Curtin  added the comment:

Here's a patch which corrects executemany, along with execute and 
executescript. An explicit title is used, with a reference to the underlying 
Cursor methods.

--
keywords: +needs review, patch
nosy: +brian.curtin
priority:  -> low
stage:  -> patch review
title: executemany() link in Connection.executemany should point to 
Cursor.executemany -> Some sqlite3 Connection methods point to themselves
type:  -> behavior
versions: +Python 2.6, Python 2.7, Python 3.1
Added file: http://bugs.python.org/file16220/issue7921.diff

___
Python tracker 

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



[issue7920] urllib2.HTTPRedirectHandler incorrect redirect

2010-02-12 Thread Shashwat Anand

Changes by Shashwat Anand :


--
nosy: +orsenthil

___
Python tracker 

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



[issue3132] implement PEP 3118 struct changes

2010-02-12 Thread Travis Oliphant

Travis Oliphant  added the comment:

On Feb 12, 2010, at 7:29 PM, Meador Inge wrote:

>
> Meador Inge  added the comment:
>
> Is anyone working on implementing these new struct modifiers?  If  
> not, then I would love to take a shot at it.

That would be great.

-Travis

--

___
Python tracker 

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



[issue7900] posix.getgroups() failure on Mac OS X

2010-02-12 Thread Shashwat Anand

Shashwat Anand  added the comment:

5646 and 5646.1 are the builds of GCC by Apple. The various builds of gcc are 
present on http://www.opensource.apple.com/source/gcc/ 

[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin -> 
http://www.opensource.apple.com/source/gcc/gcc-5646.1/

[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
 -> http://www.opensource.apple.com/source/gcc/gcc-5646/

--

___
Python tracker 

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