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

NameError: name 'buffer' is not defined #16

Open
avijitnsec opened this issue Jul 8, 2018 · 2 comments
Open

NameError: name 'buffer' is not defined #16

avijitnsec opened this issue Jul 8, 2018 · 2 comments

Comments

@avijitnsec
Copy link

Got the following issue when working with Python 3.7 on Windows 10.
Traceback (most recent call last):
File "C:/Users/avijit.das/PycharmProjects/SampleTest/sample1.py", line 6, in
dev = MCP2210(vid, pid)
File "C:\Users\avijit.das\PycharmProjects\sample\venv\lib\site-packages\mcp2210\device.py", line 123, in init
self.cancel_transfer()
File "C:\Users\avijit.das\PycharmProjects\sample\venv\lib\site-packages\mcp2210\device.py", line 224, in cancel_transfer
self.sendCommand(commands.CancelTransferCommand())
File "C:\Users\avijit.das\PycharmProjects\sample\venv\lib\site-packages\mcp2210\device.py", line 134, in sendCommand
command_data = [ord(x) for x in buffer(command)]
NameError: name 'buffer' is not defined

Process finished with exit code 1

@avijitnsec
Copy link
Author

avijitnsec commented Jul 8, 2018

Source Code:
from mcp2210 import MCP2210
vid=0x04d8
pid=0x00de
dev = MCP2210(vid, pid)
dev.transfer("data")

dev.manufacturer_name = "Foobar Industries Ltd"
settings = dev.boot_chip_settings

print(settings)

@tracernz
Copy link

mcp2210 only supports Python 2. See http://python3porting.com/differences.html#buffer for the fix for this particular issue.

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