Description of problem: I will give you an example. From outside of the directory containing the rpm package: german@skytux ~ $ cd Downloads/ german@skytux Downloads $ rpmlint ~/repo-local/pekwm-themes-1.0.5-3.noarch.rpm Traceback (most recent call last): File "/usr/bin/rpmlint", line 378, in <module> main() File "/usr/bin/rpmlint", line 89, in main loadCheck(c) File "/usr/bin/rpmlint", line 73, in loadCheck imp.load_module(name, fobj, pathname, description) File "/usr/share/rpmlint/TagsCheck.py", line 431, in <module> oldest_changelog_timestamp = calendar.timegm(time.strptime("1995-01-01", "%Y-%m-%d")) AttributeError: 'module' object has no attribute 'timegm' In the same directory of the rpm package: german@skytux Downloads $ cd ~/repo-local/ german@skytux repo-local $ rpmlint pekwm-themes-1.0.5-3.noarch.rpm pekwm-themes.noarch: W: invalid-url URL: http://adrinux.wordpress.com/pekwm-themes/ HTTP Error 410: Gone pekwm-themes.noarch: W: no-documentation 1 packages and 0 specfiles checked; 0 errors, 2 warnings. Version-Release number of selected component (if applicable): rpmlint-1.5-1.fc19.noarch How reproducible: Always Steps to Reproduce: 1. rpmlint to a package outside the directory you currently are 2. you will got the error as explained above 3. Actual results: Error as showed in the example above Expected results: List the errors encountered in the rpm package Additional info: This is Fedora 19 x86_64 with current kernel 3.10.3-300.fc19.x86_64.
rpmlint can check packages from any dir just fine. The error indicates that it ends up loading some other "calendar" module than the usual one shipping with Python. You don't happen to have a calendar.py (and/or .pyc, .pyo) in ~/Downloads and "." in the PYTHONPATH environment variable? $ ls -la ~/Downloads/*.py* $ env | grep PYTHON
Oh yes! You are completely right! german@skytux Downloads $ env | grep PYTHON PYTHONPATH=/home/german/Programs/gildas-exe-feb13b/x86_64-fedora18-gfortran/python:/home/german/Programs/gildas-exe-feb13b/x86_64-fedora18-gfortran/python::/home/german/modules:/home/german/modules german@skytux Downloads $ ls -la ~/Downloads/*.py* | grep cal -rwxrwxr-x. 1 german german 4911 May 3 14:49 /home/german/Downloads/calendar.py -rw-rw-r--. 1 german german 3300 Aug 2 19:03 /home/german/Downloads/calendar.pyo german@skytux Downloads $ rm calendar.pyo german@skytux Downloads $ mv calendar.py ~/Programs/ german@skytux Downloads $ rpmlint ~/repo-local/pekwm-themes-1.0.5-3.noarch.rpm pekwm-themes.noarch: W: invalid-url URL: http://adrinux.wordpress.com/pekwm-themes/ HTTP Error 410: Gone pekwm-themes.noarch: W: no-documentation 1 packages and 0 specfiles checked; 0 errors, 2 warnings. Sorry for the noise and thanks for reading the bug report so quickly. But this is something that shouldn't happen with rpmlint, because it will crash every time the user wants to run rpmlint in a directory in which there is a calendar.py file, don't you think? I mean, this behaviour is awkward. Germán.
(In reply to Germán Racca from comment #2) > Oh yes! You are completely right! > > german@skytux Downloads $ env | grep PYTHON > PYTHONPATH=/home/german/Programs/gildas-exe-feb13b/x86_64-fedora18-gfortran/ > python:/home/german/Programs/gildas-exe-feb13b/x86_64-fedora18-gfortran/ > python::/home/german/modules:/home/german/modules > > german@skytux Downloads $ ls -la ~/Downloads/*.py* | grep cal > -rwxrwxr-x. 1 german german 4911 May 3 14:49 > /home/german/Downloads/calendar.py > -rw-rw-r--. 1 german german 3300 Aug 2 19:03 > /home/german/Downloads/calendar.pyo > > german@skytux Downloads $ rm calendar.pyo > german@skytux Downloads $ mv calendar.py ~/Programs/ > german@skytux Downloads $ rpmlint > ~/repo-local/pekwm-themes-1.0.5-3.noarch.rpm > pekwm-themes.noarch: W: invalid-url URL: > http://adrinux.wordpress.com/pekwm-themes/ HTTP Error 410: Gone > pekwm-themes.noarch: W: no-documentation > 1 packages and 0 specfiles checked; 0 errors, 2 warnings. > > Sorry for the noise and thanks for reading the bug report so quickly. > > But this is something that shouldn't happen with rpmlint, because it will > crash every time the user wants to run rpmlint in a directory in which there > is a calendar.py file, don't you think? I mean, this behaviour is awkward. > > Germán. This happens every time: german@skytux ~ $ touch calendar.py german@skytux ~ $ rpmlint repo-local/pekwm-themes-1.0.5-3.noarch.rpm Traceback (most recent call last): File "/usr/bin/rpmlint", line 378, in <module> main() File "/usr/bin/rpmlint", line 89, in main loadCheck(c) File "/usr/bin/rpmlint", line 73, in loadCheck imp.load_module(name, fobj, pathname, description) File "/usr/share/rpmlint/TagsCheck.py", line 431, in <module> oldest_changelog_timestamp = calendar.timegm(time.strptime("1995-01-01", "%Y-%m-%d")) AttributeError: 'module' object has no attribute 'timegm' german@skytux ~ $ ll calendar* -rw-rw-r--. 1 german german 0 Aug 2 19:33 calendar.py -rw-rw-r--. 1 german german 111 Aug 2 19:33 calendar.pyo
(In reply to Germán Racca from comment #2) > But this is something that shouldn't happen with rpmlint, because it will > crash every time the user wants to run rpmlint in a directory in which there > is a calendar.py file, don't you think? No, I don't. It's not limited to calendar.py, it's the same thing with all python modules, and it's not even limited to rpmlint, this affects practically every python program out there. Just be careful with PYTHONPATH.
(In reply to Ville Skyttä from comment #4) > (In reply to Germán Racca from comment #2) > > But this is something that shouldn't happen with rpmlint, because it will > > crash every time the user wants to run rpmlint in a directory in which there > > is a calendar.py file, don't you think? > > No, I don't. It's not limited to calendar.py, it's the same thing with all > python modules, and it's not even limited to rpmlint, this affects > practically every python program out there. Just be careful with PYTHONPATH. You are right once again :) As I'm learning Python, I realized later that it will happen with other python programs as well, because reading the source code of rpmlint, I could see that it imports calendar, and if there is a calendar.py in my Python path, it will import it first. And this is not restricted to rpmlint. Well, thanks for everything, I'm closing this bug. All the best, Germán.