[SRU] not able to upload binary files when booting a vm
Bug #1408088 reported by
Liang Chen
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-novaclient |
Fix Released
|
High
|
Liang Chen | ||
python-novaclient (Ubuntu) |
Fix Released
|
Undecided
|
Liang Chen | ||
Trusty |
Fix Released
|
Undecided
|
Liang Chen |
Bug Description
[Impact]
* Not able to upload binary files to vm while booting.
[Test Case]
* make/find a binary file with size smaller than the upload limit, e.g. 10k
* create a vm and upload the binary file at the same time - nova boot --flavor 2 --image cloudimg-amd64 --file /root/ping=
[Regression Potential]
* None
Not able to upload binary files to vm while booting, e.g. nova boot --flavor 2 --image cloudimg-amd64 --file /root/ping=
Commit 8b264fc61d21fe4
Related branches
Changed in python-novaclient: | |
assignee: | nobody → Liang Chen (cbjchen) |
Changed in python-novaclient: | |
importance: | Undecided → High |
Changed in python-novaclient: | |
milestone: | none → 2.21.0 |
Changed in python-novaclient: | |
status: | Fix Committed → Fix Released |
Changed in python-novaclient (Ubuntu): | |
assignee: | nobody → Liang Chen (cbjchen) |
status: | New → In Progress |
summary: |
- not able to upload binary files when booting a vm + [SRU] not able to upload binary files when booting a vm |
Changed in python-novaclient (Ubuntu Trusty): | |
assignee: | nobody → Liang Chen (cbjchen) |
Changed in python-novaclient (Ubuntu): | |
status: | In Progress → Fix Committed |
Changed in python-novaclient (Ubuntu): | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
For me the description in the bug is confusing as you can encode every binary file into UTF-8 as it is 8 bit clean.
The error message I get is
ERROR: 'ascii' codec can't decode byte 0xdc in position 24: ordinal not in range(128)
Therefore for me it sounds as if the code tries to transcode the file from ASCII to UTF-8. As ASCII only allows 7 bits every byte with the high bit set cannot be interpreted. You get the same effect when trying this:
$ recode ascii..utf8 < /bin/ping > /dev/null 4-1968. .UTF-8'
recode: Invalid input in step `ANSI_X3.
Also you cannot interpret binary files as UTF-8 as not all byte combinations are valid:
$ recode utf8..iso8859-1 < /bin/ping > /dev/null
recode: Invalid input in step `UTF-8..ISO-8859-1'
IMHO the root problem is the interpretation of a file as some binary string encoding. If there is a need to interpret is as a string, I suggest to use an 8 bit clean charset like ISO-8859-1:
$ recode iso8859-1..utf8 < /bin/ping > /dev/null
works fine. Certainly this would break multi-byte UTF-8 characters in text files iff they are not to be copied somewhere but interpreted as text. But this is the fundamental problem: binary files should be treated as such and not interpreted as text while text files should be treated with the encoding - e.g. UTF-8 - configured for the platform.