Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tarfile violates bufsize #39297

Closed
johanfo mannequin opened this issue Sep 25, 2003 · 3 comments
Closed

tarfile violates bufsize #39297

johanfo mannequin opened this issue Sep 25, 2003 · 3 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@johanfo
Copy link
Mannequin

johanfo mannequin commented Sep 25, 2003

BPO 812325
Nosy @akuchling
Files
  • tarfile.patch: Add self.__write() call
  • 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 = 'https://github.com/akuchling'
    closed_at = <Date 2004-01-02.15:46:09.000>
    created_at = <Date 2003-09-25.09:08:11.000>
    labels = ['library']
    title = 'tarfile violates bufsize'
    updated_at = <Date 2004-01-02.15:46:09.000>
    user = 'https://bugs.python.org/johanfo'

    bugs.python.org fields:

    activity = <Date 2004-01-02.15:46:09.000>
    actor = 'akuchling'
    assignee = 'akuchling'
    closed = True
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2003-09-25.09:08:11.000>
    creator = 'johanfo'
    dependencies = []
    files = ['1045']
    hgrepos = []
    issue_num = 812325
    keywords = []
    message_count = 3.0
    messages = ['18350', '18351', '18352']
    nosy_count = 2.0
    nosy_names = ['akuchling', 'johanfo']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue812325'
    versions = ['Python 2.4']

    @johanfo
    Copy link
    Mannequin Author

    johanfo mannequin commented Sep 25, 2003

    tf = tarfile.open(mode = 'w|gz', fileobj=fileName, 
    bufsize=20*512)

    The following text says how many bytes tarfile writes to
    the 'fileName.write' function. Notice that when closing
    the tarfile it writes way to many bytes! This happes
    just sometimes. Some directories might work, other
    might not.

    ...
    write len: 10240
    write len: 10240
    Closing archive
    write len: 24815 # Somthing is wrong?
    write len: 4
    write len: 4

    @johanfo johanfo mannequin closed this as completed Sep 25, 2003
    @johanfo johanfo mannequin assigned akuchling Sep 25, 2003
    @johanfo johanfo mannequin added the stdlib Python modules in the Lib dir label Sep 25, 2003
    @akuchling
    Copy link
    Member

    Logged In: YES
    user_id=11375

    The close() method just writes the contents of self.buf to the file without
    breaking it up into blocks.

    Please try the attached patch and let us know if it fixes the problem.

    @akuchling
    Copy link
    Member

    Logged In: YES
    user_id=11375

    I've committed my fix as rev. 1.10 of tarfile.py.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant