Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Error after an upgrade to the last version #183

Copy link
Copy link

Description

@Krazybug
Issue body actions

Hello,
After an upgrade to the current version of Fire, I got the following error on a script i ran without any change.

>python myscript.py --help
INFO: Showing help with the command 'myscript.py -- --help'.

Traceback (most recent call last):
  File "myscript.py", line 733, in <module>
    fire.Fire()
  File ".../lib/python3.7/site-packages/fire/core.py", line 158, in Fire
    result, trace=component_trace, verbose=component_trace.verbose)
  File ".../lib/python3.7/site-packages/fire/helptext.py", line 78, in HelpText
    actions_grouped_by_kind)
  File ".../lib/python3.7/site-packages/fire/helptext.py", line 230, in _UsageDetailsSections
    sections.append(_MakeUsageDetailsSection(commands))
  File ".../lib/python3.7/site-packages/fire/helptext.py", line 415, in _MakeUsageDetailsSection
    info = inspectutils.Info(member)
  File ".../lib/python3.7/site-packages/fire/inspectutils.py", line 211, in Info
    info['docstring_info'] = docstrings.parse(info['docstring'])
  File ".../cali2/lib/python3.7/site-packages/fire/docstrings.py", line 180, in parse
    _consume_line(line_info, state)
  File ".../lib/python3.7/site-packages/fire/docstrings.py", line 413, in _consume_line
    _update_section_state(line_info, state)
  File ".../python3.7/site-packages/fire/docstrings.py", line 525, in _update_section_state
    google_section_permitted = _google_section_permitted(line_info, state)
  File ".../lib/python3.7/site-packages/fire/docstrings.py", line 582, in _google_section_permitted
    or line_info.indentation < state.section.line1_indentation)
TypeError: '<' not supported between instances of 'int' and 'NoneType'

It Seems that a object is compared in docstring.py

FYI: I don't have any docstring (""") in my script and this other snippet diplays correct help message but the error is still displayed after the help message:

import fire

def test():
    print("OK")

if __name__ == "__main__":
    fire.Fire()

Note also that when I reinstall fire, this snippet works perfectly (doc is displayed without an error following) as the help of every subcommands of my script.
It's only when i run python myscript.py --help that it's displayed the first time and after on each script i ran. It's sounds like something persistent changed in my env.

My version of python is 3.7.3.
I'm using virtualenv and pip
and here are my dependencies:

>pip freeze
beautifulsoup4==4.7.1
bs4==0.0.1
certifi==2019.3.9
chardet==3.0.4
fire==0.2.0
gevent==1.4.0
greenlet==0.4.15
humanize==0.5.1
idna==2.8
iso639==0.1.4
langid==1.1.6
lxml==4.3.4
numpy==1.16.3
requests==2.22.0
six==1.12.0
soupsieve==1.9.1
termcolor==1.1.0
urllib3==1.25.3
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.