Skip to content

fcntl error on windows #509

Closed
Closed
@stranac

Description

@stranac

Getting the following error when running bpython-curses:

Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\bpython-curses.exe\__main__.py", line 5, in <module>
  File "C:\Python27\lib\site-packages\bpython\cli.py", line 84, in <module>
    from bpython import repl
  File "C:\Python27\lib\site-packages\bpython\repl.py", line 56, in <module>
    from bpython.history import History
  File "C:\Python27\lib\site-packages\bpython\history.py", line 34, in <module>
    from bpython.filelock import FileLock
  File "C:\Python27\lib\site-packages\bpython\filelock.py", line 33, in <module>
    class FileLock(object):
  File "C:\Python27\lib\site-packages\bpython\filelock.py", line 39, in FileLock
    def __init__(self, fd, mode=fcntl.LOCK_EX):
NameError: name 'fcntl' is not defined

This is due to fcntl not being defined on windows, and default arguments being evaluated on definition time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions