Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filename is None? #183

Open
wpoely86 opened this issue Aug 14, 2015 · 3 comments
Open

filename is None? #183

wpoely86 opened this issue Aug 14, 2015 · 3 comments

Comments

@wpoely86
Copy link
Contributor

Using 443a227 on Debian 8.

== 2015-08-14 13:44:25,331 main INFO No easyconfigs left to be built.
== No easyconfigs left to be built.
== 2015-08-14 13:44:25,334 main INFO Build succeeded for 0 out of 0
== Build succeeded for 0 out of 0
Traceback (most recent call last):
  File "/home/ward/opt/lib/python2.7/site-packages/easybuild_framework-2.2.0.dev0-py2.7.egg/easybuild/main.py", line 339, in <module>
    main()
  File "/home/ward/opt/lib/python2.7/site-packages/easybuild_framework-2.2.0.dev0-py2.7.egg/easybuild/main.py", line 332, in main
    stop_logging(logfile, logtostdout=options.logtostdout)
  File "/home/ward/opt/lib/python2.7/site-packages/easybuild_framework-2.2.0.dev0-py2.7.egg/easybuild/tools/build_log.py", line 204, in stop_logging
    fancylogger.logToFile(logfile, enable=False)
  File "/home/ward/opt/lib/python2.7/site-packages/vsc_base-2.2.5-py2.7.egg/vsc/utils/fancylogger.py", line 468, in logToFile
    directory = os.path.dirname(filename)
  File "/usr/lib/python2.7/posixpath.py", line 129, in dirname
    i = p.rfind('/') + 1
AttributeError: 'NoneType' object has no attribute 'rfind'
@stdweird
Copy link
Member

hmm, i guess the error is ok, but not what raises it 😄

@boegel
Copy link
Member

boegel commented Aug 14, 2015

@stdweird: Well, it seems like filename is None somehow, I guess fancylogger could/should check that and either act on it or report a more sensible error?

Figuring out why it is None is also important though. This looks quite similar to easybuilders/easybuild-framework#1298, but that fix is included in the EB version being used here.

@stdweird
Copy link
Member

the why is not relevant here, you shouldn't pass non-sensical data in the first place. from the stacktrace, i assume it's EB that passes the None.

but logToFile should also check for more then None. also empty strings aren't valid filenames. probably a simple

if not filename:
    raise ValueError("Non-sensical filename not allowed.")

at the top of the method is enough i guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants