Hi All,
If I run pylint as root (I know, I know), it fails to find my .pylintrc file:
[root@a b]# strace pylint --report n c.py 2>&1 | grep pylintrc
stat("pylintrc", 0x7fff75600e30) = -1 ENOENT (No such file or directory)
stat(".pylintrc", 0x7fff75600e30) = -1 ENOENT (No such file or directory)
stat("/etc/pylintrc", 0x7fff75600e30) = -1 ENOENT (No such file or directory)
The cause seems to be in pylint/config.py (from latest tarball):
90 if 'PYLINTRC' in os.environ and exists(os.environ['PYLINTRC']):
91 pylintrc = os.environ['PYLINTRC']
92 else:
93 user_home = expanduser('~')
94 if user_home == '~' or user_home == '/root':
95 pylintrc = ".pylintrc"
96 else:
97 pylintrc = join(user_home, '.pylintrc')
expanduser() will return a tilde in the case that expanduser isn’t
able to figure out what the home directory is, but I’m not really sure
why we want to set .pylintrc to be in the local directory in the case
that /root is returned; expand user works just fine:
>>> from os.path import expanduser
>>> expanduser('~')
'/root'
Can anyone shed light on this? There is probably a good reason why
that “/root” if block is there, which I would like to understand
before considering if a patch to remove it makes sense.
Thanks,
Alex
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects