compose
compose copied to clipboard
`logs` encoding is incorrect
Description of the issue
docker-compose logs
outputs as a Windows-specific encoding while docker logs
properly outputs as utf-8
ofek.lev@OZONE C:\Users\ofek.lev\Desktop\code\integrations-core\riakcs\tests\compose
$ python
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> import sys
>>> print(sys.getdefaultencoding())
utf-8
>>> for line in subprocess.run('docker logs 9f3b1d3828a3', stdout=subprocess.PIPE).stdout.splitlines()[:2]: print(line)
...
b"Update data permissions in case it's mounted as volume\xe2\x80\xa6 OK!"
b'Starting Riak\xe2\x80\xa6 OK!'
>>> for line in subprocess.run('docker-compose logs --no-color', stdout=subprocess.PIPE).stdout.splitlines()[:3]: print(line)
...
b'Attaching to dd-test-riakcs'
b"dd-test-riakcs | Update data permissions in case it's mounted as volume\x85 OK!"
b'dd-test-riakcs | Starting Riak\x85 OK!'
>>> for line in subprocess.run('docker-compose logs --no-color', stdout=subprocess.PIPE, encoding='cp1252').stdout.splitlines()[:3]: print(line.encode())
...
b'Attaching to dd-test-riakcs'
b"dd-test-riakcs | Update data permissions in case it's mounted as volume\xe2\x80\xa6 OK!"
b'dd-test-riakcs | Starting Riak\xe2\x80\xa6 OK!'
Context information (for bug reports)
Output of docker-compose version
docker-compose version 1.23.2, build 1110ad01
docker-py version: 3.6.0
CPython version: 3.6.6
OpenSSL version: OpenSSL 1.0.2o 27 Mar 2018
Output of docker version
Client: Docker Engine - Community
Version: 18.09.2
API version: 1.39
Go version: go1.10.8
Git commit: 6247962
Built: Sun Feb 10 04:12:31 2019
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.2
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 6247962
Built: Sun Feb 10 04:13:06 2019
OS/Arch: linux/amd64
Experimental: false
Kubernetes:
Version: v1.10.11
StackAPI: v1beta2
Output of docker-compose config
services:
dd-test-riakcs:
container_name: dd-test-riakcs
environment:
RIACK_CS_BUCKET: foo
image: ianbytchek/riak-cs
ports:
- published: 8080
target: 8080
version: '3.5'
Observed result
encoding (after much debugging to render ellipsis
properly) is cp1252
Expected result
encoding should be utf-8
Additional information
Windows 10 pro, docker-compose
installed via pip
cc @shin-
@shin- Do you why this may be happening, or of any workarounds for now?
Any update on this?
I have the same issue with "docker-compose logs" when running docker-compose as a container
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Still an issue
This issue has been automatically marked as not stale anymore due to the recent activity.
Still an issue on compose v1.25.2
I'm also experiencing this - compose v1.25.4 on OSX
+1
+1, docker-compose version 1.25.5 on Ubuntu
+1, docker-compose version 1.26.2 on MacOS
+1 docker-compose version 1.26.2 on CentOS 7
+1 docker-compose version 1.27.4, build 40524192 on Ubuntu 20.04 / WSL2 Also, it was nice to realize (amounts of debugging) the trouble was not in my docker images but in docker-compose log output.
2021, still valid.
It's still happening on Ubuntu.
+1, docker-compose version 1.29.2, build 5becea4c, on MacOS
+1 Nov 2021, still happening on Windows 10. docker-compose version v2.1.1.
+1 still happening on Windows 11 Pro.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it had not recent activity during the stale period.
This issue has been automatically closed because it had not recent activity during the stale period.
Please reopen this issue as this is still happening on Windows 11 with Ubuntu (store version, 2204.1.6.0) on WSL 0.66.2.0
Still experiencing it on:
Linux 5.15.81-1-MANJARO #1 SMP PREEMPT Fri Dec 2 21:02:26 UTC 2022 x86_64 GNU/Linux
Still happening +1
+1, Still occurring