eblot / pyftdi

FTDI device driver written in pure Python
Other
509 stars 212 forks source link

Couldn't set int as serial number #306

Open corteccia opened 2 years ago

corteccia commented 2 years ago

Hello!

I faced with very strange error firstly: I reflashed EEPROM on my FT4232, so it has different VID, PID, and serial_number too. The serial_number is looking pretty simple: '0005'. It lets me easily determine the exact FT4232 board I need. I am using misc.add_custom_devices() to add some devices, and I know they exist as candidates. But, because of my chosen serial_number, the URL couldn't be parsed properly, thus the exact device couldn't be found. This is happening because my serial_number could be turned to int and is smaller than 255, which are restrictions for locators[0] to see it as index although it is not index. I do believe there are some better ways for determining if the part of specificators is serial-number or not and it should be addressed and changed.

The workaround for this is, of course, just changing the serial_number of the device, although it seems not a very comfortable thing to do.

It seems like there are already some issues with index usage as in #267, so, I hope, you'll take a look at it. Thank you!