[Bug 72227] Re: should avoid loading modules from working directory

2009-07-16 Thread Harald Meland
I am unable to reproduce this on Ubunty Jaunty, using either the bzr from the official Jaunty repository (1.13.1-1) or the current development version. I've tried the following procedure with both python 2.5.4-1ubuntu4 and 2.6.2-0ubuntu1: hmel...@octarine:~$ mkdir /tmp/,72227/

Re: [Bug 72227] Re: should avoid loading modules from working directory

2009-07-16 Thread Robert Collins
I think at one point the site-packages put '' in sys.path; also people can often accidentally have '' in their PYTHONPATH. I'm inclined to mark this invalid - as its not a bzr bug but rather an environmental one. -Rob -- should avoid loading modules from working directory

[Bug 72227] Re: should avoid loading modules from working directory

2009-07-16 Thread Forest Bond
Some of the earlier comments rather confuse the point. As the bug title says, bzr should avoid loading modules from working directory, whether that is the result of '' being in sys.path or otherwise. -- should avoid loading modules from working directory https://bugs.launchpad.net/bugs/72227

[Bug 72227] Re: should avoid loading modules from working directory

2009-07-16 Thread Forest Bond
[~] 06:45 for...@w038$ touch logging.py [~] 06:46 for...@w038$ bzr stat Traceback (most recent call last): File /usr/bin/bzr, line 125, in module import bzrlib.trace File /usr/lib/python2.6/dist-packages/bzrlib/trace.py, line 106, in module _bzr_logger = logging.getLogger('bzr')

Re: [Bug 72227] Re: should avoid loading modules from working directory

2009-07-16 Thread Robert Collins
On Thu, 2009-07-16 at 10:48 +, Forest Bond wrote: Some of the earlier comments rather confuse the point. As the bug title says, bzr should avoid loading modules from working directory, whether that is the result of '' being in sys.path or otherwise. bzr needs to load them when running

Re: [Bug 72227] Re: should avoid loading modules from working directory

2009-07-16 Thread Harald Meland
On Thu, Jul 16, 2009 at 12:47 PM, Forest Bondfor...@alittletooquiet.net wrote: [~] 06:45 for...@w038$ touch logging.py [~] 06:46 for...@w038$ bzr stat Traceback (most recent call last):  File /usr/bin/bzr, line 125, in module    import bzrlib.trace  File

[Bug 72227] Re: should avoid loading modules from working directory

2009-07-16 Thread Forest Bond
Harald, I'm afraid what you're saying isn't adding up. I can see from your test script that the CWD is in your sys.path. That clearly indicates that modules in your CWD should get imported. Why don't you tell me what you're doing to reproduce, and I'll see if I can help you figure out what the

Re: [Bug 72227] Re: should avoid loading modules from working directory

2009-07-16 Thread Harald Meland
On Thu, Jul 16, 2009 at 2:36 PM, Forest Bondfor...@alittletooquiet.net wrote: Harald, I'm afraid what you're saying isn't adding up.  I can see from your test script that the CWD is in your sys.path.  That clearly indicates that modules in your CWD should get imported. The _script

Re: [Bug 72227] Re: should avoid loading modules from working directory

2009-07-16 Thread Forest Bond
Howdie, On Thu, Jul 16, 2009 at 01:30:42PM -, Harald Meland wrote: On Thu, Jul 16, 2009 at 2:36 PM, Forest Bondfor...@alittletooquiet.net wrote: Harald, I'm afraid what you're saying isn't adding up.  I can see from your test script that the CWD is in your sys.path.  That clearly

Re: [Bug 72227] Re: should avoid loading modules from working directory

2009-07-16 Thread John A Meinel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 ... 09:54 for...@w038$ python /tmp/foo/test.py ['/tmp/foo', '/home/forest/usr/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg', '/home/forest/usr/lib/python2.5/site-packages/Satchmo-0.9_pre-py2.5.egg', '/home/forest/lib/python',

Re: [Bug 72227] Re: should avoid loading modules from working directory

2009-07-16 Thread Forest Bond
Hi, status invalid On Thu, Jul 16, 2009 at 02:24:24PM -, John A Meinel wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 ... 09:54 for...@w038$ python /tmp/foo/test.py ['/tmp/foo', '/home/forest/usr/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg',

Re: [Bug 72227] Re: should avoid loading modules from working directory

2009-07-16 Thread Forest Bond
Hi, affects bzr status invalid affects ubuntu/bzr status invalid On Thu, Jul 16, 2009 at 02:24:24PM -, John A Meinel wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 ... 09:54 for...@w038$ python /tmp/foo/test.py ['/tmp/foo',

[Bug 72227] Re: should avoid loading modules from working directory

2009-01-12 Thread vila
** Changed in: bzr Status: In Progress = Confirmed ** Changed in: bzr (Ubuntu) Status: In Progress = Confirmed -- should avoid loading modules from working directory https://bugs.launchpad.net/bugs/72227 You received this bug notification because you are a member of Ubuntu Bugs,

[Bug 72227] Re: should avoid loading modules from working directory

2008-12-03 Thread vila
Bumping importance because of bug #304891. Fixing bzr itself souldn't be that hard but there may be consequences on packaging it or running it locally (as ./bzr). ** Changed in: bzr Importance: Medium = High -- should avoid loading modules from working directory

[Bug 72227] Re: should avoid loading modules from working directory

2008-11-29 Thread John A Meinel
I'm pretty sure this code is wrong: cwd = os.getcwd() if not (cwd == os.path.dirname(os.__file__))): sys.path.remove(cwd) I think you want: cwd = os.getcwd() if not (cwd == os.path.dirname(__file__))): sys.path.remove(cwd) I'm don't understand why you would want the path to the 'os'

[Bug 72227] Re: should avoid loading modules from working directory

2008-11-29 Thread Forest Bond
Actually, Python's default search path always includes the current directory (up until 2.6 or so, I think). It was a long time ago that I suggested the above fix. I think that the reasoning was that I was trying to avoid removing the standard library, but the whole thing looks a bit half-baked

[Bug 72227] Re: should avoid loading modules from working directory

2008-11-29 Thread Forest Bond
I think sys.path.remove('') would probably be sufficient... -- should avoid loading modules from working directory https://bugs.launchpad.net/bugs/72227 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list

[Bug 72227] Re: should avoid loading modules from working directory

2008-11-28 Thread vila
** Tags added: easy -- should avoid loading modules from working directory https://bugs.launchpad.net/bugs/72227 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com

[Bug 72227] Re: should avoid loading modules from working directory

2007-11-19 Thread Martin Pool
** Summary changed: - bzr fails when run within certain Python code trees + should avoid loading modules from working directory -- should avoid loading modules from working directory https://bugs.launchpad.net/bugs/72227 You received this bug notification because you are a member of Ubuntu