Closed szczys closed 5 years ago
There is probably a Python 2 solution to this, but I'm pretty sure the quick fix is to use Python 3. We hope to support Python 2 for a while, but the Python developers plan to stop supporting it at the end of 2019.
I am able to reproduce the error by switching to Python 2.
It looks like one solution would be to replace tobytes() with tostring(). The latter is a deprecated alias in Python 3 for the Python 2 function name.
I had also tried installing on python 3 (sudo pip3 install --upgrade greatfet
) but was met with the following error:
Collecting greatfet
Downloading https://files.pythonhosted.org/packages/cc/93/b1713cc4bb43b86a2d8c27425e4a525dc3e1191f561b8d18b6427ae3861e/GreatFET-2019.5.1.dev0-py3-none-any.whl (125kB)
100% |████████████████████████████████| 133kB 1.7MB/s
Collecting future (from greatfet)
Downloading https://files.pythonhosted.org/packages/90/52/e20466b85000a181e1e144fd8305caf2cf475e2f9674e797b222f8105f5f/future-0.17.1.tar.gz (829kB)
100% |████████████████████████████████| 829kB 1.5MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'setuptools'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-b4bd42_q/future/
Looks like I didn't have python3 setuptool:
sudo apt-get install python3-setuptools
Now things are working. Thanks!
Oh, nice! I'm reopening because we either need to fix this bug or drop Python 2 support.
Using the bitstring module would be another solution. I'm not sure it's really warranted in this case, but bitstring.Bits(array.array('B', [0, 0])).bytes
does the same thing in both 2 and 3.
This should be fixed as of dfcd6a4.
Executing
greatfet info
results in error:System info: