unistra / python-glpi-api

Python module for interacting with GLPI using the API.
GNU General Public License v3.0
18 stars 10 forks source link

Invalid path separator while being run under Windows #2

Closed dakrup closed 4 years ago

dakrup commented 4 years ago

The method _set_method(self, endpoints) generates an invalid path due to os.path routine under Windows (invalid path separator): ` def _set_method(self, endpoints): """Generate the URL from endpoints.""" return os.path.join(self.url, [str(endpoint) for endpoint in endpoints]) ` We can get the path as: https://127.0.0.1/glpi/apirest.php\search/Computer ... then GLPI reports a 404 error. It's safer to construct path directly from endpoints together with UNIX path separator.

fmenabe commented 4 years ago

Thanks for pointing the bug. I can't test on Windows, can you confirm it works well now?

dakrup commented 4 years ago

Thanks for pointing the bug. I can't test on Windows, can you confirm it works well now?

Yes, now it works just fine. Thank you!