It work using other WSGI servers, e.g. gunicorn or pyruvate.
It happens because Mercurial tries to concatenate provided port (which is int) to bytes object from environ.
I don't know if this is granian bug or Mercurial bug.
[WARNING] Application callable raised an exception
<class 'TypeError'>
TypeError("can't concat int to bytes")
Traceback (most recent call last):
File "/opt/priv_hg/hgwsgi.py", line 11, in application
return hg(environ, start_response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/mercurial/hgweb/hgwebdir_mod.py", line 376, in __call__
req = requestmod.parserequestfromenv(env, altbaseurl=baseurl)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/mercurial/hgweb/request.py", line 224, in parserequestfromenv
advertisedfullurl = addport(advertisedfullurl, env[b'SERVER_PORT'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/mercurial/hgweb/request.py", line 199, in addport
s += b':' + port
~~~~~^~~~~~
TypeError: can't concat int to bytes
It work using other WSGI servers, e.g.
gunicorn
orpyruvate
.It happens because Mercurial tries to concatenate provided port (which is int) to
bytes
object from environ. I don't know if this is granian bug or Mercurial bug.Details:
OS: Alpine Linux 3.19 (https://hub.docker.com/layers/library/alpine/3.19.0/) Software versions
hgweb.conf
hgwsgi.py
Command used to execute:
Traceback: