alexjc / weboptout

Opt-Out tool to check Copyright reservations in a way that even machines can understand.
Other
190 stars 1 forks source link

retrieve_from_database - Path replacement not working as expected on Windows #12

Open mike-frank opened 11 months ago

mike-frank commented 11 months ago

https://github.com/alexjc/weboptout/blob/186cd73d2ac21398bd352da9453f544ccd230ce8/src/weboptout/utils.py#L96

Took some digging but I found that the data/tos.jsonl file wasn't being loaded on my Windows set up, as the path returned from the previous line is separated with '\' not '/'

I managed to get it to load by adding archive.replace('\\','/') before running archive.replace('src/weboptout/','')

alexjc commented 11 months ago

Thanks for reporting this. It should be os.path.sep but I haven't done cross-platform Python for 10 years so I fucked it up! I'll get to it for the next release if there's no PR.