Skip to content

Commit

Permalink
Fixed issue #32: Incorrect i2c_msg write object from string in Py3
Browse files Browse the repository at this point in the history
  • Loading branch information
kplindegaard committed Jan 10, 2019
1 parent a660b9e commit 2e33580
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
Notable changes to the smbus2 project are recorded here.

## [0.2.3] - 2019-01-10
### Fixed
- Incorrect `i2c_msg` created in Python 3.x if str input contains ascii chars >= 128.

## [0.2.2] - 2019-01-03
### Added
- SMBus Quick command.
Expand Down Expand Up @@ -33,6 +37,7 @@ Notable changes to the smbus2 project are recorded here.
First published version.


[0.2.3]: https://github.com/kplindegaard/smbus2/compare/0.2.2...0.2.3
[0.2.2]: https://github.com/kplindegaard/smbus2/compare/0.2.1...0.2.2
[0.2.1]: https://github.com/kplindegaard/smbus2/compare/0.2.0...0.2.1
[0.2.0]: https://github.com/kplindegaard/smbus2/compare/0.1.5...0.2.0
Expand Down
2 changes: 1 addition & 1 deletion smbus2/smbus2.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def write(address, buf):
"""
if sys.version_info.major >= 3:
if type(buf) is str:
buf = bytes(buf, 'UTF-8')
buf = bytes(map(ord, buf))
else:
buf = bytes(buf)
else:
Expand Down

0 comments on commit 2e33580

Please sign in to comment.