Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed a `TypeError` caused because of `unicode` issues in python 2.7.x

  • Loading branch information...
commit bbca0d9e1db4710b523271399b3fae89d9993eb7 1 parent 073876f
Lakshmi Vyas authored January 26, 2012
2  cheetah/Version.py
... ...
@@ -1,5 +1,5 @@
1 1
 Version = '2.4.4'
2  
-VersionTuple = (2, 4, 4, 'development', 0)
  2
+VersionTuple = (2, 4, 4, 'development', 1)
3 3
 
4 4
 MinCompatibleVersion = '2.0rc6'
5 5
 MinCompatibleVersionTuple = (2, 0, 0, 'candidate', 6)
6  cheetah/convertTmplPathToModuleName.py
@@ -17,4 +17,8 @@ def convertTmplPathToModuleName(tmplPath,
17 17
                                 _pathNameTransChars=_pathNameTransChars,
18 18
                                 splitdrive=os.path.splitdrive,
19 19
                                 ):
20  
-    return splitdrive(tmplPath)[1].translate(_pathNameTransChars)
  20
+    try:
  21
+        moduleName = splitdrive(tmplPath)[1].translate(_pathNameTransChars)
  22
+    except (UnicodeError, TypeError):
  23
+        moduleName = unicode(splitdrive(tmplPath)[1]).translate(unicode(_pathNameTransChars))
  24
+    return moduleName

0 notes on commit bbca0d9

Please sign in to comment.
Something went wrong with that request. Please try again.