Skip to content

Avoid __file__ / PyOxidizer support #1366

Description

@jayvdb

PyOxidizer breaks on pwntools as it doesnt provide __file__ See indygreg/PyOxidizer#69 for more info about why, but the tl;dr version is __file__ is an optional attribute and should not be relied upon.

Currently the startup looks like

>>> import pwnlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pwnlib", line 43, in <module>
  File "importlib", line 127, in import_module
  File "pwnlib.args", line 62, in <module>
  File "pwnlib.term", line 6, in <module>
  File "pwnlib.term.completer", line 7, in <module>
  File "pwnlib.term.readline", line 9, in <module>
  File "pwnlib.term.text", line 126, in <module>
  File "pwnlib.term.text", line 27, in __init__
NameError: name '__file__' is not defined

It looks like many of the cases of __file__ being used here are optional, and could be omitted if not present.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions