Help on symbol does not work with relative imports
Bug #1020973 reported by
Urs Fleisch
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-mode.el |
Fix Released
|
Medium
|
Andreas Roehler |
Bug Description
Reproduction:
Create two files mod1.py and mod2.py in the same directory.
--- mod1.py
def func1():
"""Help on func1."""
print 'func1'
--- mod2.py
import mod1
if __name__ == '__main__':
mod1.func1()
---
Point on mod1.func1, C-c C-e
Traceback (most recent call last):
File "/tmp/mod2.
import mod1;pydoc.
ImportError: No module named mod1
The python file generated to create the help text cannot import modules from the current directory.
The attached patch fixes the problem.
Related branches
lp:~ufleisch/python-mode/improve-completion
- Andreas Roehler: Approve
-
Diff: 74 lines (+24/-9)2 files modifiedcompletion/pycomplete.py (+16/-4)
completion/test_pycomplete.py (+8/-5)
Changed in python-mode: | |
assignee: | nobody → Andreas Roehler (a-roehler) |
milestone: | none → 6.1.0 |
importance: | Undecided → Medium |
Changed in python-mode: | |
status: | Confirmed → Fix Committed |
Changed in python-mode: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Hi Urs,
with example given, IMO it should print something like:
func1()
Help on func1.
##########
which it doesn't, so exists a bug.
Beside remember some discussion related to current directory and path.
AFAIU it considered a risk having the working dir in PYTHONPATH, resp. having that done unnoticed.
Maybe I'm misreading your patch or being wrong otherwise.
Or others may comment,
thanks,
Andreas