Skip to content
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

Performance improvement in blacklist function #1148

Merged
merged 2 commits into from
Jun 24, 2024
Merged

Commits on Jun 23, 2024

  1. Performance improvement in blacklist function

    The blacklisting function is currently using fnmatch.fnmatch()
    to do matching of qualified names of blacklist calls. It seems
    it is only used for telnetlib and ftplib where they are setting
    the qualified name in a file glob style (telnetlib.*).
    
    This change would slightly break backward compatibility if there
    are any third-party plugins that use globbing in the qualified
    names for blacklisting. I think the likelyhood is small. I also
    think it is better to be more explicit in the qualified name
    patterns. In the case of ftplib, FTP is insecure, but FTP_TLS is
    not. So this already is resolving one false postive.
    
    The other effect of this change is a slight boost to performance.
    When scanning cpython prior to this fix, it would take around 1 min.
    After the fix, closer to 50 seconds. So a nice little bump in speed.
    
    Fixes: PyCQA#438
    
    Signed-off-by: Eric Brown <[email protected]>
    ericwb committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    5e06866 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'main' into perf

    ericwb authored Jun 23, 2024
    Configuration menu
    Copy the full SHA
    997b1f5 View commit details
    Browse the repository at this point in the history