Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Dev
Re: package imports, sys.path and os.chdir()
 

Index | Next | Previous | View Flat


brett at python

Apr 28, 2012, 12:20 PM


Views: 320
Permalink
Re: package imports, sys.path and os.chdir() [In reply to]

On Sat, Apr 28, 2012 at 12:16, R. David Murray <rdmurray [at] bitdance>wrote:

> On Sat, 28 Apr 2012 18:08:08 +1000, Nick Coghlan <ncoghlan [at] gmail>
> wrote:
> > On Sat, Apr 28, 2012 at 6:00 AM, Brett Cannon <brett [at] python> wrote:
> > > I'm personally in favour of changing the insertion of '' to sys.path to
> > > inserting the cwd when the interpreter is launched.
> >
> > I'm not, because it breaks importing from the interactive prompt if
> > you change directory after starting the session.
>
> Heh. I've never thought of doing that. I would not have expected it
> to work (change directory from the interactive prompt and be able to
> import something located in the new cwd). I don't know why I wouldn't
> have expected it to work, I just didn't.
>
> That said, could this insertion of '' only happen when the interactive
> prompt is actually posted, and otherwise use cwd?


If the decision to keep this entry around stands, can we consider changing
it to '.' instead of the empty string? It mucks up stuff if you are not
careful (e.g. ``os.listdir('')`` or ``"/".join(['', 'filename.py'])``).

Subject User Time
package imports, sys.path and os.chdir() tismer at stackless Apr 26, 2012, 2:30 PM
    Re: package imports, sys.path and os.chdir() ncoghlan at gmail Apr 26, 2012, 5:39 PM
    Re: package imports, sys.path and os.chdir() tismer at stackless Apr 27, 2012, 7:39 AM
        Re: package imports, sys.path and os.chdir() brett at python Apr 27, 2012, 1:00 PM
    Re: package imports, sys.path and os.chdir() v+python at g Apr 27, 2012, 1:37 PM
    Re: package imports, sys.path and os.chdir() tismer at stackless Apr 27, 2012, 2:21 PM
    Re: package imports, sys.path and os.chdir() ncoghlan at gmail Apr 28, 2012, 1:08 AM
    Re: package imports, sys.path and os.chdir() benjamin at python Apr 28, 2012, 6:35 AM
    Re: package imports, sys.path and os.chdir() rdmurray at bitdance Apr 28, 2012, 9:16 AM
        Re: package imports, sys.path and os.chdir() brett at python Apr 28, 2012, 12:20 PM
        Re: package imports, sys.path and os.chdir() pje at telecommunity Apr 28, 2012, 8:41 PM
    Re: package imports, sys.path and os.chdir() brett at python Apr 28, 2012, 12:16 PM
    Re: package imports, sys.path and os.chdir() brett at python Apr 28, 2012, 12:17 PM
    Re: package imports, sys.path and os.chdir() tjreedy at udel Apr 28, 2012, 7:02 PM
    Re: package imports, sys.path and os.chdir() steve at pearwood Apr 28, 2012, 8:20 PM
    Re: package imports, sys.path and os.chdir() ncoghlan at gmail Apr 28, 2012, 10:05 PM
    Re: package imports, sys.path and os.chdir() tismer at stackless Apr 29, 2012, 4:14 AM
    Re: package imports, sys.path and os.chdir() tismer at stackless Apr 29, 2012, 6:37 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.