question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

test_events_watched_outside_test_are_ignored fails with PermissionError

See original GitHub issue

I am currently trying to package asynctest-0.12.2 for Gentoo Linux and I am running into a test error:

======================================================================
ERROR: test_events_watched_outside_test_are_ignored (test.test_selector.Test_fail_on_active_selector_callbacks)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.6/asyncio/selector_events.py", line 264, in _add_reader
    key = self._selector.get_key(fd)
  File "/usr/lib64/python3.6/selectors.py", line 191, in get_key
    raise KeyError("{!r} is not registered".format(fileobj)) from None
KeyError: "<FileMock id='139800751692488'> is not registered"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.6/unittest/mock.py", line 1598, in _inner
    return f(*args, **kw)
  File "/var/tmp/portage/dev-python/asynctest-0.12.2/work/asynctest-0.12.2/test/test_selector.py", line 295, in test_events_watched_outside_test_are_ignored
    loop.add_reader(mock, lambda: None)
  File "/usr/lib64/python3.6/asyncio/selector_events.py", line 337, in add_reader
    return self._add_reader(fd, callback, *args)
  File "/usr/lib64/python3.6/asyncio/selector_events.py", line 267, in _add_reader
    (handle, None))
  File "/usr/lib64/python3.6/selectors.py", line 412, in register
    self._epoll.register(key.fd, epoll_events)
PermissionError: [Errno 1] Operation not permitted

----------------------------------------------------------------------
Ran 215 tests in 0.447s

FAILED (errors=1)

I acquired the source tarball from PyPI and executed the test with the command PYTHONPATH=. python3.6 -m unittest --verbose test. All other tests run successfully.

Am I doing something wrong or can you reproduce the issue, too?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
bucefal91commented, Nov 15, 2018

Hey! Hehe, I am trying to pack this python package into Gentoo too! 😃 My gentoo bug is https://bugs.gentoo.org/669272 What is your gentoo bug or pull request? So we do not do the same job twice.

I am also having the same issue. If I discover anything worthwhile I’ll post here.

0reactions
rathanncommented, Jan 10, 2019

Interestingly enough, if I enter the build container using mock -r fedora-rawhide-x86_64 shell and run the testsuite manually (PYTHONPATH=$(pwd) python3 -m unittest test) it doesn’t fail.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PermissionError: [Errno 13] Permission denied - Stack Overflow
Often this error occurs despite the file having correct permissions set, and so the answer has to be something else. This is it....
Read more >
PermissionError: [Errno 13] Permission denied error solved
The "PermissionError: [Errno 13] Permission denied error" occurs for multiple reasons: Trying to open a file, but the specified path is a folder....
Read more >
Python PermissionError: [errno 13] permission denied Solution
Our code returns an error. The Solution. A PermissionError indicates that Python does not have the right permissions to access a file. Let's ......
Read more >
File PermissionError at Midi File output (Python3, Win7) #21
I'm getting the following error on a performance_rnn_generate run (on Magenta Python3 Win7): Seems to occur when trying to output the ...
Read more >
You don't have permission error - Windows Server
"You don't have permission" error message when you try to mount an ISO image · You double-click an .iso file or you use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found