A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-February/097503.html below:

[Python-Dev] __file__ is not always an absolute path

[Python-Dev] __file__ is not always an absolute path [Python-Dev] __file__ is not always an absolute pathAntoine Pitrou solipsis at pitrou.net
Mon Feb 8 13:51:22 CET 2010
Nick Coghlan <ncoghlan <at> gmail.com> writes:
> 
> The problem is that having '' as the first entry in sys.path currently
> means "do the import relative to the current directory". Unless we want
> to change the language semantics so we stick os.getcwd() at the front
> instead of '', then __file__ is still going to be relative sometimes.

"Changing the language semantics" is actually what I was thinking about :)
Do some people actually rely on the fact that changing the current directory
will also change the import path?

cheers

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4