add check to verify error.filename is not none
@@ -441,8 +441,8 @@ class InstallCommand(RequirementCommand):
message = create_os_error_message(
error, show_traceback, options.use_user_site,
)
- if WINDOWS and len(str(error)) >= 270:
- if error.errno == errno.ENOENT:
+ if (WINDOWS and error.errno == errno.ENOENT and error.filename and
+ len(str(error)) >= 270):
logger.warning(
'The following error can potentially be caused '
'because Long Paths is disabled on your system. '
