Comment 5 for bug 1819274

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to rally-openstack (master)

Reviewed: https://review.openstack.org/642235
Committed: https://git.openstack.org/cgit/openstack/rally-openstack/commit/?id=4822b452304c53d3102e75d4d2924fb7ec1a93ae
Submitter: Zuul
Branch: master

commit 4822b452304c53d3102e75d4d2924fb7ec1a93ae
Author: Dmitrii Shcherbakov <email address hidden>
Date: Sat Mar 9 02:51:18 2019 +0300

    py3: use binary mode for opening image files

    If binary mode is not used when running with python3 glance image
    uploads fail as files are opened with encoding='UTF-8' by default.

    It results in the following confusing error message:

    UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfb in position 3:
    invalid start byte

    (Pdb) e
    UnicodeDecodeError('utf-8', b'QFI\xfb\x00\x00\

    0xfb is a QCOW magic string and is invalid from UTF-8 standard
    perspective. From the QCOW2 spec:

    Byte 0 - 3: magic
                    QCOW magic string ("QFI\xfb")

    Tracing have shown that the error comes from python-glanceclient when a
    file handle passed to it is attempted to be used for sending image
    chunks.

    Change-Id: I6bb31fe1d3f79a8fd4707a5576204dee69a3f307
    Depends-On: I4991acccefd4754e209feafd5e24d03c76c283f8
    Closes-Bug: #1819274