commit | 2b1e6e9696cb433c0e0da11145157d54275d119f | [log] [tgz] |
---|---|---|
author | Dong-hee Na <donghee.na92@gmail.com> | Sun Jul 23 02:20:22 2017 +0900 |
committer | Giampaolo Rodola <g.rodola@gmail.com> | Sat Jul 22 19:20:22 2017 +0200 |
tree | 4ded3efdf0d63a9de76044c94c1aa63a2a51bce3 | |
parent | 896145d9d266ee2758cfcd7691238cbc1f9e1ab8 [diff] [blame] |
bpo-30119: fix ftplib.FTP.putline() to throw an error for a illegal command (#1214)
diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 8f36f53..a02e595 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py
@@ -186,6 +186,8 @@ # Internal: send one line to the server, appending CRLF def putline(self, line): + if '\r' in line or '\n' in line: + raise ValueError('an illegal newline character should not be contained') line = line + CRLF if self.debugging > 1: print('*put*', self.sanitize(line))