Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SP-1260 Fix UTF-16 Filename Encoding #46

Merged
merged 2 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Upcoming changes...

## [1.13.1] - PLACEHOLDER
## [1.14.0] - 2024-08-09
### Added
- Added support for Python3.12
- Module `pkg_resources` has been replaced with `importlib_resources`
- Module `pkg_resources` has been replaced with `importlib_resources`
- Added support for UTF-16 filenames

## [1.13.0] - 2024-06-05
### Added
Expand Down Expand Up @@ -336,3 +337,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[1.12.2]: https://github.com/scanoss/scanoss.py/compare/v1.12.1...v1.12.2
[1.12.3]: https://github.com/scanoss/scanoss.py/compare/v1.12.2...v1.12.3
[1.13.0]: https://github.com/scanoss/scanoss.py/compare/v1.12.3...v1.13.0
[1.14.0]: https://github.com/scanoss/scanoss.py/compare/v1.13.0...v1.14.0
2 changes: 1 addition & 1 deletion src/scanoss/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
THE SOFTWARE.
"""

__version__ = '1.13.0'
__version__ = '1.14.0'
6 changes: 1 addition & 5 deletions src/scanoss/winnowing.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,7 @@ def wfp_for_contents(self, file: str, bin_file: bool, contents: bytes) -> str:
return ''
# Print file line
content_length = len(contents)
# Use repr() to get an unambiguous string representation
file = repr(file)
# Remove the surrounding quotes that repr() adds
file = file[1:-1]
wfp_filename = file
wfp_filename = repr(file).strip("'") # return a utf-8 compatible version of the filename
if self.obfuscate: # hide the real size of the file and its name, but keep the suffix
wfp_filename = f'{self.ob_count}{pathlib.Path(file).suffix}'
self.ob_count = self.ob_count + 1
Expand Down