Comments (7)
Try running it with Python 3.
from gitchangelog.
I found a workaround on Windows with Python < 3.7:
Code
Per terminal session, run:
λ set PYTHONIOENCODING="UTF-8"
λ gitchangelog
This sets a Python environ. var. to UTF-8.
Details
It seems Python 3.6 defaults to the system's encoding. On Windows 7, that encoding is CP-1252, resulting in the error described above. However, this behavior was changed in Python 3.7, which introduced PYTHONUTF8=1
. 1
sets the default to UTF-8; 0
assumes the system encoding.
Thus on any system, I extend @luis-valdes-21b 's suggestion to:
try using Python 3.7+ or assign PYTHONIOENCODING="UTF-8"
Since this is a resolved Python problem, I believe this issue can be closed now.
from gitchangelog.
I'm running Python 3, but it stops writing after detecting a unicode lambda character (\u03bb) in a git commit. I get a UnicodeError too:
λ gitchangelog > CHANGELOG.md
UnicodeEncodeError: There was a problem outputing the resulting
changelog to your console. This probably means that the changelog
contains characters that cant be translated to characters ...
Strangely, the command alone prints in the terminal
λ gitchangelog
I just need to capture the terminal output. I wouldn't mind ignoring the unicode characters given the option.
OS: Windows 7
Python: 3.6
gitchangelog: 3.0.3+
from gitchangelog.
Have the same issue under openSUSE 15.1:
Error: Exception while running 'gitchangelog':
| Traceback (most recent call last):
| File "/home/ralph/bin/gitchangelog", line 1972, in main
| config.get("publish", stdout)(content)
| File "/home/ralph/bin/gitchangelog", line 1445, in stdout
| safe_print(chunk)
| File "/home/ralph/bin/gitchangelog", line 1820, in safe_print
| content = content.encode(_preferred_encoding)
| UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 38694: ordinal not in range(128)
And this is my fix:
#!/usr/bin/env python3
from gitchangelog.
@roseswe In which file did you put that shebang?
from gitchangelog.
Thanks everyone this solves the issue for me.
from gitchangelog.
Thanks everyone this solves the issue for me.
Can we expect updated sources? ;-)
@roseswe In which file did you put that shebang?
In the main python script "gitchangelog.py"
from gitchangelog.
Related Issues (20)
- setup.cfg contains ascii characters HOT 4
- [WinError 2] The system cannot find the file specified HOT 3
- ignore_regexps doesnt match against whole message, only subject
- regexp filter skipping matches
- Added an AUR package.
- Update Readme to include basic full example. HOT 2
- Exception with FileInsertIntoFirstRegexMatch HOT 2
- pystache missing as dependency? HOT 2
- Support for pre-commit
- How to show changelog since certain commit? HOT 1
- Use branch name for section categorisation HOT 1
- test failures caused by 3.0.4 package missing test/__init__.py
- Is this project still maintained ? HOT 2
- Slow execution on big repositories under Cygwin HOT 8
- Enhancement Request: Multi-package repo support HOT 1
- Request: drop d2to1
- Offering to help with the project HOT 6
- Branch tags are erroneously included into change log
- Changelog usage?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitchangelog.