security-check.py is using wrong comparison operators #20338

issue MarcoFalke opened this issue on November 8, 2020
  1. MarcoFalke commented at 9:52 AM on November 8, 2020: member
    ./contrib/devtools/security-check.py:65: SyntaxWarning: "is" with a literal. Did you mean "=="?
      if splitline[ofs_flags + 1] is 'E':
    ./contrib/devtools/security-check.py:65: SyntaxWarning: "is" with a literal. Did you mean "=="?
      if splitline[ofs_flags + 1] is 'E':
    ./contrib/devtools/security-check.py:65: SyntaxWarning: "is" with a literal. Did you mean "=="?
      if splitline[ofs_flags + 1] is 'E':
    ./contrib/devtools/security-check.py:65: SyntaxWarning: "is" with a literal. Did you mean "=="?
      if splitline[ofs_flags + 1] is 'E':
    ./contrib/devtools/security-check.py:65: SyntaxWarning: "is" with a literal. Did you mean "=="?
      if splitline[ofs_flags + 1] is 'E':
    ./contrib/devtools/security-check.py:65: SyntaxWarning: "is" with a literal. Did you mean "=="?
      if splitline[ofs_flags + 1] is 'E':
    

    See also:

    >>> 'asdf'[:2] == 'as'
    True
    >>> 'asdf'[:2] is 'as'
    <stdin>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
    False
    
  2. MarcoFalke added the label Bug on Nov 8, 2020
  3. practicalswift commented at 7:52 PM on November 8, 2020: contributor

    Have we discussed using checksec.py (which uses the excellent LIEF library) instead?

    https://pypi.org/project/checksec.py/

    I've used checksec.py and I find it more robust and well-maintained.

  4. practicalswift commented at 7:54 PM on November 8, 2020: contributor

    Ouch, I now saw that checksec.py is a non-starter (GPLv3). Never mind!

  5. tylerchambers commented at 9:47 PM on November 8, 2020: contributor

    This is new in 3.8+. The above small fix should fix the problem (couldn't find any other occurrences).

  6. fanquake closed this on Nov 17, 2020

  7. sidhujag referenced this in commit 4b71043e4f on Nov 17, 2020
  8. DrahtBot locked this on Feb 15, 2022
  9. knst referenced this in commit 31136e845c on Mar 9, 2023
  10. knst referenced this in commit 69d2eb90fd on Apr 3, 2023
  11. knst referenced this in commit 6f2bd8c288 on Apr 14, 2023
  12. knst referenced this in commit 40cfb39aec on Apr 18, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me