Antonio Cuni committed 698aff2

hardcode the sys.std{in,out,err} encoding to ascii when running the tests. Two reasons:
1. if you don't specificy the encoding, it ends up using locate.getpreferredlocale() to guess one. I don't think it's a good idea that the behavior of the tests depend on the locale settings

2. importing locale is very slow on By using the explicit encoding, initializing the space takes ~3 seconds instead of ~10 on my machine

Comments (0)

Files changed (1)


             # Install standard streams for tests that don't call app_main
             space.appexec([], """():
                 import sys, io
-                sys.stdin = sys.__stdin__ =, "r", closefd=False)
+                sys.stdin = sys.__stdin__ =, "r", encoding="ascii",
+                                                    closefd=False)
        = "<stdin>"
-                sys.stdout = sys.__stdout__ =, "w", closefd=False)
+                sys.stdout = sys.__stdout__ =, "w", encoding="ascii",
+                                                      closefd=False)
        = "<stdout>"
-                sys.stderr = sys.__stderr__ =, "w", closefd=False)
+                sys.stderr = sys.__stderr__ =, "w", encoding="ascii",
+                                                      closefd=False)
        = "<stderr>"
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.