classification
Title: tarfile.itn breaks if n is a negative float
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.6, Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: j0ffrey, lars.gustaebel, miss-islington
Priority: normal Keywords: patch

Created on 2018-01-29 21:15 by j0ffrey, last changed 2018-04-01 08:00 by serhiy.storchaka. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 5434 merged j0ffrey, 2018-01-29 22:00
PR 5917 merged miss-islington, 2018-02-27 00:03
PR 5918 merged miss-islington, 2018-02-27 00:05
Messages (2)
msg311173 - (view) Author: Joffrey F (j0ffrey) * Date: 2018-01-29 21:15
Originally reported @ github.com/docker/compose/issues/5618

It seems that tarfile.itn() attempts to execute bitwise operations on a float if the n argument is a negative float, raising a TypeError.

As pointed out in the original report, this is an issue when converting some mtime values in TarInfo._create_header

This also happens for positive floats > 8**11 - 1, but that one is less of an issue for the next two hundred years or so.
msg312974 - (view) Author: miss-islington (miss-islington) Date: 2018-02-27 00:50
New changeset a9a8a9814a52b3c92b3680f0b3a356116510ee18 by Miss Islington (bot) in branch '3.7':
bpo-32713: Fix tarfile.itn for large/negative float values. (GH-5434)
https://github.com/python/cpython/commit/a9a8a9814a52b3c92b3680f0b3a356116510ee18
History
Date User Action Args
2018-04-01 08:00:45serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-02-27 00:50:18miss-islingtonsetnosy: + miss-islington
messages: + msg312974
2018-02-27 00:05:33miss-islingtonsetpull_requests: + pull_request5689
2018-02-27 00:03:33miss-islingtonsetpull_requests: + pull_request5688
2018-01-29 22:00:08j0ffreysetkeywords: + patch
stage: patch review
pull_requests: + pull_request5267
2018-01-29 21:16:45ned.deilysetnosy: + lars.gustaebel
2018-01-29 21:15:56j0ffreycreate