Skip to content

Conversation

@dannystaple
Copy link

Solution to issue #235 - regardless of the separator used, it will work in windows and unix environments.

Solution to issue #235 - regardless of the separator used, it will work in windows and unix environments.
@dannystaple
Copy link
Author

Tested on windows.

Need that too.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be carefull here! You are splitting with re's both \ and / but joining with os.path.

It also would be nice that such platform dependency should be hidden inside "child_folder" or config.get() (get_path()?). Either way, you should do that for every path you get from config or you pass it to a child_folder.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect you are probably right about the child_folder note - although you have to watch that links stay the web way, and only Windows FS paths go the Windows way.

Hmm - the split/join operation needs to be translating one OS separator to the other.

I am not sure about the legality of forward slashes in unix file names or backslashes in windows file names. I may be in danger here of assuming that they are not legal in them - and besides - if shared via source control, dropbox or some other means between them - it would be a problem there too - so this should be a safe assumption.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants