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

fix: specify encoding when reading and writing amber fossils #198

Merged
merged 4 commits into from
Apr 19, 2020
Merged

Conversation

iamogbz
Copy link
Collaborator

@iamogbz iamogbz commented Apr 19, 2020

Description

Specifies what encoding to use when reading and writing snapshots to amber fossils

Related Issues

Checklist

  • This PR has sufficient test coverage.
  • I will merge this pull request with a semantic title.

Additional Comments

  • Unable to test atm

@codecov
Copy link

codecov bot commented Apr 19, 2020

Codecov Report

Merging #198 into master will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #198   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           16        16           
  Lines          868       868           
=========================================
  Hits           868       868           

@iamogbz iamogbz requested a review from noahnu April 19, 2020 17:21
@iamogbz iamogbz marked this pull request as ready for review April 19, 2020 17:21
@@ -57,7 +57,7 @@ def read_file(cls, filepath: str) -> "SnapshotFossil":
indent_len = len(cls._indent)
snapshot_fossil = SnapshotFossil(location=filepath)
try:
with open(filepath, "r", newline="") as f:
with open(filepath, "r", encoding="utf-8", newline="") as f:
Copy link
Collaborator

Choose a reason for hiding this comment

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

FTR, https://docs.python.org/3/library/functions.html#open:

In text mode, if encoding is not specified the encoding used is platform dependent: locale.getpreferredencoding(False) is called to get the current locale encoding.

@iamogbz iamogbz merged commit a6a53c4 into master Apr 19, 2020
@iamogbz iamogbz deleted the fix-196 branch April 19, 2020 17:50
syrupy-bot pushed a commit that referenced this pull request Apr 19, 2020
## [0.4.1](v0.4.0...v0.4.1) (2020-04-19)

### Bug Fixes

* specify encoding when reading and writing amber fossils ([#198](#198)) ([a6a53c4](a6a53c4))
@syrupy-bot
Copy link
Contributor

🎉 This PR is included in version 0.4.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with Snapshots and Asian Characters
3 participants