[Erp5-report] r22992 - /erp5/trunk/utils/oood/oood_common.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Aug 14 11:12:07 CEST 2008


Author: kazuhiko
Date: Thu Aug 14 11:12:06 2008
New Revision: 22992

URL: http://svn.erp5.org?rev=22992&view=rev
Log:
given filename can be unicode instead of str.

Modified:
    erp5/trunk/utils/oood/oood_common.py

Modified: erp5/trunk/utils/oood/oood_common.py
URL: http://svn.erp5.org/erp5/trunk/utils/oood/oood_common.py?rev=22992&r1=22991&r2=22992&view=diff
==============================================================================
--- erp5/trunk/utils/oood/oood_common.py (original)
+++ erp5/trunk/utils/oood/oood_common.py Thu Aug 14 11:12:06 2008
@@ -193,10 +193,11 @@
   """
   # fail if bad request
   if len(a) == 0: raise MalformedRequest(malformed_request_message)
-  if type(a[0]) not in (types.StringType, types.DictType): raise MalformedRequest(malformed_request_message)
+  if type(a[0]) not in (types.StringType, types.UnicodeType, types.DictType):
+    raise MalformedRequest(malformed_request_message)
   if type(a[0]) == types.DictType and len(a) > 1: raise MalformedRequest(malformed_request_message)
   # process
-  if type(a[0]) == types.StringType:
+  if type(a[0]) in (types.StringType, types.UnicodeType):
     argtpl=('filename', 'data', 'meta', 'extension', 'orig_format')
     kw = dict(zip(argtpl, a)) # build a dict from positional arguments
   if type(a[0]) == types.DictType:




More information about the Erp5-report mailing list