Unicode string not accepted as parameter to modification
Bug #525991 reported by
Jon Black
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-quantities |
Fix Committed
|
High
|
Darren Dale |
Bug Description
I tried to pass the unit type during a conversion as a unicode string...
q = pq.Quantity([10,], u"kg")
q.units = u"kg"
...and got the following error for both lines...
TypeError: units must be a quantity, string, or dimensionality, got <type 'unicode'>
I would expect this to work. Firstly, because unicode is a string with a certain encoding (utf-8), and secondly because to me u"kg" and "kg" represent the same symbol.
Related branches
To post a comment you must log in.
I noticed that you can set unicode in the markup:
from quantities import markup config. use_unicode = True # or False
markup.
This had no affect; I still got the same error message.