File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed
Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,12 @@ import weakref
3131
3232# We should allow multiple string types: str, unicode, bytes.
3333# PyToCefString() can handle them all.
34+ # Important:
35+ # If you set it to basestring, Cython will accept exactly(!)
36+ # str/unicode in Py2 and str in Py3. This won't work in Py3
37+ # as we might want to pass bytes as well. Also it will
38+ # reject string subtypes, so using it in publi API functions
39+ # would be a bad idea.
3440ctypedef object py_string
3541
3642# You can't use "void" along with cpdef function returning None, it is planned to be
Original file line number Diff line number Diff line change 22# License: New BSD License.
33# Website: http://code.google.com/p/cefpython/
44
5- # @TODO: make this configurable through ApplicationSettings.
5+ # TODO: cleanup the code in string_utils.pyx and string_utils_win.pyx,
6+ # see this topic for a review of the code in this file, see the
7+ # posts by Stefan Behnel:
8+ # https://groups.google.com/d/topic/cython-users/VICzhVn-zPw/discussion
9+
10+ # TODO: make this configurable through ApplicationSettings.
611UNICODE_ENCODE_ERRORS = " replace"
712BYTES_DECODE_ERRORS = " replace"
813
Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ cpdef py_bool IsString(object maybeString):
1717cpdef py_bool IsThread(int threadID):
1818 return bool (CefCurrentlyOn(< CefThreadId> threadID))
1919
20+ # TODO: this function needs to accept unicode strings, use the
21+ # logic from wxpython.py/ExceptHook to handle printing
22+ # unicode strings and writing them to file (codecs.open).
23+ # This change is required to work with Cython 0.20.
24+
2025cpdef object Debug(str msg):
2126 if not g_debug:
2227 return
@@ -29,7 +34,7 @@ cpdef object Debug(str msg):
2934 except :
3035 print (" cefpython: WARNING: failed writing to debug file: %s " % (
3136 g_debugFile))
32-
37+
3338
3439cpdef str GetSystemError():
3540 IF UNAME_SYSNAME == " Windows" :
@@ -75,7 +80,7 @@ cpdef str GetModuleDirectory():
7580 else :
7681 path = os.getcwd()
7782 if platform.system() == " Windows" :
78- # On linux this regexp would give:
83+ # On linux this regexp would give:
7984 # "\/home\/czarek\/cefpython\/cefpython\/cef1\/linux\/binaries"
8085 path = re.sub(r " [/ \\ ]+ " , re.escape(os.sep), path)
8186 path = re.sub(r " [/ \\ ]+ $ " , " " , path)
You can’t perform that action at this time.
0 commit comments