Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ftplibretrbinary(rest=...) seems to send incorrect data #127561

Closed as not planned
Closed as not planned
Assignees
picnixz
Labels
stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
@zeddit

Description

@zeddit

Bug report

Bug description:

blocksize=8192#262144 # default 8192local_tmp_filepath.touch(exist_ok=True)## backward 1 blocksize to ensure data correctnessrequest_offset=max(0,local_tmp_filepath.stat().st_size-blocksize)ifrequest_offset>0:print(f"continue downloading at position{request_offset}.")withlocal_tmp_filepath.open('r+b')asf:f.seek(request_offset)ftp_hook.get_conn().retrbinary(f"RETR{str(remote_filepath)}",f.write,rest=request_offset,blocksize=blocksize)

when I used the code above to download some ftp files from the server, there would be a condition that my file finish downloaded has a byte of 32768 larger than it should be.

I don't know what's wrong with it, it's conditional, about 1~2 time in 10 downloads. great thanks!

CPython versions tested on:

3.10

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

Labels

stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp