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

Do you need help?

Notice Board

Per partecipare al corso di Fondamenti di programmazione 2023-24 loggatevi e attivatelo nella vostra pagina dei corsi preferiti. A quel punto il corso appare nel menù personale cliccando sul proprio avatar. Per i materiali degli anni precedenti seguite lo stesso metodo.

To join the Programming/Lab 2023-24 course, log-on and select it on the my courses page. It will appear on the personal menu of your avatar. For earlier years use the same method.

Error HW8 Importing py._io.terminalwriter (globals, locals, [None, ['__doc__']]) (not allowed)

e
elisa.onder (1920 points)
2 4 6
in HW8 by (1.9k points)
I uploaded the HW8 and I got this error on some of the tests : Importing py._io.terminalwriter (globals, locals, [None, ['__doc__']]) (not allowed).I have read from the previous questions that it could be a timeout error; anyone have any advice? (if I test it on my computer all tests pass)

1 Answer

Best answer
gianluca5539 (9820 points)
4 6 44
by (9.8k points)
selected by
It could be a timeout, in any case it's an error. Could you share the correctness logs on the results page? Better if you do on pastebin or something so it's more readable

Thanks
andrea.sterbini (207920 points)
750 1267 2373
by (208k points)
This way she shares her code too ...
gianluca5539 (9820 points)
4 6 44
by (9.8k points)
Does she? I looked rapidly at my correctness tab and I can only see the test logs, but probably these include parts of the code if the test fails.

In this case could you share the part of the logs in which the error is shown, making sure that you don't include any part of your code?
GabrielAlexandru (7760 points)
2 4 29
by (7.8k points)
I don’t think it’s a timeout this time. One of my test fail because of a timeout and I receive the correct error message.
e
elisa.onder (1920 points)
2 4 6
by (1.9k points)
Here is the correctness tab where the error is shown (I deleted the parts where you can see my code)

test_01.py==Test==test_data_07___images_data_07_json___True_ Recursion detected! in pattern_diff1

Importing py._io.terminalwriter (globals, locals, [None, ['__doc__']]) (not allowed)

FAILED

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

/home/andrea/miniconda3/lib/python3.8/site-packages/pytest_timeout.py=447= in write_title

    width = py.io.get_terminal_width()

/home/andrea/miniconda3/lib/python3.8/site-packages/py/_vendored_packages/apipkg/__init__.py=152= in __makeattr

    result = importobj(modpath, attrname)

/home/andrea/miniconda3/lib/python3.8/site-packages/py/_vendored_packages/apipkg/__init__.py=72= in importobj

    module = __import__(modpath, None, None, ['__doc__'])

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ('py._io.terminalwriter', None, None, ['__doc__']), kargs = {}

name = 'py._io.terminalwriter', rest = [None, None, ['__doc__']]

    def _check_import(*args, **kargs)=

        name, *rest = args

        if name in forbidden or (not forbidden and name not in allowed)=

            print(f"Importing {name} (globals, locals, {rest[-2=]}) (not allowed)")

>           raise ForbiddenError(f"The import of '{name}' is forbidden")

E           testlib.ForbiddenError= The import of 'py._io.terminalwriter' is forbidden

testlib.py=39= ForbiddenError
gianluca5539 (9820 points)
4 6 44
by (9.8k points)

/home/andrea/miniconda3/lib/python3.8/site-packages/pytest_timeout.py=447= in write_title

I think it's a timeout, you may want to check for it. 

e
elisa.onder (1920 points)
2 4 6
by (1.9k points)
Okay, thank you