I'm struggling to understand the difference between my workstation environment and the gitlab-ci docker environment. Yes, it is one of those UnicodeDecodeError: ... ordinal not in range(128)
exception that we know and love.
My problem is that it works on my workstation and not in the docker instance of gitlab-ci. I have created a project to demonstrate the problem. The pipeline output is here: https://gitlab.com/moozer/unicode-test/-/jobs/205999852
The code that I run is:
import sys
import platform
print( "Load and show file - testing unicode and such")
print( "python version: {}".format(platform.python_version()))
print( "Showing content from file {}".format( sys.argv[1]))
print( "---")
with open( sys.argv[1], "r" ) as fp:
content = fp.read()
print( "read content is of type {}".format( type(content )))
print( content )
print("--- EOF")
So there are some difference between the environment on my workstation and in the docker container that shows when using python3 and using non-ascii chars.
How to debug?
Suggestions are welcome :-)