Skip to content

Conversation

@Sutorenja
Copy link

@Sutorenja Sutorenja commented Feb 21, 2025

This PR fixes #19

files.json (the file generated by doWriteFilesList()) stores platform-native paths to python packages. On Windows, the stored paths would be separated by backslashes, e.g. PIL\\BdfFontFile.py.

The stored paths are used directly by fs.ReadFile. fs.ReadFile is unconventional in that the paths MUST BE forward slashed regardless of the OS its ran on. From the io/fs docs:

Note that paths are slash-separated on all systems, even Windows. Paths containing other characters such as backslash and colon are accepted as valid, but those characters must never be interpreted by an FS implementation as path element separators

This PR converts the backslashes in the path to forward slashes right before calling fs.ReadFile. It does not change how the paths in files.json are stored.

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.

files.json path separator

1 participant