[issue1293] Trailing slash in sys.path cause import failure

2007-11-07 Thread Guido van Rossum
Changes by Guido van Rossum: -- resolution: -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list

[issue1293] Trailing slash in sys.path cause import failure

2007-11-07 Thread Christian Heimes
Christian Heimes added the comment: I've checked in a fix in r58903 (py3k branch). __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list U

[issue1293] Trailing slash in sys.path cause import failure

2007-11-07 Thread Guido van Rossum
Guido van Rossum added the comment: Works for me! On Nov 7, 2007 6:08 AM, Christian Heimes <[EMAIL PROTECTED]> wrote: > > Christian Heimes added the comment: > > Brett Cannon wrote: > > Modules/getpath.c:joinpath() I think does what you want in C. > > I don't see how it is going to help us. > >

[issue1293] Trailing slash in sys.path cause import failure

2007-11-07 Thread Christian Heimes
Christian Heimes added the comment: Brett Cannon wrote: > Modules/getpath.c:joinpath() I think does what you want in C. I don't see how it is going to help us. I've a final offer before I declare the bug as SEP (someone else's problem): pseudo code #ifdef MS_WINDOWS rv = stat(...) if

[issue1293] Trailing slash in sys.path cause import failure

2007-11-06 Thread Brett Cannon
Brett Cannon added the comment: On 11/6/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > Guido van Rossum added the comment: > > > Another patch that uses os.path.normpath. > > Sorry, I really don't like to be importing os.path in order to be able > to process the path used for an import. Mod

[issue1293] Trailing slash in sys.path cause import failure

2007-11-06 Thread Guido van Rossum
Guido van Rossum added the comment: > Another patch that uses os.path.normpath. Sorry, I really don't like to be importing os.path in order to be able to process the path used for an import. __ Tracker <[EMAIL PROTECTED]> __

[issue1293] Trailing slash in sys.path cause import failure

2007-11-06 Thread Christian Heimes
Christian Heimes added the comment: Another patch that uses os.path.normpath. Added file: http://bugs.python.org/file8704/trailing_slash3.patch __ Tracker <[EMAIL PROTECTED]> __Index: Python/impor

[issue1293] Trailing slash in sys.path cause import failure

2007-11-06 Thread Guido van Rossum
Guido van Rossum added the comment: > How do you like > #ifdef MS_WINDOWS > /* Remove trailing / and \ - Windows' stat doesn't like them > - but > * keep the trailing slash of C:/ > */ > > Py_ssize_t i; > char mang

[issue1293] Trailing slash in sys.path cause import failure

2007-11-06 Thread Christian Heimes
Christian Heimes added the comment: Guido van Rossum wrote: > (1) Don't use s#; it will allow null bytes in the string, which we don't > want. > > (2) Put the entire trailing slash removal inside #ifdef MS_WINDOWS. Done aand done > (3) Careful! It seems the code you wrote would transform "C:/

[issue1293] Trailing slash in sys.path cause import failure

2007-11-06 Thread Guido van Rossum
Changes by Guido van Rossum: -- resolution: accepted -> __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http

[issue1293] Trailing slash in sys.path cause import failure

2007-11-06 Thread Guido van Rossum
Guido van Rossum added the comment: I see several problems with this, but there's light at the end of the tunnel. (1) Don't use s#; it will allow null bytes in the string, which we don't want. (2) Put the entire trailing slash removal inside #ifdef MS_WINDOWS. (3) Careful! It seems the code y

[issue1293] Trailing slash in sys.path cause import failure

2007-11-01 Thread Brett Cannon
Brett Cannon added the comment: I will have a look when I can. __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue1293] Trailing slash in sys.path cause import failure

2007-11-01 Thread Christian Heimes
Christian Heimes added the comment: Fixed patch. Georg pointed out that PyArg_ParseTuple("s") returns a reference to the internal data of the PyString object. The new version copies the path to a fixed width buffer before it mangles the trailing slashes. The new patch applies against the trunk.

[issue1293] Trailing slash in sys.path cause import failure

2007-11-01 Thread Christian Heimes
Christian Heimes added the comment: Here is a patch that solves the problem. However the patch is against the py3k sources and I like somebody to review and test it. I don't have enough disk space in my VMWare box to test it against the trunk or 2.5. Reason for the problem: Windows' stat doesn't

[issue1293] Trailing slash in sys.path cause import failure

2007-11-01 Thread Christian Heimes
Christian Heimes added the comment: I was able to reproduce the bug on Windows with Python 2.6 and 3.0. I've added an unit test to both versions. -- nosy: +tiran priority: -> low resolution: -> accepted versions: +Python 2.6, Python 3.0 __ Tracker <[EMA

[issue1293] Trailing slash in sys.path cause import failure

2007-11-01 Thread Facundo Batista
Facundo Batista added the comment: Only in win32, in Linux it behaves ok (I put a /tmp/w.py that prints 'w'): Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>>

[issue1293] Trailing slash in sys.path cause import failure

2007-10-18 Thread Guillaume Girard
New submission from Guillaume Girard: On win32, the following code: import sys sys.path.append('../bar/') import bar where the file bar.py is present in ../bar/ will return an import error "No module named bar". Remove the trailing slash and the bar.py is imported correctly. The problem is iden