vshymanskyy / blynk-library-python

Blynk library for Python. Works with Python 2, Python 3, MicroPython.
https://blynk.io/
MIT License
281 stars 97 forks source link

os.uname() not supported on Windows #27

Closed jsikorsky closed 4 years ago

jsikorsky commented 5 years ago

os.uname() function is not supported on Windows platform (I use it for development). Since it's used only in banner upon library load, it's not crucial IMO and can be replaced by sys.platform, or omitted altogether.

Jurij

vshymanskyy commented 5 years ago

Thanks! will find an alternative... Does it crash? ;(

jsikorsky commented 5 years ago

Of course not, it just does not work without this simple fix.

Jurij

po 18. 2. 2019 v 20:09 odesílatel Volodymyr Shymanskyy < notifications@github.com> napsal:

Does it crash? ;(

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vshymanskyy/blynk-library-python/issues/27#issuecomment-464846404, or mute the thread https://github.com/notifications/unsubscribe-auth/AOgh9xUGzdEpSyKB54KG6UXiyh_6mZMeks5vOvpfgaJpZM4bBbjt .

jsikorsky commented 5 years ago

Well, in wider context it actually does crash - AttributeError is thrown upon import.

Traceback (most recent call last):
  File "C:/Users/jurij/Documents/waveforms/python/blynk_test2.py", line 2, in <module>
    from BlynkLib import Blynk
  File "C:\Users\jurij\Documents\waveforms\python\BlynkLib\__init__.py", line 1, in <module>
    from .BlynkLib import Blynk
  File "C:\Users\jurij\Documents\waveforms\python\BlynkLib\BlynkLib.py", line 50, in <module>
    /___/ for Python v""" + _VERSION + " (" + os.uname()[1] + ")\n")
AttributeError: module 'os' has no attribute 'uname'

Regards,

Jurij

vshymanskyy commented 5 years ago

OK thanks, will fix asap

On Mon, Feb 18, 2019, 10:03 PM jsikorsky <notifications@github.com wrote:

Well, in wider context it actually does crash - AttributeError is thrown upon import.

Traceback (most recent call last): File "C:/Users/jurij/Documents/waveforms/python/blynk_test2.py", line 2, in from BlynkLib import Blynk File "C:\Users\jurij\Documents\waveforms\python\BlynkLib_init.py", line 1, in from .BlynkLib import Blynk File "C:\Users\jurij\Documents\waveforms\python\BlynkLib\BlynkLib.py", line 50, in // for Python v""" + _VERSION + " (" + os.uname()[1] + ")\n") AttributeError: module 'os' has no attribute 'uname'

Regards,

Jurij

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vshymanskyy/blynk-library-python/issues/27#issuecomment-464859940, or mute the thread https://github.com/notifications/unsubscribe-auth/ABb9lFHzDxZfcKjF_YYMm9J-_UVXkbTZks5vOwcvgaJpZM4bBbjt .

jsikorsky commented 5 years ago

propose fix #33

parvaizahmad commented 4 years ago

Use platform.uname() instead of os.uname().

zurgeg commented 4 years ago

i just proposed a fix at PR #42

zurgeg commented 4 years ago

This issue should be closed since PR #33 is merged.