Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pydoc.py doesn't detect IronPython, help(foo) can hang #63652

Open
owlmonkey mannequin opened this issue Oct 30, 2013 · 2 comments
Open

pydoc.py doesn't detect IronPython, help(foo) can hang #63652

owlmonkey mannequin opened this issue Oct 30, 2013 · 2 comments
Labels
OS-windows type-bug An unexpected behavior, bug, or error

Comments

@owlmonkey
Copy link
Mannequin

owlmonkey mannequin commented Oct 30, 2013

BPO 19453
Nosy @tjguk, @jdhardy, @zware, @zooba

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2013-10-30.17:15:13.183>
labels = ['type-bug', 'OS-windows']
title = "pydoc.py doesn't detect IronPython, help(foo) can hang"
updated_at = <Date 2018-07-11.10:15:38.154>
user = 'https://bugs.python.org/owlmonkey'

bugs.python.org fields:

activity = <Date 2018-07-11.10:15:38.154>
actor = 'BreamoreBoy'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Windows']
creation = <Date 2013-10-30.17:15:13.183>
creator = 'owlmonkey'
dependencies = []
files = []
hgrepos = []
issue_num = 19453
keywords = []
message_count = 2.0
messages = ['201750', '228393']
nosy_count = 5.0
nosy_names = ['tim.golden', 'jeff.hardy', 'zach.ware', 'steve.dower', 'owlmonkey']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue19453'
versions = ['Python 2.7']

@owlmonkey
Copy link
Mannequin Author

owlmonkey mannequin commented Oct 30, 2013

The pager functions used by help() in StdLib's pydoc.py don't detect IronPython correctly and the result is a lack of functionality or in some cases a hang. This is similar to bpo-8110 in that the code attempts to detect windows with a check for "win32" from sys.platform and needs to check for "cli" as well to detect IronPython running on mono on linux/mac os or on windows.

My naive change to workaround the problem was to add the two line test for "cli" amidst getpager() here:

    if sys.platform == 'win32' or sys.platform.startswith('os2'):
        return lambda text: tempfilepager(plain(text), 'more <')
    if sys.platform == 'cli':
        return plainpager # IronPython
    if hasattr(os, 'system') and os.system('(less) 2>/dev/null') == 0:
        return lambda text: pipepager(text, 'less')

That two line addition allowed basic function and prevents the hang though maybe there is a better pager type that would work on IronPython. In our linux and windows tests though neither the tempfilepager nor pipepager would function on either platform.

I submitted the report to the IronPython issues tracker and someone there suggested posting the patch here.

@owlmonkey owlmonkey mannequin added type-crash A hard crash of the interpreter, possibly with a core dump OS-windows labels Oct 30, 2013
@BreamoreBoy
Copy link
Mannequin

BreamoreBoy mannequin commented Oct 3, 2014

There's a two line patch inline in msg201750. If it's acceptable I'll do a formal patch myself unless someone else wants to pick this up.

@serhiy-storchaka serhiy-storchaka added type-bug An unexpected behavior, bug, or error and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Jul 11, 2018
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant