strutils - strutils.to_bytes ignores the case of units
Bug #1189635 reported by
Ben Nemec
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo-incubator |
Fix Released
|
Undecided
|
Zhongyue Luo |
Bug Description
The function strutils.to_bytes ignores the case of the unit, which means that it will return the same value for 100 MB as 100 Mb. This is not correct.
This is low priority since presumably the function works for what it is currently used for, but since it's in a general purpose library it shouldn't be assuming the caller means bytes when they might mean bits. As an added bonus, it would be nice if it supported forms like 100 MiB too, which is a different value still.
Changed in oslo: | |
assignee: | nobody → Zhongyue Luo (zyluo) |
Changed in oslo: | |
status: | New → In Progress |
summary: |
- strutils.to_bytes ignores the case of units + strutils - strutils.to_bytes ignores the case of units |
Changed in oslo: | |
milestone: | none → icehouse-3 |
Changed in oslo: | |
status: | Fix Committed → Fix Released |
Changed in oslo: | |
milestone: | icehouse-3 → 2014.1 |
To post a comment you must log in.
What should the return value be for "79b"? 9 or 9.875
I guess the return value type should be float?