Bob Ippolito committed 6a9eeeb

Make PyInterpreter work --standalone

Comments (0)

Files changed (2)


     def write(self, s):
         if not isinstance(s, unicode):
-            s = s.decode('utf8', 'replace')
+            s = s.decode('utf-8', 'replace')
     def writelines(self, lines):
                 self._buffer = u''
                 if rval.endswith(u'\r'):
                     rval = rval[:-1]+u'\n'
-                return rval.encode('utf8')
+                return rval.encode('utf-8')
-                return self._readline(u'\x04')[:-1].encode('utf8')
+                return self._readline(u'\x04')[:-1].encode('utf-8')
             while len(self._buffer) < chars:
                 self._buffer += self._readline(u'\x04\r')
                     self._buffer = self._buffer[:-1]
             rval, self._buffer = self._buffer[:chars], self._buffer[chars:]
-            return rval.encode('utf8').replace('\r','\n')
+            return rval.encode('utf-8').replace('\r','\n')
     def readline(self):
         if u'\r' not in self._buffer:
             self._buffer += self._readline(u'\x04\r')
         if self._buffer.endswith('\x04'):
-            rval = self._buffer[:-1].encode('utf8')
+            rval = self._buffer[:-1].encode('utf-8')
         elif self._buffer.endswith('\r'):
-            rval = self._buffer[:-1].encode('utf8')+'\n'
+            rval = self._buffer[:-1].encode('utf-8')+'\n'
         self._buffer = u''
         return rval
 class AsyncInteractiveConsole(InteractiveConsole):


 	mainprogram = "",
 	resources = ["PyInterpreter.nib"],
 	nibname = "PyInterpreter",
+    includePackages = ['encodings'],
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.