adds python 3.7 compatibility #297

Merged
benjamin-salchow merged 1 commits from master into master 2020-09-15 15:54:53 +01:00
benjamin-salchow commented 2020-03-15 12:28:19 +00:00 (Migrated from github.com)

I upgraded to Python 3.7 and I could not run your plug-in.

I got the following error: "Plugin Enclosure Plugin (4.13.1) is not compatible to Python 3.7.3 (compatibility string: >=2.7,<3)." But it does install fine with Python 3.7.

So I added just one line and it seems to work fine for me. I just use the DS18B20 as Temperature Sensor and I didn't test other features because I don't need them. But I don't get any issue or error with it by running Python 3.7. Hope that solves the issues of others that are upgrading to Python 3.7.

I upgraded to Python 3.7 and I could not run your plug-in. I got the following error: "Plugin Enclosure Plugin (4.13.1) is not compatible to Python 3.7.3 (compatibility string: >=2.7,<3)." But it does install fine with Python 3.7. So I added just one line and it seems to work fine for me. I just use the DS18B20 as Temperature Sensor and I didn't test other features because I don't need them. But I don't get any issue or error with it by running Python 3.7. Hope that solves the issues of others that are upgrading to Python 3.7.
benjamin-salchow commented 2020-03-15 15:35:39 +00:00 (Migrated from github.com)

Found an issue within file_name = os.path.basename(payload["file"]). Not sure if it's related to Python 3 or new OctoPrint version

2020-03-15 15:20:12,609 - octoprint.plugin - ERROR - Error while calling plugin enclosure
Traceback (most recent call last):
  File "/home/octopi/OctoPrint/venv/lib/python3.7/site-packages/OctoPrint-1.4.0-py3.7.egg/octoprint/plugin/__init__.py", line 224, in call_plugin
    result = getattr(plugin, method)(*args, **kwargs)
  File "/home/octopi/OctoPrint/venv/lib/python3.7/site-packages/octoprint_enclosure/__init__.py", line 1550, in on_event
    file_name = os.path.basename(payload["file"])
KeyError: 'file'
Found an issue within file_name = os.path.basename(payload["file"]). Not sure if it's related to Python 3 or new OctoPrint version ``` 2020-03-15 15:20:12,609 - octoprint.plugin - ERROR - Error while calling plugin enclosure Traceback (most recent call last): File "/home/octopi/OctoPrint/venv/lib/python3.7/site-packages/OctoPrint-1.4.0-py3.7.egg/octoprint/plugin/__init__.py", line 224, in call_plugin result = getattr(plugin, method)(*args, **kwargs) File "/home/octopi/OctoPrint/venv/lib/python3.7/site-packages/octoprint_enclosure/__init__.py", line 1550, in on_event file_name = os.path.basename(payload["file"]) KeyError: 'file' ```
vitormhenrique commented 2020-04-05 16:03:42 +01:00 (Migrated from github.com)

Have you tested all libraries and they still work on python 3?

Have you tested all libraries and they still work on python 3?
benjamin-salchow commented 2020-04-05 16:32:55 +01:00 (Migrated from github.com)

Hello @vitormhenrique ,
my DS18B20 Temperature sensor works fine and my buttons. I select and add other things, but I can't really test them. But I don't get any errors for it that could lead to Python3 incompatibility - but I totally agree - this should be tested by someone who has the hardware to verify Python 3 compatibly :-).

Have you a 3D-Printer configuration with more Items to test it?

I like you're plug-in but I just use those things and they work now as they should with my Python 3 set-up.

Hello @vitormhenrique , my DS18B20 Temperature sensor works fine and my buttons. I select and add other things, but I can't really test them. But I don't get any errors for it that could lead to Python3 incompatibility - but I totally agree - this should be tested by someone who has the hardware to verify Python 3 compatibly :-). Have you a 3D-Printer configuration with more Items to test it? I like you're plug-in but I just use those things and they work now as they should with my Python 3 set-up.
acvolt commented 2020-05-06 19:33:01 +01:00 (Migrated from github.com)

I manually made the change from this merge request and it allows it to work on my new Pi 4 Install.

I manually made the change from this merge request and it allows it to work on my new Pi 4 Install.
ruedli commented 2020-07-19 10:00:23 +01:00 (Migrated from github.com)

Thank you for the work involved in this. Is the upgrade downwards compatible, so may we expect the installed plugin to work with both Python 2 and Python 3? Will it be merged and available through the normal plugin-repository? If the single commit is all that is needed for 3.7 compatibility, I see no issues. Or are more changes needed?

Thank you for the work involved in this. Is the upgrade downwards compatible, so may we expect the installed plugin to work with both Python 2 and Python 3? Will it be merged and available through the normal plugin-repository? If the single commit is all that is needed for 3.7 compatibility, I see no issues. Or are more changes needed?
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Gandalf/OctoPrint-Enclosure#297