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

Updating to have this encode as configured #86

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

goosemo
Copy link

@goosemo goosemo commented Jun 24, 2017

Was getting some stack traces when this was writing out UTF-8 git commit log content. Made this change locally to address.

@vaab
Copy link
Owner

vaab commented Jun 24, 2017

Ok thx, can you tell us your platform (windows ? linux ? macosx ?, your python version ?)
I'll need to create a regression test on this bug to include your change. I guess it probably won't be as easy on all combination of platforms and version, but I can manage that.

@codecov
Copy link

codecov bot commented Jun 25, 2017

Codecov Report

Merging #86 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #86      +/-   ##
==========================================
+ Coverage   88.42%   88.45%   +0.02%     
==========================================
  Files           2        2              
  Lines         838      840       +2     
  Branches      168      169       +1     
==========================================
+ Hits          741      743       +2     
  Misses         58       58              
  Partials       39       39
Impacted Files Coverage Δ
src/gitchangelog/gitchangelog.py 88.34% <100%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e559343...5e90a1a. Read the comment docs.

@goosemo
Copy link
Author

goosemo commented Jun 25, 2017

So it was python2.7 on OSX.

I've just updated the code to be python version conditional, though that doesn't seem ideal.
I also added in a test change to make catch this case for the future. When added, and w/o my changes I'm able to recreate the issue I saw:

======================================================================
ERROR: test_insertions (test.test_publish.FileInsertAtFirstRegexMatchTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/mgoose/workspace/goosemo/gitchangelog/test/test_publish.py", line 184, in test_insertions
    self.assertEqual(make_insertion("A\nB\n", r"$", "✔\n", idx=lambda m: m.end() + 1), "A\nB\n✔\n")
  File "/Users/mgoose/workspace/goosemo/gitchangelog/test/test_publish.py", line 171, in make_insertion
    insert.splitlines(True))
  File "/Users/mgoose/workspace/goosemo/gitchangelog/src/gitchangelog/gitchangelog.py", line 1473, in _wrapped
    write_content(dst, content)
  File "/Users/mgoose/workspace/goosemo/gitchangelog/src/gitchangelog/gitchangelog.py", line 1449, in write_content
    f.write(content_line)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2714' in position 0: ordinal not in range(128)

I'll also update this PR, with comments in the project's style, as well a squash them down into one commit, when it looks good

goosemo and others added 3 commits June 25, 2017 12:59
Was getting some stack traces when this was writing out UTF-8 git commit log content. Made this change locally to address.
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.

2 participants