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.

Error when /etc is not readable

See original GitHub issue

Originally reported in https://github.com/pypa/pip/issues/4320.

Hi, I’m doing scientific computations on a Computer cluster. When the sysadmin decided to remove read permissions from /etc pip stopped working, because os.listdir(_UNIXCONFDIR) in distro.py fails.

As a quick fix I changed the following in my local pip installation:

try:
    basenames = os.listdir(_UNIXCONFDIR)
    # We sort for repeatability in cases where there are multiple
    # distro specific files; e.g. CentOS, Oracle, Enterprise all
    # containing `redhat-release` on top of their own.
    basenames.sort()
except OSError:
    basenames = ["os-release"]

This of course requires /etc/os-release to be readable. I just wanted to share this in case someone runs into the same problem!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
nir0scommented, Apr 1, 2017

Released v1.0.4 solving this issue. Thanks @SethMichaelLarson (@dstufft)

0reactions
dstufftcommented, Apr 1, 2017

Thanks a lot!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG]macOS FATA /etc/hosts is not readable/writable ... - GitHub
Hitting the same problem, with the latest crc. That file should be remain readable by everyone, and writable only by root as is...
Read more >
1819216 – /etc/resolver/testing is not readable/writable by the ...
Description of problem: Error with /etc/resolver after stop. $ crc stop Stopping the OpenShift cluster, this may take a few minutes.
Read more >
Fix The Disk You Attached Was Not Readable by This Computer
Summary: Here you'll find 8 efficient methods to fix the disk not readable on Mac issue. Note that the unreadable disk usually means...
Read more >
linux - How to fix "E: The list of sources could not be read ...
5 Answers 5 · 1) rm /etc/apt/sources.list · 2) nano /etc/apt/sources.list · 3) paste the following and save: · 4) sudo apt-get update....
Read more >
Fix 'The Disk Structure Is Corrupted and Unreadable ... - EaseUS
Method 1. Unplug and Re-plug Corrupted/Unreadable Device [Easiest] ... Applies to: Fix device with structure corrupted or unreadable error due to ...
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