About Download Docs Changes

Running on Debian stable (etch)?

Collected changes to installation procedure

If you're using the Debian installation documentation found on this site to install Hatta on a Debian Etch System, you'll need to do a couple of things differently:

Problems encountered trying to install on Etch

I tried using easy_install-2.4 to get werkzeug installed (as python-werkzeug is not in etch) and got the package installed fine, but Hatta won't run:

$ /usr/src/hatta-dev/hatta.py
  File "/usr/src/hatta-dev/hatta.py", line 1603
    finally:
          ^
SyntaxError: invalid syntax
$ python -V
Python 2.4.4
$

Ok, so I wanted to try with Python 2.5. Unfortunately the easy_install-2.5 in Debian stable (etch) doesn't want to work for me, so I can't get werkzeug installed:

$ sudo easy_install-2.5 werkzeug
Traceback (most recent call last):
  File "/usr/bin/easy_install-2.5", line 5, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
$

And I'm stumped. Any ideas? Should I just wait for the next Debian release? :-)

Fix released

This is an incompatibility with python 2.4 introduced by mistake (and not tested for). It's fixed in version 1.0.2 now. Note that to use standalone (local) server on 2.4, you will also need to install python-wsgiref.

Another option is to just download the werkzeug source, unpack it and copy the werkzeug directory to the same directory where hatta.py is.

Thank you for reporting this defect.

Thanks - new problems

Thanks for the fix! Now I get this error instead:

Traceback (most recent call last):
  File "/usr/src/hatta/hatta.py", line 1323, in ?
    application = Wiki().application
  File "/usr/src/hatta/hatta.py", line 831, in __init__
    self.storage = WikiStorage(self.path)
  File "/usr/src/hatta/hatta.py", line 39, in __init__
    quiet=True)
TypeError: __init__() got an unexpected keyword argument 'report_untrusted'

I tried this naïve patch, and got Hatta to start:

diff -r 516b71176c51 hatta.py
--- a/hatta.py  Sun Nov 16 13:17:03 2008 +0000
+++ b/hatta.py  Mon Nov 17 20:07:16 2008 +0100
@@ -35,7 +35,7 @@ class WikiStorage(object):
         if not os.path.exists(self.path):
             os.makedirs(self.path)
         self.repo_path = self._find_repo_path(self.path)
-        self.ui = mercurial.ui.ui(report_untrusted=False, interactive=False,
+        self.ui = mercurial.ui.ui(interactive=False,
                                   quiet=True)
         if self.repo_path is None:
             self.repo_path = self.path

But when I click save on edit/Home, I get:

topper.koldfront.dk -- [GET /edit/Home HTTP/1.0] 404 2946
Traceback (most recent call last):
  File "/var/lib/python-support/python2.4/wsgiref/handlers.py", line 92, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/lib/python2.4/site-packages/Werkzeug-0.3.1-py2.4.egg/werkzeug/utils.py", line 1539, in <lambda>
    return _patch_wrapper(f, lambda *a: f(*a)(*a[-2:]))
  File "/usr/src/hatta/hatta.py", line 1313, in application
    response = endpoint(request, **values)
  File "/usr/src/hatta/hatta.py", line 993, in save
    self.storage.save_text(title, data, author, comment)
  File "/usr/src/hatta/hatta.py", line 96, in save_text
    self.save_file(title, file_name, author, comment)
  File "/usr/src/hatta/hatta.py", line 80, in save_file
    lock = self._lock()
  File "/usr/src/hatta/hatta.py", line 51, in _lock
    lock = self.repo._lock(os.path.join(self.path, "wikilock"),
AttributeError: 'localrepository' object has no attribute '_lock'
topper.koldfront.dk -- [POST /edit/Home HTTP/1.0] 500 59

I wouldn't spend too much time on it if I were you (etch is old), but if you have a quick fix, I'd love to have it.


The quick fix is as usual an upgrade, this time of the Mercurial. Once again, you don't have to install it on your system, it's sufficient to run the setup.py --prefix /some/temp/dir/here and then copy the mercurial directory from /some/temp/dir/here/lib/python2.4/site-packages/mercurial to where your hatta.py is. Or use easy_install or a newer .deb. Mercurial's API changed between versions 0.9 and 1.0, I can't support both of them.


Makes perfect sense; I will try. Thanks!

I installed mercurial from backports.org, and Hatta now works on my Debian stable (etch) machine. Thank you for answers and patience.