Skip to content

pip list --outdated and --uptodate broken #6777

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

Closed
alex-d-boyd opened this issue Jul 23, 2019 · 1 comment
Closed

pip list --outdated and --uptodate broken #6777

alex-d-boyd opened this issue Jul 23, 2019 · 1 comment
Labels
auto-locked Outdated issues that have been locked by automation resolution: duplicate Duplicate of an existing issue/PR

Comments

@alex-d-boyd
Copy link

alex-d-boyd commented Jul 23, 2019

Environment

  • pip version:
C:\WINDOWS\system32>pip --version
pip 19.2 from c:\program files\python37\lib\site-packages\pip (python 3.7)
  • Python version:
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
  • OS:
C:\WINDOWS\system32>ver
Microsoft Windows [Version 10.0.18362.239]

Description
Running pip list with either --outdated or --uptodate switches generates a NoneType attribute error.
pip list with no switches, and pip list --not-required both function as expected. I have not tested other list switches.

Expected behavior
Expected a list of either outdated or up-to-date installed packages

How to Reproduce
Run either of the following commands:

  • pip list --outdated
  • pip list --uptodate

Output

C:\WINDOWS\system32>pip list --outdated
ERROR: Exception:
Traceback (most recent call last):
  File "c:\program files\python37\lib\site-packages\pip\_internal\cli\base_command.py", line 188, in main
    status = self.run(options, args)
  File "c:\program files\python37\lib\site-packages\pip\_internal\commands\list.py", line 156, in run
    packages = self.get_outdated(packages, options)
  File "c:\program files\python37\lib\site-packages\pip\_internal\commands\list.py", line 164, in get_outdated
    dist for dist in self.iter_packages_latest_infos(packages, options)
  File "c:\program files\python37\lib\site-packages\pip\_internal\commands\list.py", line 164, in <listcomp>
    dist for dist in self.iter_packages_latest_infos(packages, options)
  File "c:\program files\python37\lib\site-packages\pip\_internal\commands\list.py", line 195, in iter_packages_latest_infos
    best_candidate = evaluator.get_best_candidate(all_candidates)
  File "c:\program files\python37\lib\site-packages\pip\_internal\index.py", line 729, in get_best_candidate
    best_candidate = max(candidates, key=self._sort_key)
  File "c:\program files\python37\lib\site-packages\pip\_internal\index.py", line 710, in _sort_key
    has_allowed_hash = int(link.is_hash_allowed(self._hashes))
  File "c:\program files\python37\lib\site-packages\pip\_internal\models\link.py", line 213, in is_hash_allowed
    return hashes.is_hash_allowed(self.hash_name, hex_digest=self.hash)
AttributeError: 'NoneType' object has no attribute 'is_hash_allowed'

C:\WINDOWS\system32>pip list --uptodate
ERROR: Exception:
Traceback (most recent call last):
  File "c:\program files\python37\lib\site-packages\pip\_internal\cli\base_command.py", line 188, in main
    status = self.run(options, args)
  File "c:\program files\python37\lib\site-packages\pip\_internal\commands\list.py", line 158, in run
    packages = self.get_uptodate(packages, options)
  File "c:\program files\python37\lib\site-packages\pip\_internal\commands\list.py", line 170, in get_uptodate
    dist for dist in self.iter_packages_latest_infos(packages, options)
  File "c:\program files\python37\lib\site-packages\pip\_internal\commands\list.py", line 170, in <listcomp>
    dist for dist in self.iter_packages_latest_infos(packages, options)
  File "c:\program files\python37\lib\site-packages\pip\_internal\commands\list.py", line 195, in iter_packages_latest_infos
    best_candidate = evaluator.get_best_candidate(all_candidates)
  File "c:\program files\python37\lib\site-packages\pip\_internal\index.py", line 729, in get_best_candidate
    best_candidate = max(candidates, key=self._sort_key)
  File "c:\program files\python37\lib\site-packages\pip\_internal\index.py", line 710, in _sort_key
    has_allowed_hash = int(link.is_hash_allowed(self._hashes))
  File "c:\program files\python37\lib\site-packages\pip\_internal\models\link.py", line 213, in is_hash_allowed
    return hashes.is_hash_allowed(self.hash_name, hex_digest=self.hash)
AttributeError: 'NoneType' object has no attribute 'is_hash_allowed'
@ghost ghost added the S: needs triage Issues/PRs that need to be triaged label Jul 23, 2019
@landfillbaby
Copy link

duplicate of #6772

@chrahunt chrahunt added the resolution: duplicate Duplicate of an existing issue/PR label Jul 24, 2019
@ghost ghost removed the S: needs triage Issues/PRs that need to be triaged label Jul 24, 2019
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Aug 23, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation resolution: duplicate Duplicate of an existing issue/PR
Projects
None yet
Development

No branches or pull requests

4 participants