mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
bpo-37363: Add audit events for a range of modules (GH-14301)
(cherry picked from commit 60419a7e96
)
Co-authored-by: Steve Dower <steve.dower@python.org>
This commit is contained in:
parent
366dac99c0
commit
8763d43a95
37 changed files with 165 additions and 18 deletions
|
@ -148,6 +148,7 @@ class FTP:
|
|||
self.timeout = timeout
|
||||
if source_address is not None:
|
||||
self.source_address = source_address
|
||||
sys.audit("ftplib.FTP.connect", self, self.host, self.port)
|
||||
self.sock = socket.create_connection((self.host, self.port), self.timeout,
|
||||
source_address=self.source_address)
|
||||
self.af = self.sock.family
|
||||
|
@ -188,6 +189,7 @@ class FTP:
|
|||
def putline(self, line):
|
||||
if '\r' in line or '\n' in line:
|
||||
raise ValueError('an illegal newline character should not be contained')
|
||||
sys.audit("ftplib.FTP.sendcmd", self, line)
|
||||
line = line + CRLF
|
||||
if self.debugging > 1:
|
||||
print('*put*', self.sanitize(line))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue