mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Patch #995126: Correct directory size, and generate GNU tarfiles by default.
This commit is contained in:
parent
78a8acc55b
commit
75b9da4aaf
3 changed files with 6 additions and 3 deletions
|
@ -262,6 +262,7 @@ tar archive several times. Each archive member is represented by a
|
||||||
this limit. If false, create a GNU tar compatible archive. It
|
this limit. If false, create a GNU tar compatible archive. It
|
||||||
will not be \POSIX{} compliant, but can store files without any
|
will not be \POSIX{} compliant, but can store files without any
|
||||||
of the above restrictions.
|
of the above restrictions.
|
||||||
|
\versionchanged[\var{posix} defaults to false.]{2.4}
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{dereference}
|
\begin{memberdesc}{dereference}
|
||||||
|
|
|
@ -781,7 +781,7 @@ class TarFile(object):
|
||||||
# messages (if debug >= 0). If > 0, errors
|
# messages (if debug >= 0). If > 0, errors
|
||||||
# are passed to the caller as exceptions.
|
# are passed to the caller as exceptions.
|
||||||
|
|
||||||
posix = True # If True, generates POSIX.1-1990-compliant
|
posix = False # If True, generates POSIX.1-1990-compliant
|
||||||
# archives (no GNU extensions!)
|
# archives (no GNU extensions!)
|
||||||
|
|
||||||
fileobject = ExFileObject
|
fileobject = ExFileObject
|
||||||
|
@ -1137,7 +1137,7 @@ class TarFile(object):
|
||||||
tarinfo.mode = stmd
|
tarinfo.mode = stmd
|
||||||
tarinfo.uid = statres.st_uid
|
tarinfo.uid = statres.st_uid
|
||||||
tarinfo.gid = statres.st_gid
|
tarinfo.gid = statres.st_gid
|
||||||
tarinfo.size = statres.st_size
|
tarinfo.size = not stat.S_ISDIR(stmd) and statres.st_size or 0
|
||||||
tarinfo.mtime = statres.st_mtime
|
tarinfo.mtime = statres.st_mtime
|
||||||
tarinfo.type = type
|
tarinfo.type = type
|
||||||
tarinfo.linkname = linkname
|
tarinfo.linkname = linkname
|
||||||
|
|
|
@ -44,6 +44,8 @@ Extension modules
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- tarfile now generates GNU tar files by default.
|
||||||
|
|
||||||
- HTTPResponse has now a getheaders method.
|
- HTTPResponse has now a getheaders method.
|
||||||
|
|
||||||
- Patch #1006219: let inspect.getsource handle '@' decorators. Thanks Simon
|
- Patch #1006219: let inspect.getsource handle '@' decorators. Thanks Simon
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue