# Buggy code
def check_other(self):
    """
    If the requirement is frozen somewhere other than pypi or github, skip.

    If you have a private pypi or use --extra-index-url, consider contributing
    support here.
    """
    if self.reqs:
        print(
            self.style.ERROR("\nOnly pypi and github based requirements are supported:")
        )
        for name, req in self.reqs.items():
            if "dist" in req:
                pkg_info = "{dist.project_name} {dist.version}".format(dist=req["dist"])
            elif "url" in req:
                pkg_info = "{url}".format(url=req["url"])
            else:
                pkg_info = "unknown package"
            print(
                self.style.BOLD(
                    "{pkg_info:40} is not a pypi or github requirement".format(
                        pkg_info=pkg_info
                    )
                )
            )


# Traceback (TypeError)
Package                       Version
----------------------------- ----------
django-extensions             2.1.3

$ cat r.txt
git+https://github.com/jmrivas86/django-json-widget

$ venv/bin/python -B manage.py pipchecker -r r.txt
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File ".../venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File ".../venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File ".../venv/lib/python3.6/site-packages/django/core/management/base.py", line 316, in run_from_argv
self.execute(*args, **cmd_options)
File ".../venv/lib/python3.6/site-packages/django/core/management/base.py", line 353, in execute
output = self.handle(*args, **options)
File ".../venv/lib/python3.6/site-packages/django_extensions/management/utils.py", line 59, in inner
ret = func(self, *args, **kwargs)
File ".../venv/lib/python3.6/site-packages/django_extensions/management/commands/pipchecker.py", line 109, in handle
self.check_github()
File ".../venv/lib/python3.6/site-packages/django_extensions/management/commands/pipchecker.py", line 294, in check_github
print("{pkg_info:40} {msg}".format(pkg_info=pkg_info, msg=msg))
TypeError: unsupported format string passed to NoneType.__format__

# Fixed code
def check_other(self):
    """
    If the requirement is frozen somewhere other than pypi or github, skip.

    If you have a private pypi or use --extra-index-url, consider contributing
    support here.
    """
    if self.reqs:
        self.stdout.write(
            self.style.ERROR("\nOnly pypi and github based requirements are supported:")
        )
        for name, req in self.reqs.items():
            if "dist" in req:
                pkg_info = "{dist.project_name} {dist.version}".format(dist=req["dist"])
            elif "url" in req:
                pkg_info = "{url}".format(url=req["url"])
            else:
                pkg_info = "unknown package"
            self.stdout.write(
                self.style.BOLD(
                    "{pkg_info:40} is not a pypi or github requirement".format(
                        pkg_info=pkg_info
                    )
                )
            )