william-os4y / fapws3

Fast Asynchronous Python Web Server (based on libev)
GNU General Public License v2.0
341 stars 38 forks source link

pip install fails on Mac OS X/installing as non-root: Permission Error #11

Closed fdr closed 14 years ago

fdr commented 14 years ago

This situation can arise on any unix-alike, but it appears to happen in practice on Mac OS X. It is the result of the find_file in setup.py not being robust against directories where one lacks read-access (as can be the case when one uses virtualenv and is not installing as root).

Instead, it would seem reasonable to simply skip such a directory and not crash; the crash blocks the installation as-is.

The issue is in setup.py, line 20: "for elem in os.listdir(ckdir):"

Calls to listdir can fail if a subdirectory doesn't have the necessary permissions with an OSError: Permission Denied.

Here's a stack trace with 0.5.dev as found by pip:

  File "/Users/fdr/codes/RegistryStop/env_reg_stop/build/fapws3/setup.py", line 58, in <module>

    if find_file('libev.a',library_dirs)==False:

  File "build/fapws3/setup.py", line 25, in find_file

    res=find_file(fname,localdirs)

  File "/build/fapws3/setup.py", line 25, in find_file

    res=find_file(fname,localdirs)

  File "/build/fapws3/setup.py", line 20, in find_file

    for elem in os.listdir(ckdir):

OSError: [Errno 13] Permission denied: '/usr/lib/cron/tabs'
william-os4y commented 14 years ago

Thanks for the feedback. I've been able to reproduce it.

Now on my Linux it works.

Could you try it now with the last bugfix (in master) ?

W.

fdr commented 14 years ago

Seems to do the trick; that was fast!

fdr

fdr commented 14 years ago

Hi; it's been a while since this fixed was pushed, and while we could get by without it, it would be highly convenient if a fapws3 release could be pushed to PyPI with this file-permission fix, at the least. As-is those on Mac OS X are left completely out in the cold.

william-os4y commented 14 years ago

That's the big question ... Should I make a release for each fixes ? or should I group them ?

Most importantly, guys having same problem as you had knows how to solve it. They just have to read this page.

But you are right, that I receive few issues during the last couple of weeks. Could I conclude that Fapws has reach a level where functionalities are good, statbility is good enough, ... That's maybe correct ;-)

W.

fdr commented 14 years ago

My feeling is that it is highly inconvenient that fapws3 doesn't work as downloaded from PyPI (therefore, easy_install, pip) for Mac OS X folks for such a minor reason -- this is a large demographic overlap with those who work with Python, so I'd rate the severity of this bug as moderately high to be left as-is on PyPI, and the risk of the fix causing regressions being pretty low.