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.

classification
Title: tarfile may not make @LongLink for non-ascii character
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.2, Python 3.3, Python 3.4
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: lars.gustaebel Nosy List: Manuke, lars.gustaebel
Priority: normal Keywords: patch

Created on 2012-09-07 01:24 by Manuke, last changed 2022-04-11 14:57 by admin.

Files
File name Uploaded Description Edit
issue15875.diff lars.gustaebel, 2012-09-09 14:40 review
Messages (3)
msg169962 - (view) Author: Manuke (Manuke) Date: 2012-09-07 01:24
When I will make a GNU tar-file with 'tarfile', @LongLink may not be made though the name of the archived-file is long, if the name uses non-ascii characters.

In tarfile.py, the check code of the filename length is described as follows now:

tarfile.py: 1032
<         if len(info["name"]) > LENGTH_NAME:

But, the type of the value is 'str', it is not encoded.
It must be described as follows:

>         if len(info["name"].encode(encoding, errors)) > LENGTH_NAME:

There seems to be the same problem in Line 1029(and the other functions for other formats), but I have not confirmed.
msg170105 - (view) Author: Lars Gustäbel (lars.gustaebel) * (Python committer) Date: 2012-09-09 14:40
I prepared a patch that fixes this issue and adds a few tests. Please try if it works for you.
msg170148 - (view) Author: Manuke (Manuke) Date: 2012-09-10 01:06
I have tried your patch and it have worked completely for my test code.
The patch is efficient. Thank you for your speedy work.
History
Date User Action Args
2022-04-11 14:57:35adminsetgithub: 60079
2013-09-04 02:29:09Manukesetversions: + Python 3.4
2012-09-10 01:06:27Manukesetmessages: + msg170148
2012-09-09 14:40:26lars.gustaebelsetfiles: + issue15875.diff
keywords: + patch
messages: + msg170105

stage: patch review
2012-09-08 15:24:32lars.gustaebelsetassignee: lars.gustaebel

nosy: + lars.gustaebel
versions: + Python 3.3
2012-09-07 01:24:21Manukecreate