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

mimic: ceph-volume: prints log messages to stdout #29602

merged 2 commits into from Aug 14, 2019


Copy link

jan--f commented Aug 12, 2019

tchaikov and others added 2 commits Mar 24, 2019
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)
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 mimic milestone Aug 12, 2019
@jan--f jan--f requested a review from alfredodeza Aug 12, 2019

This comment has been minimized.

Copy link
Member Author

jan--f commented Aug 12, 2019

jenkins test ceph-volume tox

@jan--f jan--f merged commit 7d94c19 into ceph:mimic Aug 14, 2019
3 of 5 checks passed
3 of 5 checks passed
Docs: build check Docs: failed with errors
ceph-volume tox testing ceph-volume tox failed
Signed-off-by all commits in this PR are signed
Unmodified Submodules submodules for project are unmodified
make check make check succeeded
@smithfarm smithfarm changed the title mimic: ceph-volume prints log messages to stdout mimic: ceph-volume: prints log messages to stdout Aug 27, 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.