Problem with the import checker

Dario_loi (1710 points)
0 3 10
asked Nov 6, 2020 in HW1 optional by Dario_loi (1,710 points)
closed Nov 6, 2020 by andrea.sterbini

when I try to test my hw4 solution, anaconda prompt throws an error for every test attempted:

FAILED test_01.py::Test::test_random_1024_00001_random_1024_rnd - TypeError: _check_import() got an unexpected keyword argument 'fromlist'

as far as I can tell, my guess is when I try to open the files by specifying an utf8 encoding: encoding="utf8", the open function tries to import the fromlist library, and the tester kills my execution as if I was trying to import the library myself

I cannot proceed without specifying the encoding, otherwise my program cannot interpet the weird characters from the random exercises correctly, therefore I am stuck :/

407 views
closed with note: testlib.py updated

1 Answer

Best answer
andrea.sterbini (172780 points)
513 935 1789
answered Nov 6, 2020 by andrea.sterbini (172,780 points)
selected Nov 15, 2020 by Dario_loi
Thanks for the notice.

While I check the problem, set DEBUG=True in the test_01.py file to disable all security tests.
andrea.sterbini (172780 points)
513 935 1789
commented Nov 6, 2020 by andrea.sterbini (172,780 points)
It was an older version of the testlib.py, I have updated the zip and the HW4 post
Dario_loi (1710 points)
0 3 10
commented Nov 6, 2020 by Dario_loi (1,710 points)
many thanks! I have tried with the new tests file on my machine and it works fine, unfortunately the VM seems to still have the same problem
andrea.sterbini (172780 points)
513 935 1789
commented Nov 7, 2020 by andrea.sterbini (172,780 points)
I have replaced it also on the VM, next time you upload the error will disappear.