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

Document recent copyfile change and bump version #187

Merged
merged 2 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.9.1 - TBD

* Allow `smbclient.copyfile` to copy files on the same server and not just the same share

## 1.9.0 - 2022-02-01

* Fix connection cache reuse for some DFS referral requests
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def abs_path(rel_path):

setup(
name='smbprotocol',
version='1.9.0',
version='1.9.1',
packages=['smbclient', 'smbprotocol'],
install_requires=[
'cryptography>=2.0',
Expand Down
4 changes: 2 additions & 2 deletions smbclient/_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ def is_remote_path(path): # type: (str) -> bool

def copyfile(src, dst, **kwargs):
"""
Copy a file to a different location on the same server share. This will fail if the src and dst paths are to a
different server. This will replace the file at dst if it already exists.
Copy a file to a different location on the same server. This will fail if the src and dst paths are to a different
server. This will replace the file at dst if it already exists.

This is not normally part of the builtin os package but because it relies on some SMB IOCTL commands it is useful
to expose here.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_smbclient_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_delete_session(smb_share):


def test_copy_across_paths_raises(smb_share):
expected = "Cannot copy a file to a different root than the src."
expected = "Cannot copy a file to a different host than the src."
with pytest.raises(ValueError, match=re.escape(expected)):
smbclient.copyfile("%s\\file" % smb_share, "//host/filer2/file2")

Expand Down