PBR

Comment 2 for bug 1704472

Revision history for this message
Jan Vlčinský (jan-vlcinsky) wrote :

The problem is, that when the file is open, no encoding is specified so it is dependent on current default console encoding what is definitely not deterministic.

Fix is easy: open the file using "utf-8" encoding.

See http://git.openstack.org/cgit/openstack-dev/pbr/tree/pbr/util.py?h=3.1.1#n313 where

`description_file = open(filename)`

shall change to:

`description_file = open(filename, encoding="utf-8")`

It assumes the file is encoded in UTF-8, what seems reasonable (but would be great to publish such assumption).

Other option would be to read file encoding from somewhere else such as from `description-content-type` field, but this seems a bit too much effort without much advantage.