diff options
author | Alex Martelli <aleaxit@gmail.com> | 2006-08-24 02:58:11 (GMT) |
---|---|---|
committer | Alex Martelli <aleaxit@gmail.com> | 2006-08-24 02:58:11 (GMT) |
commit | 01c77c66289f8e9c8d15b8da623fae4014ec2edb (patch) | |
tree | f719c69719857899da42d2af8ceb48824cf4fe0d /Lib/tarfile.py | |
parent | b5d47efe92fd12cde1de6a473108ef48238a43cc (diff) | |
download | cpython-01c77c66289f8e9c8d15b8da623fae4014ec2edb.zip cpython-01c77c66289f8e9c8d15b8da623fae4014ec2edb.tar.gz cpython-01c77c66289f8e9c8d15b8da623fae4014ec2edb.tar.bz2 |
Anna Ravenscroft identified many occurrences of "file" used to open a file
in the stdlib and changed each of them to use "open" instead. At this
time there are no other known occurrences that can be safely changed (in
Lib and all subdirectories thereof).
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r-- | Lib/tarfile.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 38cccae..f7ddac8 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -934,7 +934,7 @@ class TarFile(object): self.mode = {"r": "rb", "a": "r+b", "w": "wb"}[mode] if not fileobj: - fileobj = file(self.name, self.mode) + fileobj = open(self.name, self.mode) self._extfileobj = False else: if self.name is None and hasattr(fileobj, "name"): @@ -1083,7 +1083,7 @@ class TarFile(object): tarname = pre + ext if fileobj is None: - fileobj = file(name, mode + "b") + fileobj = open(name, mode + "b") if mode != "r": name = tarname @@ -1355,7 +1355,7 @@ class TarFile(object): # Append the tar header and data to the archive. if tarinfo.isreg(): - f = file(name, "rb") + f = open(name, "rb") self.addfile(tarinfo, f) f.close() @@ -1617,7 +1617,7 @@ class TarFile(object): """Make a file called targetpath. """ source = self.extractfile(tarinfo) - target = file(targetpath, "wb") + target = open(targetpath, "wb") copyfileobj(source, target) source.close() target.close() |