dnicolodi · GitHub

Bug report

Bug description:

In #138309 tarfile.TarFile.extract() has been modified to replace / in symlink targets with \ on Windows. I believe that the opposite normalization should be done in tarfile.TarFile.add().

I have noticed this in a downstream project that extracts tar archives generated by git dist, adds some additional files, and recreates the archive. When the git repository contains a symbolic link, the repacked archive contains symbolic link with the wrong path separators.

Before #138309, the extracted symbolic links on Windows were not functional (I believe) but the repacked archive had the same content as the original one. After #138309, this is not true anymore.

CPython versions tested on:

3.15

Operating systems tested on:

Windows

Linked PRs

Read the original on github.com ↗