Closed davidc closed 4 years ago
Please can we get this into pip ASAP as it is a blocker for us. Thanks.
Fixed version forked here https://github.com/okazdal/RouterOS-api you can clone and install with python setup.py build and python setup.py install
I mean I don't see why that was necessary given you've literally just applied my pull request to another branch, leaving your branch identical to the one I already sent a pull request from....
This needs merging into master and then into pip.
@davidc Sorry that I can't help you get this merged - the wheels turn pretty slowly on this project!
@jgoclawski, could you take a look at the fix PR #48 ?
The fix proposed https://github.com/socialwifi/RouterOS-api/pull/46 does not fix this since sometimes the value is already bytes, so it causes another error this time in get_api():
It seems that sometimes the value is a string and sometimes it is already encoded into bytes.
Ideally we would store it only as one or the other, but it is necessary to allow bytes so that the hashed password in RouterOsApi.login() can still be transmitted (it starts with a null byte)
In the absence of a larger refactor, I have amended get_api_format, if the value is not already bytes, to first coerce it to string (allowing the user finally to set integer values), and then into bytes.