beeware / batavia

A JavaScript implementation of the Python virtual machine.
http://pybee.org/batavia
Other
1.39k stars 424 forks source link

Fix testserver [Errno 2] No such file or directory errors #769

Closed danyeaw closed 5 years ago

danyeaw commented 5 years ago

Previously when using the Batavia testbed, I was getting no such file or directory errors and the "run sample.py" button wasn't working.

[20/Jan/2019` 02:57:39] "GET / HTTP/1.1" 200 16945
[Errno 2] No such file or directory: 'sample.py'
[Errno 2] No such file or directory: 'other.py'
[Errno 2] No such file or directory: 'submodule/__init__.py'
[Errno 2] No such file or directory: 'submodule/modulea.py'
[Errno 2] No such file or directory: 'submodule/moduleb.py'
[Errno 2] No such file or directory: 'submodule/modulec.py'
[Errno 2] No such file or directory: 'submodule/moduled/__init__.py'
[Errno 2] No such file or directory: 'submodule/moduled/submoduled.py'
[Errno 2] No such file or directory: 'submodule/subsubmodule/__init__.py'
[Errno 2] No such file or directory: 'submodule/subsubmodule/submodulea.py'

This change corrects the error by changing the filename in the context dictionary of the urls module to prepend testserver to the path.

This change also adds on to #768 by updating the django version that the test server uses to the latest LTR version to fix security vulnerabilities.

PR Checklist:

danyeaw commented 5 years ago

Closing this PR. I slept on this and tried today from master. I think the issue was I was not running manage.py from within the testserver directory. I swear I tried that yesterday, but it looks like the trunk version works fine.