"write() argument must be str, not bytes" error when saving file to stdout
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-openstackclient |
New
|
Undecided
|
Unassigned |
Bug Description
`openstack object save my_container_name my_file.sql.gz` works fine - it saves my_file.gz to the current directory. However, for efficiency reasons I want to stream the file into a program and not save it locally. As a starting point I've tried to run `openstack object save --file - my_container_name my_file.sql.gz | gunzip` as described by `openstack object save --help`, but it fails with the error message "write() argument must be str, not bytes".
Stack trace from running with `--debug`:
write() argument must be str, not bytes
Traceback (most recent call last):
File "/vagrant/
result = cmd.run(
File "/vagrant/
return super(Command, self).run(
File "/vagrant/
return_code = self.take_
File "/vagrant/
file=
File "/vagrant/
sys.
TypeError: write() argument must be str, not bytes
clean_up SaveObject: write() argument must be str, not bytes
Traceback (most recent call last):
File "/vagrant/
ret_val = super(OpenStack
File "/vagrant/
result = self.run_
File "/vagrant/
ret_value = super(OpenStack
File "/vagrant/
result = cmd.run(
File "/vagrant/
return super(Command, self).run(
File "/vagrant/
return_code = self.take_
File "/vagrant/
file=
File "/vagrant/
sys.
TypeError: write() argument must be str, not bytes
Setup:
$ python --version
Python 3.6.5
$ openstack --version
openstack 3.15.0
$ uname --kernel-name --kernel-release --kernel-version --machine --processor --hardware-platform --operating-system
Linux 4.15.0-22-generic #24-Ubuntu SMP Wed May 16 12:15:17 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_
DISTRIB_
DISTRIB_
affects: | swift → python-openstackclient |
Submitted https:/ /review. openstack. org/#/c/ 573465/ to fix it, FWIW, but that was months ago.