fabric/fabric — pull request #912 by yellottyellott (2013-06-07 03:11:27+00:00)
Title: Tweaking template_dir before apply_lcwd is called on a None object.

Issue #902

When calling upload_template with use_jinja=True and leaving template_dir=None, `apply_lcwd` is called with None
https://github.com/fabric/fabric/blob/master/fabric/contrib/files.py#L101

which calls `os.path.isabs(None)`
https://github.com/fabric/fabric/blob/master/fabric/utils.py#L356

which raises:

Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from os.path import isabs
>>> isabs(None)
Traceback (most recent call last):
File "", line 1, in
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 53, in isabs
return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'
>>>