~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/fileservice_lib/__init__.py

  • Committer: Matt Giuca
  • Date: 2010-02-18 05:33:30 UTC
  • Revision ID: matt.giuca@gmail.com-20100218053330-c3kuixsazmxtg49i
Correct locale setting for Subversion. Previously pysvn would throw a nasty
error on non-ASCII UTF-8 filenames, because its locale was not set to UTF-8.
Now locale.setlocale is called on all Python scripts which use pysvn
(ivle-fetchsubmissions, ivle.fileservice_lib, diffservice, svnlogservice).

bin/ivle-buildjail: Now runs locale-gen as root inside the jail when run with
-u. This is necessary to make en_US.UTF-8 a valid locale; otherwise ALL JAIL
CODE will now crash!

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
# listing.
80
80
 
81
81
import urllib
 
82
import locale
82
83
 
83
84
import cjson
84
85
 
91
92
mime_dirlisting = "text/html"
92
93
#mime_dirlisting = "application/json"
93
94
 
 
95
# Set locale to UTF-8 (required by PySVN)
 
96
locale.setlocale(locale.LC_CTYPE, "en_US.UTF-8")
 
97
 
94
98
def handle(req):
95
99
    """Handler for the File Services application."""
96
100