[issue3088] Mecurial 2.0 largefiles requires HOME environment variable in the server

Jesús Cea Avión bugs at mercurial.selenic.com
Mon Nov 7 06:30:51 CST 2011


New submission from Jesús Cea Avión <jcea at jcea.es>:

Using the CGI and largefiles in the server, current code requires that
Apache sets the HOME environment variable.

HOME existence can't be garanteed.

Traceback:

"""
AttributeError: 'NoneType' object has no attribute 'endswith'
Traceback (most recent call last):
  File "/datos/sources/hg/cgi-bin.jcea/hgwebdir.cgi", line 67, in <module>
    wsgicgi.launch(application)
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/mercurial/hgweb/wsgicgi.py",
line 76, in launch
    content = application(environ, start_response)
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/mercurial/hgweb/hgwebdir_mod.py",
line 147, in __call__
    return self.run_wsgi(req)
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/mercurial/hgweb/hgwebdir_mod.py",
line 205, in run_wsgi
    return hgweb(repo).run_wsgi(req)
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/mercurial/hgweb/hgweb_mod.py",
line 127, in run_wsgi
    return protocol.call(self.repo, req, cmd)
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/mercurial/hgweb/protocol.py",
line 76, in call
    rsp = wireproto.dispatch(repo, p, cmd)
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/mercurial/wireproto.py",
line 344, in dispatch
    return func(repo, proto, *args)
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/hgext/largefiles/proto.py",
line 66, in statlfile
    filename = lfutil.findfile(repo, sha)
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/hgext/largefiles/lfutil.py",
line 111, in findfile
    elif inusercache(repo.ui, hash):
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/hgext/largefiles/lfutil.py",
line 106, in inusercache
    return os.path.exists(usercachepath(ui, hash))
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/hgext/largefiles/lfutil.py",
line 100, in usercachepath
    path = os.path.join(os.getenv('HOME'), '.cache', longname, hash)
  File "/usr/local/lib/python2.7/posixpath.py", line 68, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'
Traceback (most recent call last):
  File "/datos/sources/hg/cgi-bin.jcea/hgwebdir.cgi", line 67, in <module>
    wsgicgi.launch(application)
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/mercurial/hgweb/wsgicgi.py",
line 76, in launch
    content = application(environ, start_response)
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/mercurial/hgweb/hgwebdir_mod.py",
line 147, in __call__
    return self.run_wsgi(req)
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/mercurial/hgweb/hgwebdir_mod.py",
line 205, in run_wsgi
    return hgweb(repo).run_wsgi(req)
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/mercurial/hgweb/hgweb_mod.py",
line 127, in run_wsgi
    return protocol.call(self.repo, req, cmd)
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/mercurial/hgweb/protocol.py",
line 76, in call
    rsp = wireproto.dispatch(repo, p, cmd)
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/mercurial/wireproto.py",
line 344, in dispatch
    return func(repo, proto, *args)
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/hgext/largefiles/proto.py",
line 32, in putlfile
    lfutil.copytostoreabsolute(repo, tmpname, sha)
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/hgext/largefiles/lfutil.py",
line 224, in copytostoreabsolute
    if inusercache(repo.ui, hash):
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/hgext/largefiles/lfutil.py",
line 106, in inusercache
    return os.path.exists(usercachepath(ui, hash))
  File
"/usr/local/lib/python2.7/site-packages/mercurial-2.0-py2.7-solaris-2.10-i86pc.egg/hgext/largefiles/lfutil.py",
line 100, in usercachepath
    path = os.path.join(os.getenv('HOME'), '.cache', longname, hash)
  File "/usr/local/lib/python2.7/posixpath.py", line 68, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'
"""

Mailing list thread:
http://selenic.com/pipermail/mercurial/2011-November/040685.html

----------
messages: 17958
nosy: jcea
priority: critical
status: unread
title: Mecurial 2.0 largefiles requires HOME environment variable in the server

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue3088>
____________________________________________________


More information about the Mercurial-devel mailing list