Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency

Do you need help?

Problem with the import checker

Dario_loi (1710 points)
1 4 10
in HW1 optional by (1.7k points)
closed by

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 :/

589 views
closed with the note: testlib.py updated

1 Answer

Best answer
andrea.sterbini (207940 points)
756 1270 2377
by (208k points)
selected by
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 (207940 points)
756 1270 2377
by (208k points)
It was an older version of the testlib.py, I have updated the zip and the HW4 post
Dario_loi (1710 points)
1 4 10
by (1.7k 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 (207940 points)
756 1270 2377
by (208k points)
I have replaced it also on the VM, next time you upload the error will disappear.