You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sh_spec.py needs to read with a known encoding. *.test.sh should be restricted to utf-8 ?
$ ./spec.sh all
./spec-runner.sh run-cases append
./spec-runner.sh run-cases arith-context
./spec-runner.sh run-cases arith
./spec-runner.sh run-cases array
./spec-runner.sh run-cases assign
./spec-runner.sh run-cases assoc-zsh
./spec-runner.sh run-cases assoc
./spec-runner.sh run-cases blog1
Traceback (most recent call last):
File "./sh_spec.py", line 838, in <module>
sys.exit(main(sys.argv))
File "./sh_spec.py", line 766, in main
tokens = Tokenizer(LineIter(f))
File "./sh_spec.py", line 125, in __init__
self.next()
File "./sh_spec.py", line 129, in next
self.cursor = self.it.__next__()
File "./sh_spec.py", line 87, in LineIter
for i, line in enumerate(f):
File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 133: ordinal not in range(128)
./spec-runner.sh run-cases brace-expansion
./spec-runner.sh run-cases bugs
./spec-runner.sh run-cases builtins
./spec-runner.sh run-cases case_
./spec-runner.sh run-cases command-sub
./spec-runner.sh run-cases comments
*** Got 1 allowed osh failures, exit with status 0
./spec-runner.sh run-cases dbracket
Traceback (most recent call last):
File "./sh_spec.py", line 838, in <module>
sys.exit(main(sys.argv))
File "./sh_spec.py", line 766, in main
tokens = Tokenizer(LineIter(f))
File "./sh_spec.py", line 125, in __init__
self.next()
File "./sh_spec.py", line 129, in next
self.cursor = self.it.__next__()
File "./sh_spec.py", line 87, in LineIter
for i, line in enumerate(f):
File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2750: ordinal not in range(128)
./spec-runner.sh run-cases dparen
The text was updated successfully, but these errors were encountered:
Now we check file descriptors (even those above #10) before using them.
This is a recurrence of the bug described here:
http://www.oilshell.org/blog/2017/07/02.html
If you do 'import random' in Python, it results in /dev/urandom being
permanently open (which can be seen in the blog post!)
At the time, I incorrectly fixed the bug by just opening our own
descriptors above #10. But it's possible that CPython will subsequently
open something above #10 (/dev/urandom appeared as #12), so we have to
additionally check descriptors before we use them.
NOTE: 'import cgi' eventually causes 'import random'. We're only using
it for cgi.escape(), but cgi.FieldStorage() uses tempfile, which uses a
random number generator.
Also: minimize the test case as gold/configure-bug.sh.
'test/gold.sh configure' was the case that caught this bug. The spec
tests didn't find it! Because it appears to take about 4 redirects for
this to happen!
This was reported on the mailing list and also here:
https://lobste.rs/s/obktxo/oil_shell_help_needed_if_you_have_debian/comments/akvbsk#c_akvbsk
sh_spec.py needs to read with a known encoding. *.test.sh should be restricted to utf-8 ?
The text was updated successfully, but these errors were encountered: