You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The resource path after {{assets_path}} in the base.html are hard-coded, but you are not sanitizing the path that {{assets_path}} contains. This may have been the cause of #64, #74 and #199 if they were using Windows-based devices. It will work fine on unix-based devices, as they use forward slashes by default. But Windows does not.
Currently, the output ends up looking like this: C:\Users\<user>\AppData\Roaming\Python\Python310\site-packages\report\assets/gitstats.css. The use of mixed path separators is what is breaking it on Windows-based devices.
This needs to be implemented to ensure reliable use and not requiring the use of --copy-assets on all Windows-based devices.
A little side-note; Windows Vista and up support using forward slashes in paths, but still uses backslashes by default. If you merely replace the backslashes from the path you get from Windows devices and replace them with forward slashes, it will work.
I'm not entirely sure which file this is defined in, but if it is htmlreportcreator.py then appending .replace("\\","/") to self.assets_path = os.path.join(HERE, self.assets_subdir) may be enough. Though depending on whether or not the output is only a single backslash or two backslashes, the replace needs to be modified accordingly. Either way, I don't think that should impact unix-based devices, but that should be tested to make sure.
The text was updated successfully, but these errors were encountered:
The resource path after
{{assets_path}}
in the base.html are hard-coded, but you are not sanitizing the path that{{assets_path}}
contains. This may have been the cause of #64, #74 and #199 if they were using Windows-based devices. It will work fine on unix-based devices, as they use forward slashes by default. But Windows does not.Currently, the output ends up looking like this:
C:\Users\<user>\AppData\Roaming\Python\Python310\site-packages\report\assets/gitstats.css
. The use of mixed path separators is what is breaking it on Windows-based devices.This needs to be implemented to ensure reliable use and not requiring the use of
--copy-assets
on all Windows-based devices.A little side-note; Windows Vista and up support using forward slashes in paths, but still uses backslashes by default. If you merely replace the backslashes from the path you get from Windows devices and replace them with forward slashes, it will work.
I'm not entirely sure which file this is defined in, but if it is htmlreportcreator.py then appending
.replace("\\","/")
toself.assets_path = os.path.join(HERE, self.assets_subdir)
may be enough. Though depending on whether or not the output is only a single backslash or two backslashes, the replace needs to be modified accordingly. Either way, I don't think that should impact unix-based devices, but that should be tested to make sure.The text was updated successfully, but these errors were encountered: