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

Bug wrong encoding when uploading Nordic characters through files API #1398

Merged
merged 4 commits into from
Oct 3, 2023

Conversation

doctrino
Copy link
Contributor

@doctrino doctrino commented Oct 3, 2023

Description

Reference psf/requests#5560

Checklist:

  • Tests added/updated.
  • Documentation updated. Documentation is generated from docstrings - these must be updated according to your change.
    If a new method has been added it should be referenced in cognite.rst in order to generate docs based on its docstring.
  • Changelog updated in CHANGELOG.md.
  • Version bumped. If triggering a new release is desired, bump the version number in _version.py and pyproject.toml per semantic versioning.

@doctrino doctrino marked this pull request as ready for review October 3, 2023 07:26
@doctrino doctrino requested review from a team as code owners October 3, 2023 07:26
Comment on lines +548 to +549
if isinstance(content, str):
content = content.encode("utf-8")
Copy link
Contributor

@haakonvt haakonvt Oct 3, 2023

Choose a reason for hiding this comment

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

Is this a Windows requests bug? Great catch anyway!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually, based on the bug it seems to also happen on unix systems.

@doctrino doctrino changed the title Bug wrong Encoding on Windows when uploading Nordic characters through files api Bug wrong encoding when uploading Nordic characters through files API Oct 3, 2023
@codecov
Copy link

codecov bot commented Oct 3, 2023

Codecov Report

Merging #1398 (2822ec7) into master (1b91474) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1398      +/-   ##
==========================================
- Coverage   90.64%   90.62%   -0.02%     
==========================================
  Files         117      117              
  Lines       14216    14218       +2     
==========================================
- Hits        12886    12885       -1     
- Misses       1330     1333       +3     
Files Coverage Δ
cognite/client/_api/files.py 97.35% <100.00%> (+0.02%) ⬆️
cognite/client/_version.py 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@doctrino doctrino merged commit 4512da3 into master Oct 3, 2023
@doctrino doctrino deleted the fix-encoding-issue-files-upload branch October 3, 2023 08:24
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.

3 participants