This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: tutorial: Module search path description is incorrect
Type: Stage: resolved
Components: Documentation Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, python-dev, r.david.murray, techtonik
Priority: normal Keywords:

Created on 2011-06-18 14:34 by techtonik, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
portable-test.7z techtonik, 2011-06-20 09:02
Messages (7)
msg138584 - (view) Author: anatoly techtonik (techtonik) Date: 2011-06-18 14:34
http://docs.python.org/tutorial/modules.html#the-module-search-path

Module search path order description is misleading. When a module named spam is imported, the interpreter searches for a file named spam.py in the directory of the script with import instruction, not in the current directory.
msg138586 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-06-18 14:57
The second paragraph goes on to cover your point, but I agree that it is not as clear as it should be.
msg138676 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-06-20 00:42
New changeset bf8b4c43fb94 by Senthil Kumaran in branch '3.2':
Fix closes Issue12359 - Minor update to module import description.
http://hg.python.org/cpython/rev/bf8b4c43fb94

New changeset 8754fd2ff64a by Senthil Kumaran in branch 'default':
merge from 3.2. Issue 12359
http://hg.python.org/cpython/rev/8754fd2ff64a
msg138678 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-06-20 00:46
New changeset 6c16a31e0442 by Senthil Kumaran in branch '2.7':
Fix issue12359. Minor doc update on import module description.
http://hg.python.org/cpython/rev/6c16a31e0442
msg138694 - (view) Author: anatoly techtonik (techtonik) Date: 2011-06-20 09:00
On Mon, Jun 20, 2011 at 3:42 AM, Roundup Robot <report@bugs.python.org> wrote:
>
> New changeset bf8b4c43fb94 by Senthil Kumaran in branch '3.2':
> Fix closes Issue12359 - Minor update to module import description.
> http://hg.python.org/cpython/rev/bf8b4c43fb94

1. There is a typo 'thecurrent' in this commit
2. The interpreter doesn't search current directory. The first item appended to sys.path is the directory of the importing script.
msg138695 - (view) Author: anatoly techtonik (techtonik) Date: 2011-06-20 09:02
I attach file for testing import if anybody needs it. Move module.py to your current directory, but out of the dir with script.py and execute script.py using relative path from there.
msg138723 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-06-20 14:38
New changeset a57134dd8688 by Senthil Kumaran in branch '3.2':
Fix closes Issue12359 - Removing a confusing sentence from the previous change.
http://hg.python.org/cpython/rev/a57134dd8688

New changeset 18ebc7809cb2 by Senthil Kumaran in branch 'default':
merge from 3.2 - Fix closes Issue12359 - Removing a confusing sentence from the previous change.
http://hg.python.org/cpython/rev/18ebc7809cb2

New changeset 51ad2d4390bc by Senthil Kumaran in branch '2.7':
merge 3.2 - Fix closes Issue12359 - Removing a confusing sentence from the previous change.
http://hg.python.org/cpython/rev/51ad2d4390bc
History
Date User Action Args
2022-04-11 14:57:18adminsetgithub: 56568
2011-06-20 14:38:24python-devsetstatus: open -> closed

resolution: remind -> fixed
messages: + msg138723
2011-06-20 09:02:57techtoniksetfiles: + portable-test.7z

messages: + msg138695
2011-06-20 09:00:20techtoniksetstatus: closed -> open
resolution: fixed -> remind
messages: + msg138694
2011-06-20 00:46:21python-devsetmessages: + msg138678
2011-06-20 00:42:35python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg138676

resolution: fixed
stage: resolved
2011-06-18 14:57:56r.david.murraysetnosy: + r.david.murray
messages: + msg138586
2011-06-18 14:34:54techtonikcreate