A ZIP Archive Can Contain the Same Filename More Than Once
An archive viewer shows a familiar report name. An import reads a file with that name. A reviewer reads what appears to be the same file, but the contents differ. One possible explanation is that the ZIP archive contains more than one member with the same name.
Treat an archive as a sequence of member entries, not automatically as a dictionary of unique filenames. Before a package feeds a business workflow, the importer needs a clear rule for ambiguous names.
Inspect entries before selecting by name
Python’s ZIP documentation explicitly discusses archives containing duplicate member names. It allows read and open operations to use a ZipInfo member object rather than only a filename, which can distinguish entries that share a name.
For an intake review, enumerate all members and retain their individual metadata. Count repeated names before building a name-keyed lookup that could hide the duplication. Do not assume that the archive’s presence or successful opening proves its internal naming is unambiguous.
Define the collision policy
For a package format that expects one file per logical name, rejecting duplicate names with an actionable error is often the clearest policy. State which entries collide and ask for a corrected package through the normal intake process.
Other formats may intentionally permit repeated names, but then the consumer needs a documented way to identify the intended entry. Do not invent a universal “first wins” or “last wins” rule and assume every tool will interpret the package the same way.
Illustrative example: two versions of a manifest
Imagine a ZIP contains two entries named manifest.json. One lists three reports; the other lists four. A name-only check confirms that manifest.json exists, but it does not establish which manifest governs the package.
The importer should hold the package under a unique-name contract. Preserve the archive and the collision report for investigation. Silently choosing one entry can produce an apparently valid result that depends on an undocumented selection behavior.
Illustrative example: identical bytes still need a rule
Suppose the two entries contain identical bytes. That reduces one immediate ambiguity, but the package still violates a contract requiring unique names. Decide whether the intake policy allows this condition and record the decision.
Do not let a special-case cleanup silently change the package while reporting that the original passed unchanged. If a normalization step is authorized, preserve the original and identify the normalized output separately.
Check destination collisions separately
Exact duplicate member names are only one concern. Distinct archive paths can also collide after the workflow’s own transformations, such as removing directory prefixes or converting names to a common case.
Test the naming rules of the actual destination and importer. A package that is unambiguous before transformation may become ambiguous afterward. Keep this check separate from path-containment checks, which address where extraction may write.
The archive path-containment guide covers that other boundary. Passing one check should not be reported as passing all archive-safety and completeness checks.
Verify the importer with a small fixture set
Create harmless test archives containing unique names, exact duplicate names, names that collide after the intended transformation and a missing required member. Confirm that each produces the documented outcome.
Inspect the final import inventory rather than only the extraction tool’s exit status. Every accepted logical file should have an identifiable source member and a reviewable relationship to the package manifest.
Keep error messages useful without extracting ambiguous content into the active workspace. Report the package identifier and conflicting names, and avoid exposing unrelated file contents in logs.
Start with a member listing and a written collision rule. That small addition prevents an archive from being treated as a clean set of business documents merely because a familiar filename can be found inside it.
Editorial note
Prepared with AI assistance. Primary sources and the FutureOS article inventory were checked on October 26, 2026. Examples are illustrative, not customer results. FutureOS is described as being in prelaunch in its current introduction. This guide does not claim an available product feature, integration or service, and no independent expert review is claimed.




Comments