Skip to content

Conversation

@dilawar
Copy link

@dilawar dilawar commented Jun 15, 2019

  • Requires PyQt5.
  • Does not require PySide (does not support >3.4)
  • Works with Python3.
  • Added couple of scripts for easy testing.

@suyashb95
Copy link
Owner

Thanks for this! I was thinking we could drop Python 2 support entirely

@dilawar
Copy link
Author

dilawar commented Jun 16, 2019 via email

@suyashb95
Copy link
Owner

The test run fails with an AttributeError while running on Python 3 (Windows)

Traceback (most recent call last):
  File "test_run.py", line 5, in <module>
    plot.start()
  File "E:\Projects\Python\SoftwareOscilloscope\SoftOscilloscope.py", line 79, in start
    self.plot_init()
  File "E:\Projects\Python\SoftwareOscilloscope\SoftOscilloscope.py", line 57, in plot_init
    trial_data = self.readline().split(',')
  File "E:\Projects\Python\SoftwareOscilloscope\SoftOscilloscope.py", line 51, in readline
    return self.stream.readline().decode('utf8', errors='ignore').rstrip()
AttributeError: 'str' object has no attribute 'decode'

readline() should always return a string, right? Why do we have to decode it again?

@dilawar
Copy link
Author

dilawar commented Jul 1, 2019

readline() should always return a string, right? Why do we have to decode it again?

pyserial on unix platforms (Linux/OSX) returns bytes. I guess, we have to type check and call different functions or use try, except block.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants