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

e
elisa.onder (1920 points)
2 3 6
asked Dec 12, 2021 in HW8 by elisa.onder (1,920 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)
3 6 44
answered Dec 12, 2021 by gianluca5539 (9,820 points)
selected Dec 12, 2021 by elisa.onder
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 (172680 points)
511 927 1776
commented Dec 12, 2021 by andrea.sterbini (172,680 points)
This way she shares her code too ...
gianluca5539 (9820 points)
3 6 44
commented Dec 12, 2021 by gianluca5539 (9,820 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
commented Dec 12, 2021 by GabrielAlexandru (7,760 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 3 6
commented Dec 12, 2021 by elisa.onder (1,920 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)
3 6 44
commented Dec 12, 2021 by gianluca5539 (9,820 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 3 6
commented Dec 12, 2021 by elisa.onder (1,920 points)
Okay, thank you