knossos-project / knossos_utils

Python library for interacting with KNOSSOS data sets and annotation files
GNU General Public License v2.0
9 stars 9 forks source link

Path handling works only for linux-style "/" separator #2

Closed orenshatz closed 9 years ago

orenshatz commented 9 years ago

Windows path ("/" separated) are completely not taken into account.

Optiligence commented 9 years ago

You know windows supports both?

orenshatz commented 9 years ago

Windows supports both, but our code currently doesn't supports Windows.

orenshatz commented 9 years ago

It's not even fully supported on Windows, try "dir c:/temp/" on command line.

orenshatz commented 9 years ago

The current bug was that glob.glob returns a backslash on Windows, while the code expects hard-coded forward slash everywhere. For now I solve the problem by replacing the OS path separator with a hard-coded forward-slash. The current long-term solution is just to keep using hard-coded forward-slash everywhere, and treat each backward-slash case (as above) adequately. The user is therefore also expected to pass only forward-slashed paths to DatasetUtils. I documented this in the function docs.