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

Unknown platform: CYGWIN_NT-10.0-WOW #537

Open
sharuzzaman opened this issue Sep 21, 2018 · 5 comments
Open

Unknown platform: CYGWIN_NT-10.0-WOW #537

sharuzzaman opened this issue Sep 21, 2018 · 5 comments
Milestone

Comments

@sharuzzaman
Copy link

Bug Report


Context


I'm testing appJar with Python in Cygwin

Expected Behaviour


appJar should run

Actual Behaviour


appJar does not run

Any error messages produced by appJar


$ ./main.py
Traceback (most recent call last):
File "./main.py", line 6, in
app = gui()
File "/cygdrive/c/Users/sharuzzr/Downloads/app/appJar/appjar.py", line 438, in init
self.platform = gui.GET_PLATFORM()
File "/cygdrive/c/Users/sharuzzr/Downloads/app/appJar/appjar.py", line 265, in GET_PLATFORM
raise Exception("Unknown platform: " + platform())
Exception: Unknown platform: CYGWIN_NT-10.0-WOW

Sample code, demonstrating the issue


$ cat main.py
#!/bin/env python

import the library

from appJar import gui

create a GUI variable called app

app = gui()

What steps are needed to reproduce the bug


  1. Install Cygwin
  2. Install Python 2.7 package in Cygwin
  3. Create main.py like above
  4. ./main.py

Version Information


$ python main.py -v
appJar: 0.93.0 Python: 2.7.14 TCL: 8.6, TK: 8.6 Platform: CYGWIN_NT-10.0-WOW
pid: 16036 locale: en_US

@jarvisteach
Copy link
Owner

Hi @sharuzzaman - thanks for raising this.

There are lots of platform specific sections inside appJar, trying to keep the same functionality across MAC/WINDOWS/LINUX - so, the first thing appJar does, is determine a platform.

I've not really come across CYGWIN before - I've just googled it, and it looks like a "linux emulator" running inside Windows.

So, if appJar finds CYGWIN I'll configure it to set Windows as the platform, I'm assuming all the Windows functionality will still be available?

@jarvisteach jarvisteach added this to the 1.0 milestone Sep 29, 2018
@sharuzzaman
Copy link
Author

So, if appJar finds CYGWIN I'll configure it to set Windows as the platform, I'm assuming all the Windows functionality will still be available?

Not really. Cygwin tries to map Linux/Unix API call to Windows equivalent using an emulated library. From Unix application point of view after being compiled in Cygwin, it is a Linux application. So I believe Cygwin should be best under Linux family, but some features might not be 100% available for Cygwin application.

I have tried to put Cygwin under Linux platform, but the code returns nothing.

@staticmethod
def GET_PLATFORM():
""" returns one of the gui class's three static platform variables """
if platform() in ["win32", "Windows"]:
return gui.WINDOWS
elif platform() == "Darwin":
return gui.MAC
elif platform() in ["Linux", "FreeBSD","CYGWIN_NT-10.0-WOW"]:
return gui.LINUX
else:
raise Exception("Unknown platform: " + platform())

sharuzzr@laptop /cygdrive/C/Users/sharuzzr/Downloads/app
$ ./main.py
Traceback (most recent call last):
File "./main.py", line 6, in
app = gui()
File "/cygdrive/C/Users/sharuzzr/Downloads/app/appJar/appjar.py", line 533, in init
self.topLevel = Tk()
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1819, in init
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable

sharuzzr@laptop /cygdrive/C/Users/sharuzzr/Downloads/app
$ export DISPLAY=:0

sharuzzr@laptop /cygdrive/C/Users/sharuzzr/Downloads/app
$ ./main.py

changing the return to gui.WINDOWS also show nothing

I think this might be related to Tk library as well. Maybe Cygwin should use Tk in Cygwin rather than Tk in Windows or Linux

@jarvisteach
Copy link
Owner

Difficult one, I don't have an environment right now where I can test this.

But the fix would have been to either have GET_PLATFORM() return gui.LINUX' or 'gui.WINDOWS

If both of those fail, then it's going to be a bigger problem!

@jarvisteach
Copy link
Owner

I've had a quick google, and found the following site: https://daddyathouse76.wordpress.com/2017/06/10/python-gui-on-cygwin/

Are you running an X server within CYGWIN? If not, that'll explain the no display error...

@jarvisteach
Copy link
Owner

Hi @sharuzzaman - I was wondering if this had given you any help?

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

2 participants