Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nautilus: ceph-volume: prints log messages to stdout #29600

merged 2 commits into from Aug 13, 2019


Copy link

commented Aug 12, 2019

tchaikov and others added 2 commits Mar 24, 2019
ceph-volume: terminal: encode unicode when writing to stdout
python determins the encoding of stdout and stderr based on the LC_CTYPE
and PYTHONIOENCODING env variable, by default, python3's sys.stdout uses
'utf-8' as its encoding, so it will be able to write unicode string even
the stdout is not attached to a tty device. but when it comes to
python2, it will default to ascii if neither of these variabls is set.
so, if we are writing unicode using `_Write` in an environment where
LC_CTYPE and/or PYTHONIOENCODING are using non UTF-8 encoding, it chokes
by raising `UnicodeEncodeError` exception.

in this change, we add a wrapper around `_Write._writer` so it is able
to write unicode string in such a non-unicode-friendly environment.

for more info related the encoding of stdout and stderr, see .

Signed-off-by: Alfredo Deza <>
Signed-off-by: Kefu Chai <>
(cherry picked from commit 77912c0)
ceph-volume: never log to stdout, use stderr instead
We should never print log messages to stdout, as this should be reserved
for output of ceph-volume.


Signed-off-by: Jan Fajerski <>
(cherry picked from commit b8d6dcb)

@jan--f jan--f self-assigned this Aug 12, 2019

@jan--f jan--f added this to the nautilus milestone Aug 12, 2019

@jan--f jan--f requested a review from alfredodeza Aug 12, 2019


This comment has been minimized.

Copy link

commented Aug 12, 2019

jenkins test ceph-volume tox

@alfredodeza alfredodeza merged commit a274ec1 into ceph:nautilus Aug 13, 2019

4 of 5 checks passed

Docs: build check Docs: failed with errors
Signed-off-by all commits in this PR are signed
Unmodified Submodules submodules for project are unmodified
ceph-volume tox testing ceph-volume tox OK
make check make check succeeded

@jan--f jan--f deleted the jan--f:wip-41203-nautilus branch Aug 14, 2019

@smithfarm smithfarm changed the title nautilus: ceph-volume prints log messages to stdout nautilus: ceph-volume: prints log messages to stdout Aug 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.