X Tutup
Skip to content

Exception when specifying python script via command line #260

@ikanobori

Description

@ikanobori

Running a bpython built from the default branch yields the following (test.py just prints "hello"):

[user@localhost bpython]$ bpython test.py
hello

Traceback (most recent call last):
  File "/usr/bin/bpython", line 9, in <module>
    load_entry_point('bpython==mercurial', 'console_scripts', 'bpython')()
  File "/usr/lib/python2.7/site-packages/bpython/cli.py", line 1939, in main
    return repl.extract_exit_value(exit_value)
  File "/usr/lib/python2.7/site-packages/bpython/repl.py", line 1061, in extract_exit_value
    if len(args) == 0:
TypeError: object of type 'int' has no len()

The attached diff fixes this problem.

Right below this code the exit_value is set to e.args in the case of exception, though... I'm not too sure how this code could be triggered, but if it is and e.args is not a string, similar problems will arise. What is the best solution in this case?

Once this bug is fixed and a new version of bpython sent to the yum repo, it should fix https://bugzilla.redhat.com/show_bug.cgi?id=983658

Thanks!


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup