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

Hangups crashes on windows. NameError: name 'fcntl' is not defined #186

Closed
ryantheleach opened this issue Dec 5, 2015 · 9 comments
Closed

Comments

@ryantheleach
Copy link

$ hangups
←]2;hangups
Traceback (most recent call last):
File "c:\Users\Ryan\AppData\Local\Programs\Python\Python35\Scripts\hangups-scr
ipt.py", line 9, in
load_entry_point('hangups==0.3.2', 'console_scripts', 'hangups')()
File "c:\users\ryan\appdata\local\programs\python\python35\lib\site-packages\h
angups\ui__main__.py", line 966, in main
datetimefmt, args.disable_notifications
File "c:\users\ryan\appdata\local\programs\python\python35\lib\site-packages\h
angups\ui__main__.py", line 79, in init
event_loop=urwid.AsyncioEventLoop(loop=loop)
File "c:\users\ryan\appdata\local\programs\python\python35\lib\site-packages\u
rwid\main_loop.py", line 111, in init
screen = raw_display.Screen()
File "c:\users\ryan\appdata\local\programs\python\python35\lib\site-packages\u
rwid\raw_display.py", line 89, in init
fcntl.fcntl(self._resize_pipe_rd, fcntl.F_SETFL, os.O_NONBLOCK)
NameError: name 'fcntl' is not defined

@tdryer
Copy link
Owner

tdryer commented Dec 5, 2015

Running hangups on Windows requires Cygwin.

@tdryer tdryer closed this as completed Dec 5, 2015
@ryantheleach
Copy link
Author

@tdryer
Copy link
Owner

tdryer commented Dec 6, 2015

Not sure what the problem is then. I've had reports that it works on Windows, but I haven't tried it myself.

@tdryer tdryer reopened this Dec 6, 2015
@alexpaluzzi
Copy link

Seeing same error on my Windows 7 box.

edit: Just tested on a Windows 10 box. Same error.

@btibs
Copy link

btibs commented May 8, 2016

Just installed on Windows 7 with Cygwin, same issue. I tried uninstalling and reinstalling urwid and installing hangups from source, but still the same errors. It's weird because if I start python and type in "import fcntl; fcntl.fcntl" it does exist - possibly an issue with multiple installations of python (I have 2.7 and 3.5 on normal Windows and Cygwin uses 3.4, but it seems to be running scripts located in 3.5 anyways). Any ideas?

(I don't care too much about the client, I just want to use the API, but so far I haven't found an easy way to find conversation ids without running the client at least once.)

@bokhua
Copy link

bokhua commented Jun 27, 2016

fcntl is a Unix only module, which provides an interface to the ioctl and fcntl functions on Unix. Within Windows OS, win32 api will provide all these I/O interfaces. And for hangups, it's using urwid for hangups ui.

So for windows os, there is a workaround: install Cygwin first, then install Python, hangups inside Cygwin shell. Hope it helps.

@glenviewjeff
Copy link

@tijko
Copy link

tijko commented Jul 26, 2022

@tdryer I have been planning on opening a PR upstream for urwid (as this is the lib where the error stems from) to include a fix for Windows machines.

If my changes are merged will you update the project accordingly? More specifically, basically making mention of the situation in your docs explaining how this is essentially yet another difference in how Windows v Linux (userspace api) pipes are implemented.

@tdryer
Copy link
Owner

tdryer commented Aug 3, 2022

I'd be happy to advertise Windows support if someone can test it to confirm that it works with an updated urwid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants