Skip to content

ZipFile.writestr implies non-regular files #68164

Open
@dalphus

Description

@dalphus
mannequin
BPO 23976

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2015-04-16.20:48:40.237>
labels = ['type-bug', 'library']
title = 'ZipFile.writestr implies non-regular files'
updated_at = <Date 2015-04-16.20:48:40.237>
user = 'https://bugs.python.org/dalphus'

bugs.python.org fields:

activity = <Date 2015-04-16.20:48:40.237>
actor = 'dalphus'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2015-04-16.20:48:40.237>
creator = 'dalphus'
dependencies = []
files = []
hgrepos = []
issue_num = 23976
keywords = []
message_count = 1.0
messages = ['241274']
nosy_count = 1.0
nosy_names = ['dalphus']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue23976'
versions = ['Python 2.7']

Linked PRs

Activity

dalphus

dalphus commented on Apr 16, 2015

@dalphus
MannequinAuthor

When ZipFile.writestr is called with arcname as its first parameter, it creates a ZipInfo object that has 0o0600 << 16 as its external_attr. Files created with write generally have 0o0100600 (S_IFREG is set indicating a regular file). Some archive managers (like Ark) will not populate the extracted file unless it contains this flag.

added
stdlibPython modules in the Lib dir
type-bugAn unexpected behavior, bug, or error
on Apr 16, 2015
transferred this issue fromon Apr 10, 2022
added 2 commits that reference this issue on May 19, 2025

pythongh-68164: Set the "regular file" bit in zipfile's writestr

pythongh-68164: Set the "regular file" bit in zipfile's writestr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      ZipFile.writestr implies non-regular files · Issue #68164 · python/cpython

      Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

      Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant