Bug #82767 Calling help() in mysqlsh --py results in AttributeError
Submitted: 28 Aug 2016 17:57 Modified: 5 Oct 2017 8:35
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Document Store: MySQL Shell Severity:S3 (Non-critical)
Version:1.0.4 OS:Any
Assigned to: CPU Architecture:Any

[28 Aug 2016 17:57] Daniël van Eeden
Description:
If I run help() in mysql shell in python mode it throws an exception.

How to repeat:
mysql-py> help()

Welcome to Python 2.7!  This is the online help utility.

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://docs.python.org/2.7/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics".  Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam".

help> Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python2.7/site.py", line 459, in __call__
    return pydoc.help(*args, **kwds)
  File "/usr/lib64/python2.7/pydoc.py", line 1794, in __call__
    self.interact()
  File "/usr/lib64/python2.7/pydoc.py", line 1806, in interact
    request = self.getline('help> ')
  File "/usr/lib64/python2.7/pydoc.py", line 1817, in getline
    return raw_input(prompt)
AttributeError: module

Python 2.7.12 (default, Aug  9 2016, 15:48:18) 
[GCC 6.1.1 20160621 (Red Hat 6.1.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> help()

Welcome to Python 2.7!  This is the online help utility.

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://docs.python.org/2.7/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics".  Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam".

help>
[28 Aug 2016 18:05] MySQL Verification Team
Hello Daniël,

Thank you for the report.

Thanks,
Umesh
[2 Jan 2017 14:26] Miguel Angel Nieto
This bug is probably the reason it is impossible to load any external library. numpy, pandas... most of them fail.
[2 Jan 2017 14:34] Miguel Angel Nieto
I have downgraded python to 2.7.10 from 2.7.12 and works as expected now. I can load all modules. help() still fails.
[5 Oct 2017 8:35] Margaret Fisher
Posted by developer:
 
Changelog entry added for MySQL Shell 8.0.4:
Running help() in &mysqlxshell; in Python mode caused an AttributeError.