Moved up check to see if 'repo' was valid before calling the lower() method on it.
improved ability to install into non-ASCII directories
Merge pull request #920 from wcerfgba/patch-1

Incorrect operation sequence in bzr-handling code
Fix pep8
Move unpack_url to pip.download

This puts all unpack functions in the same place.
Cherrypicked from a commit of qwcode
Align unpack_http_url to unpack_file_url
pip.download: add docstring and log
pip.download: refactor and try to clarify

add _check_download_dir and _download_http_url to ease the understanding
of unpack_http_url and unpack_file_url functions