Staging
v0.5.1
https://github.com/python/cpython
Revision 7df32f844efed33ca781a016017eab7050263b90 authored by Miss Islington (bot) on 27 May 2020, 23:17:52 UTC, committed by GitHub on 27 May 2020, 23:17:52 UTC
Disallow CR or LF in email.headerregistry.Address arguments to guard against header injection attacks.
(cherry picked from commit 614f17211c5fc0e5b828be1d3320661d1038fe8f)

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
1 parent 763b193
Raw File
Tip revision: 7df32f844efed33ca781a016017eab7050263b90 authored by Miss Islington (bot) on 27 May 2020, 23:17:52 UTC
bpo-39073: validate Address parts to disallow CRLF (GH-19007) (#19224)
Tip revision: 7df32f8
rmpyc.py
# Remove all the .pyc files under ../Lib.


def deltree(root):
    import os
    from os.path import join

    npyc = 0
    for root, dirs, files in os.walk(root):
        for name in files:
            # to be thorough
            if name.endswith(('.pyc', '.pyo')):
                npyc += 1
                os.remove(join(root, name))

    return npyc

npyc = deltree("../Lib")
print(npyc, ".pyc deleted")
back to top