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

Not Python 3 compatible #1

Open
TXBDan opened this issue Aug 9, 2016 · 2 comments
Open

Not Python 3 compatible #1

TXBDan opened this issue Aug 9, 2016 · 2 comments

Comments

@TXBDan
Copy link

TXBDan commented Aug 9, 2016

Hello,

Thanks a ton for creating this wrapper. I'm sure you're well aware that this isn't Python 3 compatible. Any plans for a Python 3 version? Even after updating the prints and exception code in the setup.py script, i'm getting:

Traceback (most recent call last):
File "setup.py", line 211, in
cmdclass = {"build_ext":build_bindings} )
File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.4/distutils/command/install.py", line 583, in run
self.run_command('build')
File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.4/distutils/command/build.py", line 126, in run
self.run_command(cmd_name)
File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 197, in run
patch_dxl_sdk()
File "setup.py", line 133, in patch_dxl_sdk
print (sp.communicate(input=patch)[0])
File "/usr/lib/python3.4/subprocess.py", line 960, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib/python3.4/subprocess.py", line 1602, in _communicate
input_view = memoryview(self._input)
TypeError: memoryview: str object does not have the buffer interface

Thanks again!

@jthorniley
Copy link
Owner

Hi,

I'm afraid I don't have the device anymore and I never got around to making it work on python 3.

I think I've seen this error with other conversions though, the problem can be fixed in this frame:

File "setup.py", line 133, in patch_dxl_sdk
print (sp.communicate(input=patch)[0])

So if you find that line, try replacing it with these two:

patch_bytes = bytes(patch, 'UTF-8')
print(sp.communicate(input=patch_bytes)[0])

I'm guessing this a bit from here: http://stackoverflow.com/questions/5471158/typeerror-str-does-not-support-the-buffer-interface

But it will be easier for you to test it if you've got the device.

James

@TXBDan
Copy link
Author

TXBDan commented Aug 11, 2016

Great, that fixed it, thanks.

It had trouble downloading the Robotis linux SDK so I did it manually and it all installed fine.

Now I’ll try it out.

Thanks again,

Dan

From: James Thorniley [mailto:[email protected]]
Sent: Tuesday, August 09, 2016 4:51 AM
To: jthorniley/pyusb2ax [email protected]
Cc: Dan [email protected]; Author [email protected]
Subject: Re: [jthorniley/pyusb2ax] Not Python 3 compatible (#1)

Hi,

I'm afraid I don't have the device anymore and I never got around to making it work on python 3.

I think I've seen this error with other conversions though, the problem can be fixed in this frame:

File "setup.py", line 133, in patch_dxl_sdk
print (sp.communicate(input=patch)[0])

So if you find that line, try replacing it with these two:

patch_bytes = bytes(patch, 'UTF-8')
print(sp.communicate(input=patch_bytes)[0])

I'm guessing this a bit from here: http://stackoverflow.com/questions/5471158/typeerror-str-does-not-support-the-buffer-interface

But it will be easier for you to test it if you've got the device.

James


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #1 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/AErqZ20AeZBFdBQMvU66TM-OGtFeso6-ks5qeD9ygaJpZM4Jfpwc . https://github.com/notifications/beacon/AErqZ-uA2o36Gj97cpk4dM9hCnZJv7FAks5qeD9ygaJpZM4Jfpwc.gif

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

No branches or pull requests

2 participants