fastai / fastai_dev

fast.ai early development experiments
Apache License 2.0
638 stars 350 forks source link

Fix parent_label #267

Closed misza222 closed 4 years ago

misza222 commented 4 years ago

On MS Windows tests were not passing The problem was that os.path.sep was used in parent_label. However if path passed to the method was using *nix separators '/' it was breaking.

Another small bug was just in tests for RegexLabeller - regexp was assuming '/' as a separator

review-notebook-app[bot] commented 4 years ago

Check out this pull request on  ReviewNB

You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB.

sgugger commented 4 years ago

It's weird that os.path.sep doesn't return the right thing on Windows. In any case I think the correct fix is to use Path.split. Merging this for the fix on RegexLabeller and will push a follow-up commit using Path.split for parent labeler.