CHANGELOG
4.2.5 - 2025.10.20
feat
Added the
webdavprotocol, implemented using the webdavclient3 library. Please install it usingpip install 'megfile[webdav]'.Added an atomic flag; when enabled, abnormal exits (including exceptions thrown within the with block or exiting without calling close) will not produce any file.
fix
Fixed some interface errors in sftp2, including readlink, utime, and chmod.
chore
update warning for the S3 config path
4.2.4 - 2025.09.01
feat
Added the
sftp2protocol, implemented using the ssh2-python library, which is faster. Please install it usingpip install 'megfile[sftp2]'.
perf
Added the
MEGFILE_READER_LAZY_PREFETCHenvironment variable, which allows the reader to read in a lazy manner.For performance reasons,
_is_pickleonly determines based on the file extension. If your file extension is not.pklor.pickle, please add thebuffered=Trueparameter to improve pickle reading performance.
4.2.3 - 2025.08.13
fix
fix samefile logic error for s3+profile in sync
fix sync error in cli when glob path
4.2.2 - 2025.08.04
fix
support custom copy method for s3 path with protocol
fix incorrect offset in
s3_uploadwhen retrying
chore
pin paramiko < 4.0
4.2.1 - 2025.07.15
fix
fixed file deletion failure after enabling OSS versioning
perf
optimize
is_filein s3
4.2.0 - 2025.07.04
breaking change
In S3, the
scan,glob, andwalkfunctions skip files named/, as such files are typically used to mark an object as a directory. In Megfile, paths ending with a/are treated as directories.
4.1.8.post1 - 2025.07.03
fix
http_openissue whenContent-Lengthnot in response header
4.1.8 - 2025.06.13
perf
optimize
smart_openfor S3-to-S3 transfers using s3+protocol in path
4.1.7 - 2025.05.28
feat
support
AWS_PROFILE,[PROFILE__]AWS_ENDPOINT_URLand[PROFILE__]AWS_ENDPOINT_URL_S3environments
perf
speedup
s3_globwhen too many files in a directory
fix
fix the issue where permissions are lost after 1 hour when using STS token
4.1.6 - 2025.04.30
feat
support retry
requests.exceptions.ConnectionErrorin http
fix
fix error log
4.1.5 - 2025.04.28
perf
Optimize
HTTPPathwithrequests.SessionEnable S3 on Windows; testing incomplete, bugs may exist
fix
fix
get_human_sizewhen inputsize_bytesis lower than 1KB
4.1.4.post1 - 2025.04.25
fix
fix incorrect read when OSS presigned URL with Range end exceeds file size.
4.1.4 - 2025.04.14
fix
Modify the default configuration to make the third party OSS support boto3 >= 1.36
4.1.3.post2 - 2025.04.10
fix
fix
s3_globwith profile
4.1.3.post1 - 2025.03.31
fix
remove redundant files in the whl
4.1.3 - 2025.03.31
feat
support auto complete paths of most protocols in cli
aliascommand in cli support setting path prefixsupport retrying
botocore.exceptions.SSLErrorin s3
4.1.2 - 2025.03.07
feat
support retrying S3 request with more error codes of aliyun oss
4.1.1 - 2025.02.05
perf
update the default worker number for the
synccommandoptimize the performance of the
synccommand
feat
support retrying more errors
fix
fix
smart_movebug when path with alias of s3 protocol
4.1.0.post3 - 2025.01.23
fix
fix
--skipnot work incpcommand when path is dir.
4.1.0.post2 - 2025.01.17
fix
fix
s3_globbug when bucket in path with*in{}
4.1.0.post1 - 2025.01.10
fix
fix
pickle.loadS3UnknownErrorbug
4.1.0 - 2025.01.09
breaking change
Remove the
followlinksparameter fromhdfs_listdir,hdfs_load_from,hdfs_scandir,HdfsPath.load,HdfsPath.scandir, and keep the behavior asfollowlinks=False.Remove the
followlinksparameter froms3_access,s3_listdir,s3_load_from,s3_scandir,s3_glob,s3_glob_stat,s3_iglob,s3_load_content,S3Path.access,S3Path.listdir,S3Path.load,S3Path.scandir,S3Path.glob,S3Path.glob_stat,S3Path.iglob,S3Path.iterdir, and keep the behavior asfollowlinks=False.Remove the
missing_okparameter froms3_listdir,s3_scandir,S3Path.listdir,S3Path.scandir, and set the default behavior tomissing_ok=False.Path.iterdirandPath.scandirno longer guarantees dictionary order. If order is required, please usePath.listdir.
perf
reduce the use of
is_dirin S3 to decrease the number of requests
fix
Fix
is_symlinkin theStatResultreturned byS3Path.scandiris incorrect.Fix
SftpPath.listdirthrowing an error when the input is a symbolic link.Fix an issue that
S3PermissionErroris raised when performing amkdiroperation without sufficient permissions on S3.
4.0.4 - 2025.01.03
perf
reduce the use of
is_dirin S3 to decrease the number of requests
4.0.3 - 2024.12.26
perf
keep reading file even if etag is not returned from s3 server
4.0.2 - 2024.12.20
feat
add env
MEGFILE_LOG_LEVELfor set log leveladd
--log-levelin cli for set log level
fix
fix
max_buffer_sizenot work when is0insmart_open
4.0.1 - 2024.12.12
feat
support kubernetes canonical form quantity in environment variable
support add host key for sftp
perf
use
head_objectto get file size in prefetch reader when no cache
fix
fix
smart_load_contentbug when only end is not None
4.0.0.post1 - 2024.12.09
fix s3 part upload size being too small caused by autoscaling block size
4.0.0 - 2024.12.06
breaking change
Dropped support for Python 3.8; added support for Python 3.13.
Removed the deprecated methods
is_linkandget_protocolfromBasePath.The
__del__method inFilelikenow closes file handles.Removed
BaseURIPath.- Changed the default SFTP missing host key policy from
autotoreject. You can set the default policy using the
MEGFILE_SFTP_HOST_KEY_POLICYenvironment.
Available values:auto,reject,warning.
- Changed the default SFTP missing host key policy from
Environment variable changes:
Removed:
MEGFILE_BLOCK_SIZEMEGFILE_MAX_BUFFER_SIZEMEGFILE_BLOCK_CAPACITYMEGFILE_MIN_BLOCK_SIZEMEGFILE_MAX_BLOCK_SIZE
Added:
MEGFILE_READER_BLOCK_SIZEMEGFILE_READER_MAX_BUFFER_SIZEMEGFILE_WRITER_BLOCK_SIZEMEGFILE_WRITER_MAX_BUFFER_SIZE
Updated
MEGFILE_MAX_WORKERSdefault value from32to8.
Updated all
openmethod parameters:Removed
min_block_sizeandmax_block_size.Replaced
forward_ratio: Optional[float]byblock_forward: Optional[int].Renamed
max_concurrencytomax_workers.
Updated
__init__parameters for allReaderclasses inheriting fromBasePrefetchReader:Replaced
block_capacity: intbymax_buffer_size: int.
Updated
S3BufferedWriter.__init__parameters:Removed
max_block_size.
perf
Introduced
TransferConfigfor S3 to allow user-configurable upload and download settings.By default, writing larger files to S3 is now supported. Refer to the configuration docs for details.
Reduced the number of S3 requests during
smart_sync.
feat
Added the
MEGFILE_WRITER_BLOCK_AUTOSCALEenvironment variable to enable S3 block autoscaling. Default istrue. However, if you setMEGFILE_WRITER_BLOCK_SIZE, default will befalse.
3.1.7 - 2024.12.12
fix
fix
smart_load_contentbug when only end is not None
3.1.6.post1 - 2024.11.18
fix
support ali oss response
strip auth headers on redirect
3.1.6 - 2024.11.14
fix
fix bugs of alias paths in
megfile lscommandsupport
InvalidRangeerror in tos oss
feat
add new env
AWS_S3_VERIFYfor setting s3 verify, default istrueadd new env
AWS_S3_REDIRECTfor turning on supporting http redirect, default isfalse
3.1.5 - 2024.11.05
feat
support
AWS_SESSION_TOKENenv
3.1.4 - 2024.11.01
feat
add
megfile config aliascommand for adding custom protocol aliasglob path support using glob syntax within curly braces but does not support nesting.
3.1.3 - 2024.08.23
feat
support retrying S3 request with error codes of
TimeoutandRequestTimeout.
3.1.2 - 2024.08.12
perf
add retry logic for S3 error
429
fix
fix the deadlock issue of prefetch reader after fork
3.1.1 - 2024.07.24
perf
smart_cacheinwmode can generate cache path when paramcache_pathis Nonereader and writer support more types like
numpy.uint64for some params, e.g.offsetparam inseeksupportnumpy.uint64type
3.1.0.post2 - 2024.07.22
fix
fix
block_sizeoverwritten by defaultmin_block_sizeins3_open
3.1.0.post1 - 2024.07.15
fix
fix wrong name of cli
3.1.0 - 2024.07.09
breaking change
remove
megfile.utils.cachedpropertymodify the parameter order of
s3_downloadands3_uploadchange param
cookietooffsetin someseekfunctions
perf
optimize the type annotations
FileLikeis subclass ofio.IOBaseandtyping.IO
chore
use
pyproject.tomlinstead ofsetup.py
3.0.6.post1 - 2024.06.21
fix
add cli extras require, run
pip install 'megfile[cli]'to install cli requirements
3.0.6 - 2024.06.12
feat
support more parameters of
requestslikeheadersinHttpPath.support
overwriteparameter incopy,syncandmovefunctions, default isTrue.cli command
mv,cp,syncsupport--skipoption, can skip existed files.
perf
http request will check body size and retry when body is incomplete.
3.0.5 - 2024.05.28
feat
auto decode http content when response with
Content-Encodingheader
perf
add s3 retry code, retry request when catch response code
499add environments for setup retry times:
MEGFILE_MAX_RETRY_TIMES,MEGFILE_S3_MAX_RETRY_TIMES,MEGFILE_HTTP_MAX_RETRY_TIMES,MEGFILE_HDFS_MAX_RETRY_TIMES,MEGFILE_SFTP_MAX_RETRY_TIMES. default is10
3.0.4 - 2024.05.16
feat
Support more official S3 configurations. New env:
AWS_ENDPOINT_URL_S3,AWS_ENDPOINT_URL.
3.0.3 - 2024.05.10
perf
optimize read and write performance for s3, http and hdfs
3.0.2.post1 - 2024.04.25
fix
fix
smart_globbug of s3 path with profile name
3.0.2 - 2024.04.24
feat
support
-f/--followintailcommand
fix
fix
smart_copybug in the function registered byatexit
3.0.1 - 2024.03.08
feat
command
llshow file count
perf
support new err for sftp to retry
3.0.0.post1 - 2024.01.22
fix
fix symlink paths in command
lsandll
3.0.0 - 2024.01.22
breaking change
python3.6 and python3.7 is no longer supported
chore
support python3.12
perf
command
lsandllsupport symlink files
2.2.10.post1 - 2024.01.04
fix
fix callback in smart_copy
sync command show error log correctly
2.2.10 - 2023.12.12
feat
support some new environments for config
2.2.9.post5 - 2023.11.26
fix
add connect errors to retry list
2.2.9.post4 - 2023.11.17
fix
The file object returned by
sftp_opensupports thenameproperty.
2.2.9.post3 - 2023.11.09
fix
Reduce unnecessary requests in the s3 scan.
2.2.9.post2 - 2023.11.08
fix
fix the issue where
s3_uploadands3_downloadare not retrying correctly.
2.2.9.post1 - 2023.11.02
fix
fix
is_symlinkinStatResultfrom scan funcs
2.2.9 - 2023.10.31
feat
cli support
llcommand
perf
optimize error message of scan funcs
when dst in cli
mvandcpis endswith/, will put file into the dst dir even if it doesn’t exist
fix
fix sync when empty dir
fix the return value of the callback for smart_copy when the path is sftp
2.2.8.post2 - 2023.10.25
fix
fix sync when empty dir
2.2.8.post1 - 2023.10.20
fix
fix sftp custom port not working error
fix http retry error when upload file
2.2.8 - 2023.10.17
feat
support hdfs protocol
fix
fix
megfile configcommand when config file’s parent dir not exists
2.2.7 - 2023.10.08
fix
exit 1 when cli had error
feat
cli add
configcommandcli support
--debugparameter
2.2.6 - 2023.09.22
fix
fix s3 client cache with profile name
fix s3 error info of endpoint url in s3 open
perf
optimize concurrent SFTP connections
optimize ls command with glob path
optimize sync command
add retry error
2.2.5.post1 - 2023.09.19
fix
fix s3 error info of endpoint url
fix
s3_openwhen s3 path with custom profile namefix
SmartPathextract protocol when path is inherited fromPurePath
2.2.5 - 2023.09.15
perf
Increase
connect_timeoutconfig in s3perf http open when web api support
Accept-Rangebut not bigger than block size.add retry for more errors
fix
fix
SftpPath.partsfix s3
ProfileNotFounderror when profile_name not in the config file
2.2.4.post1 - 2023.09.04
fix
fix sftp readlink
2.2.4 - 2023.09.04
perf
perf prefetch reader
setup s3 connect timeout
fix
prevent http Range header out-of-range in http prefetch reader
2.2.3 - 2023.08.25
feat
add
forceparam in sync methods for copy file forcibleadd
-f/--forceinrefile synccheck same file in copy, and raise
SameFileError
perf
Set the timeout for SSH connections.
2.2.2 - 2023.08.18
fix
fix
s3_accesswrite permission’s check
feat
support
AWS_S3_ADDRESSING_STYLEenv for setting s3 addressing style
perf
perf some s3 api
2.2.1.post1 - 2023.08.14
fix
remove unuseful print
fix smart copy from http to local
support all s3 other config for s3 profile mode
2.2.1 - 2023.08.07
fix
fix tqdm unit divisor to
1024
feat
all open func support
encodinganderrorsparametersadd
HttpPrefetchReaderfor perf http open
2.2.0.post1 - 2023.08.03
fix
change retry log leval to info
fix
megfile headcommand error from http pathfix retry not work in prefetch_reader
fix upload and download when local file path with protocol, like
file:///data/test.txt
2.2.0 - 2023.08.01
breaking change
sftp path protocol change for supporting relative path
- new protocol:
‒ sftp://[username[:password]@]hostname[:port]//absolute_file_path ‒ sftp://[username[:password]@]hostname[:port]/relative_file_path
feat
cli
Add
megfile tocommand, can write content from stdin to a fileAdd
megfile headandmegfile tailcommand
Add http and stdio methods in
__init__.py, now you can from megfile import them
2.1.4 - 2023.07.21
feat
add
SmartCache, andsmart_cachesupport more protocol
2.1.3.post1 - 2023.07.13
fix
fix the cleanup behavior of ThreadLocal after forking
2.1.3 - 2023.07.11
feat
add
http_exists
2.1.2 - 2023.07.07
feat
synccommand with-gsupport sync files concurrentlysynccommand add-w/--workerfor concurrent worker’s count, default 8
fix
fix sftp error when mkdir concurrently
fix
sftp_downloadandsftp_upload‘scallbackparameter
2.1.1.post2 - 2023.07.07
fix
fix sftp client error when multi threads
fix
HttpPathmethod’s parameter
2.1.1.post1 - 2023.07.04
fix
fix dst_path check in SftpPath’s methods
2.1.1 - 2023.07.03
fix
fix
ls -rnot display directoriesfix
SftpPath.cwdfix sftp exec command method’s return data
2.1.0 - 2023.06.26
feat
smart_syncwill raiseIsADirectoryErrorwhen src_path is a file and dst_path is a directory
fix
fix
sftp_upload,sftp_download,sftp_copypath check, when path is not sftp or is dir, will raise errorsftp_copymakedir ifdst_path‘s dir not exist
2.0.7 - 2023.06.16
perf
retry ConnectionError in sftp retry
2.0.6.post1 - 2023.06.16
fix
fix sftp retry bug when catch EOFError
fix the bug from new
urlsplitin py3.11.4fix the path list’s order returned by fs glob, now return path list in ascending alphabetical order
2.0.6 - 2023.06.13
fix
fix sftp connect timeout after long time
perf
smart_syncand other sync methods will ignore same filessmart_syncwill raiseFileNotFounderror when src_path is not exist
2.0.5.post1 - 2023.05.11
fix
fix
SftpPath.renameerror log
2.0.5 - 2023.05.11
feat
support python 3.11
perf
cli support s3 log
fix
fix
is_dirandis_fileofSftpPathwhen file not found
2.0.4 - 2023.04.12
feat
s3 path support custom profile name, like
s3[+profile_name]://bucket/keyremove
smart-openfrom requirementssmart_syncsupportmap_funcparameter for concurrentadd
smart_concat
perf
reduce the number of
s3_open‘s requests
2.0.3 - 2023.03.22
feat
add smart_lstat
smart_scandir support ‘with’ operate
fix
fix smart_sync error when file name in dir is empty str
fix stat properties default value
fix smart_load_content when path is not fs or s3
2.0.2 - 2023.03.13
support s3 endpoint env: AWS_ENDPOINT
2.0.1 - 2023.03.01
cli
megfile lssupport glob pathmegfile cp,megfile mvandmegfile syncsupport-g,--progress-barperf err output
megfile syncsupport glob path
close ssh connection before process exit
2.0.0 - 2023.02.10
path classes align with
pathlib.Pathmethods(
glob,iglob,glob_stat,resolve,home,cwd,readlink) in all path classes return path objectmethods(
glob,iglob,glob_stat) in all path classes addpatternparameter. Functions(likesmart_glob,s3_glob) not change.relative_to‘s parameterotherin all path classes change to*otherFSPath.partsalign withpathlib.Path.parts, return valueparts[0]will not befile://any more.mkdirin all path classes add parameters(mode=0o777,parents=False), Functions(likesmart_makedirs) not change.
change
s3_symlink,S3Path.symlink,s3_rename,S3Path.renameparameter name, changesrc_url,dst_urltosrc_path,dst_pathchange
fs_stat,FSPath.stat,s3_stat,S3Path.statparameter name, changefollowlinkstofollow_symlinksFileEntryadd methodinodeStatResultadd properties(st_mode,st_ino,st_dev,st_nlink,st_uid,st_gid,st_size,st_atime,st_mtime,st_ctime,st_atime_ns,st_mtime_ns,st_ctime_ns)support sftp protocol
1.0.2 - 2022.09.22
remove
smart_getmd5_by_pathsmethodretry when catch
botocore.exceptions.ResponseStreamingErrorremove
followlinksparameter in rename, move, remove; make behavior same as standard libraryfix
smart_renamebug, when rename file cross platform or device
1.0.1 - 2022.08.04
fix open mode with + in different order
sort
smart_getmd5_by_pathsparameter paths
1.0.0 - 2022.07.25
refactor code
add
smart_getmd5_by_pathschange of symlink’s parameters position
0.1.2 - 2022.04.26
handle s3 remove file errors
support s3 symlink
0.1.1 - 2022.01.14
fix smart api bug
0.1.0 - 2022.01.14
update get_md5, s3 use etag and support dir
fix py35 test about moto
add fs symlink support
support python 3.10
0.0.11 - 2021.12.08
smart_opensupport read and write pipe
0.0.10 - 2021.11.29
add info log about environ OSS_ENDPOINT and oss config file
smart_getsizeandsmart_getmtimesupport httpupdate cli cp and mv, make them like cp and mv in linux
fix sed warning in macOS
add some test code
add error code callback to _patch_make_request
Generate cache_path automatically
0.0.9 - 2021.10.11
megfile.s3retries when server returns 500 - 503remove
megfile.lib.fakefs
0.0.8 - 2021.09.15
megfile.s3.s3_memory_opensupport ab / rb+ / wb+ / ab+ modemegfile.s3.s3_opensupport ab / rb+ / wb+ / ab+ mode (by using s3_memory_open)Speed up
s3_globAccept
s3.endpoint_urlin aws config file
0.0.7 - 2021.09.06
[Breaking] Rename
megfile.interfaces.MegfilePathLiketomegfile.interfaces.PathLikeFix ungloblize
0.0.6 - 2021.09.01
[Breaking] Rename
megfile.s3.MEGFILE_MD5_HEADERtomegfile.s3.content_md5_header[Breaking] Remove
megfile.lib.get_image_size,megfile.smart.smart_load_image_metadataandmegfile.smart.IMAGE_EXTNAMES
0.0.5 - 2021.08.31
Refactor
process_local/thread_local, remove dependency onmultiprocessing.utils.register_after_fork
0.0.4 - 2021.08.29
Speed up
s3_glob
0.0.3 - 2021.08.24
First release of
megfile