summaryrefslogtreecommitdiffstats
path: root/Lib/py_compile.py
diff options
context:
space:
mode:
authorGraham Inggs <ginggs@debian.org>2021-10-15 09:38:55 (GMT)
committerGitHub <noreply@github.com>2021-10-15 09:38:55 (GMT)
commit59a633d3e2071d65aa6638da5cf767a5c1310271 (patch)
tree3eed8f326cb98dde847e99415947ea2f24c14709 /Lib/py_compile.py
parent8e5de40f90476249e9a2e5ef135143b5c6a0b512 (diff)
downloadcpython-59a633d3e2071d65aa6638da5cf767a5c1310271.zip
cpython-59a633d3e2071d65aa6638da5cf767a5c1310271.tar.gz
cpython-59a633d3e2071d65aa6638da5cf767a5c1310271.tar.bz2
bpo-45428: Fix reading filenames from stdin in py_compile (GH-28848)
Strip trailing '\n'.
Diffstat (limited to 'Lib/py_compile.py')
-rw-r--r--Lib/py_compile.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/py_compile.py b/Lib/py_compile.py
index 0f9b590..388614e 100644
--- a/Lib/py_compile.py
+++ b/Lib/py_compile.py
@@ -190,7 +190,7 @@ def main():
)
args = parser.parse_args()
if args.filenames == ['-']:
- filenames = sys.stdin.readlines()
+ filenames = [filename.rstrip('\n') for filename in sys.stdin.readlines()]
else:
filenames = args.filenames
for filename in filenames: