Permalink
Please sign in to comment.
Browse files
Fix another file descriptor bug by removing 'import cgi'.
- Add util.Debug() which logs to a file specified by --debug-file. - Add configure-bug to the list of passing. All gold, spec, and unit tests pass! Finally.
- Loading branch information...
Showing
with
63 additions
and 7 deletions.
- +18 −0 asdl/cgi.py
- +1 −4 asdl/format.py
- +5 −0 bin/oil.py
- +18 −3 core/process.py
- +20 −0 core/util.py
- +1 −0 test/gold.sh
| @@ -0,0 +1,18 @@ | ||
| #!/usr/bin/python | ||
| """ | ||
| cgi.py - Copied from Python stdlib. | ||
| We don't want the side effects of importing tempfile, which imports random, | ||
| which opens /dev/urandom! | ||
| """ | ||
| def escape(s, quote=None): | ||
| '''Replace special characters "&", "<" and ">" to HTML-safe sequences. | ||
| If the optional flag quote is true, the quotation mark character (") | ||
| is also translated.''' | ||
| s = s.replace("&", "&") # Must be done first! | ||
| s = s.replace("<", "<") | ||
| s = s.replace(">", ">") | ||
| if quote: | ||
| s = s.replace('"', """) | ||
| return s |
0 comments on commit
4222f45