This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: tarfile defines stat constants
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: christian.heimes Nosy List: christian.heimes, eli.bendersky, ethan.furman, python-dev, vstinner
Priority: low Keywords: patch

Created on 2013-06-22 14:41 by christian.heimes, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
issue18281.stoneleaf.01.patch ethan.furman, 2013-09-10 03:29 review
Messages (11)
msg191641 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-06-22 14:41
The tarfile module defines a bunch of stat constants:

These constants aren't documented but they look like public API constants. I would like to replace them with values from the stat module:

msg191678 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-06-22 23:18
Interesting commit:

changeset:   76949:492e6c6a01bb
user:        Giampaolo Rodola' <>
date:        Tue May 15 15:30:25 2012 +0200
files:       Doc/library/stat.rst Doc/whatsnew/3.3.rst Lib/ Lib/ Lib/test/ Misc/NEWS
#14807: move undocumented tarfile.filemode() to stat.filemode(). Add tarfile.filemode alias with deprecation warning.

> I would like to replace them with values from the stat module

I would prefer to simply drop all these constants. None is used by the tarfile module. *If* an application uses tarfile to get stat constants, this application must be fixed to use the stat module which contain thse constants since the creation of the stat module, something like 23 years ago...

changeset:   20:118545312f3b
branch:      legacy-trunk
user:        Guido van Rossum <>
date:        Sun Oct 21 16:17:08 1990 +0000
files:       Lib/
Initial revision
msg192376 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-07-05 23:30
OK, your proposal is more appealing. Any last words before the constants are gone for good?
msg197420 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2013-09-10 03:28
Interestingly enough, the two constants that are used are prefixed with `stat`.

Patch attached.

msg197437 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2013-09-10 13:30
lgtm. kill 'em
msg199129 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2013-10-07 03:36
Christian, do you mind if I get this patchd committed?
msg199427 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-10-10 22:57
issue18281.stoneleaf.01.patch looks good to me, please commit it!
msg199621 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2013-10-12 20:38
Sounds like we have a consensus.  If no objections I'll commit in four or five days (in time for the last alpha).
msg199627 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-10-12 21:47
Yes, please commit your patch. I totally wanted to reply to your mail but I was distracted by other things. Sorry!
msg199632 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2013-10-12 22:17
Cool, thanks!

I didn't want to step on any toes.  :)
msg199648 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-10-13 01:13
New changeset 3d557da59c22 by Ethan Furman in branch 'default':
Close #18281: superfluous stat constants removed from tarfile
Date User Action Args
2022-04-11 14:57:47adminsetgithub: 62481
2013-10-13 01:13:07python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg199648

resolution: fixed
stage: patch review -> resolved
2013-10-12 22:17:33ethan.furmansetmessages: + msg199632
2013-10-12 21:47:43christian.heimessetmessages: + msg199627
2013-10-12 20:38:08ethan.furmansetmessages: + msg199621
2013-10-10 22:57:33vstinnersetmessages: + msg199427
2013-10-07 03:36:27ethan.furmansetmessages: + msg199129
2013-09-10 13:30:43eli.benderskysetnosy: + eli.bendersky
messages: + msg197437
2013-09-10 03:29:01ethan.furmansetfiles: + issue18281.stoneleaf.01.patch
keywords: + patch
stage: needs patch -> patch review
2013-09-10 03:28:30ethan.furmansetmessages: + msg197420
2013-07-05 23:30:25christian.heimessetassignee: christian.heimes
messages: + msg192376
2013-06-22 23:18:08vstinnersetnosy: + vstinner
messages: + msg191678
2013-06-22 16:48:03ethan.furmansetnosy: + ethan.furman
2013-06-22 14:41:18christian.heimescreate