WolfgangFahl / pymediawikidocker

Python controlled mediawiki docker image installation
Apache License 2.0
6 stars 1 forks source link

Building SMW on Windows causes encoding error #71

Closed Kusko25 closed 2 months ago

Kusko25 commented 4 months ago

When trying to build a semantic media wiki on Windows with the example command for version 4.1.2

mwcluster \
  --create \
  --container_name smw4\
  --forceRebuild\
  --version_list 1.35.13\
  --base_port 8481\
  --sql_base_port 10307\
  --mariaDBVersion 10.11\
  --smw_version 4.1.2

I get a UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f33b' in position 1689: character maps to <undefined> which I believe refers to the sunflower emoji in $wgEmergencyContact = "apache@🌻.invalid"; and $wgPasswordSender = "apache@🌻.invalid"; If so that would be an easy fix, just changing the template, assuming there are no errors later in the build. Or a bit more in depth in mwdocker/docker.py at line 277 change env = Environment(loader=FileSystemLoader(template_dir)) to env = Environment(loader=FileSystemLoader(template_dir,encoding=locale.getpreferredencoding())), in my case that produces 'cp1252 for Windows and 'UTF-8' for Linux