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: idle.py -n : help() doesn't work in a reopened shell window
Type: behavior Stage:
Components: IDLE Versions: Python 3.1, Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: kbk Nosy List: gregorlingl, kbk, sandro.tosi
Priority: normal Keywords:

Created on 2009-10-14 12:34 by gregorlingl, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg93980 - (view) Author: Gregor Lingl (gregorlingl) Date: 2009-10-14 12:34
The following procedure reveals a problem with help:

1) Start IDLE with -n option (no subprocess)
2) Create a script (e. g. helloworld one-liner
3) Run script
4) Close Shell Window
5) Via Menu: Run | Python Shell reopen Shell window
6) >>> help(print)
Help on ...
...
    end:  string appended after the last value, default a newline.
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    help(print)
  File "C:\Python31\lib\site.py", line 429, in __call__
    return pydoc.help(*args, **kwds)
  File "C:\Python31\lib\pydoc.py", line 1710, in __call__
    self.help(request)
  File "C:\Python31\lib\pydoc.py", line 1758, in help
    self.output.write('\n')
  File "C:\Python31\lib\idlelib\PyShell.py", line 1231, in write
    self.shell.write(s, self.tags)
  File "C:\Python31\lib\idlelib\PyShell.py", line 1212, in write
    self.text.mark_gravity("iomark", "right")
AttributeError: 'NoneType' object has no attribute 'mark_gravity'
>>> 

So in a re-opened Shell-Window in an IDLE in -n mode, help() doesn't
work correctly.

Regards,
Gregor
msg132521 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2011-03-29 20:18
Hi Gregor,
are you still able to replicate this bug? I just tried on a freshly built 3.3 and (hopefully correctly) following your description, I can print help just fine:

>>> help(print)
Help on built-in function print in module builtins:

print(...)
    print(value, ..., sep=' ', end='\n', file=sys.stdout)
    
    Prints the values to a stream, or to sys.stdout by default.
    Optional keyword arguments:
    file: a file-like object (stream); defaults to the current sys.stdout.
    sep:  string inserted between values, default a space.
    end:  string appended after the last value, default a newline.

>>>
msg132528 - (view) Author: Gregor Lingl (gregorlingl) Date: 2011-03-29 21:10
Right. I cannot replicate this bug even with an IDLE from Python 3.2. So it seems to me, that this problem has been solved.
Regards,
Gregor
msg132533 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2011-03-29 21:34
that's great, closing then :)
History
Date User Action Args
2022-04-11 14:56:53adminsetgithub: 51373
2011-03-29 21:34:22sandro.tosisetstatus: open -> closed
resolution: out of date
messages: + msg132533

stage: needs patch ->
2011-03-29 21:10:43gregorlinglsetmessages: + msg132528
2011-03-29 20:18:34sandro.tosisetnosy: + sandro.tosi

messages: + msg132521
versions: + Python 3.3
2010-07-11 09:56:13BreamoreBoysetassignee: kbk
stage: needs patch

nosy: + kbk
versions: + Python 2.7
2009-10-14 12:34:04gregorlinglcreate