[Bug 6204] New: hgweb fails when reading config file for Python 3

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Mon Oct 14 12:56:21 EDT 2019


https://bz.mercurial-scm.org/show_bug.cgi?id=6204

            Bug ID: 6204
           Summary: hgweb fails when reading config file for Python 3
           Product: Mercurial
           Version: default branch
          Hardware: All
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: hgweb
          Assignee: bugzilla at mercurial-scm.org
          Reporter: andy at digitalcheetah.com
                CC: mercurial-devel at mercurial-scm.org

Hi,

I'm using:

Python 3.5.2 
Mercurial 5.1.2 
Apache 2.4.18
mod_wsgi: 4.6.8
Under Ubuntu 16.04

When I try to clone down a repo I get the following error:

hg clone
https://cloudmp.tcheetah08.com:9999/zall/cloudmp.tcheetah08.com/cloudmp
abort: HTTP Error 500: Internal Server Error

In the apache error logs this error is recorded: 
  [Mon Oct 14 11:47:17.740209 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372] mod_wsgi (pid=78832): Failed to exec Python script file
'/usr/local/bin/hg.wsgi'.
   [Mon Oct 14 11:47:17.740384 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372] mod_wsgi (pid=78832): Exception occurred processing WSGI
script '/usr/local/bin/hg.wsgi'.
   [Mon Oct 14 11:47:17.741100 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372] Traceback (most recent call last):
   [Mon Oct 14 11:47:17.741136 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]   File "/usr/local/bin/hg.wsgi", line 28, in <module>
   [Mon Oct 14 11:47:17.741144 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]     application = hgwebdir('/etc/mercurial/hgrc.d/osw.rc')
   [Mon Oct 14 11:47:17.741150 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]   File
"/usr/local/lib/python3.5/dist-packages/mercurial/hgweb/hgwebdir_mod.py", line
271, in __init__
   [Mon Oct 14 11:47:17.741156 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]     self.refresh()
   [Mon Oct 14 11:47:17.741168 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]   File
"/usr/local/lib/python3.5/dist-packages/mercurial/hgweb/hgwebdir_mod.py", line
303, in refresh
   [Mon Oct 14 11:47:17.741174 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]     u.readconfig(self.conf, remap=map, trust=True)
   [Mon Oct 14 11:47:17.741179 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]   File
"/usr/local/lib/python3.5/dist-packages/mercurial/ui.py", line 420, in
readconfig
   [Mon Oct 14 11:47:17.741185 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]     cfg.read(filename, fp, sections=sections, remap=remap)
   [Mon Oct 14 11:47:17.741190 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]   File
"/usr/local/lib/python3.5/dist-packages/mercurial/config.py", line 201, in read
   [Mon Oct 14 11:47:17.741195 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]     sections=sections, remap=remap, include=self.read)
   [Mon Oct 14 11:47:17.741200 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]   File
"/usr/local/lib/python3.5/dist-packages/mercurial/config.py", line 179, in
parse
   [Mon Oct 14 11:47:17.741206 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372]     self.set(section, item, m.group(2), "%s:%d" % (src,
line))
   [Mon Oct 14 11:47:17.741227 2019] [wsgi:error] [pid 78832] [remote
50.28.34.152:60372] TypeError: %b requires bytes, or an object that implements
__bytes__, not 'str'

The same command works fine if I switch back to Python 2.7.12

Thanks for any help you can give.

andy

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list