pysmbc
This page is about the Python bindings for the libsmbclient API from Samba, known as pysmbc. It was written for use with system-config-printer, but can be put to other uses as well.
I work on this module as part of my job at Red Hat.
Download
Download tarball releases from the Python Package Index:
http://pypi.python.org/pypi/pysmbc/
Download older tarball releases from:
http://cyberelk.net/tim/data/pysmbc/
Source Code
Fetch the source code like this:
git clone git://git.fedorahosted.org/git/pysmbc.git
or browse it using gitweb.
There is another git repository for pysmbc at github:
git clone http://github.com/hamano/pysmbc.git
Bug Reporting
Report bugs using the trac interface.
Discussion
Discussion about pysmbc is welcome on the system-config-printer mailing list.
Great tool, but I was not able to use it.
Wow, I’ve submitted ticket #1: https://fedorahosted.org/pysmbc/ticket/1#preview
I think I’m able to fix it myself, but I know almost nothing about libsmbclient and not sure what smbc_bool actually is.
It’s because you’re using an older version of libsmbclient than pysmbc currently supports.
Hi there,
This is a very useful tool for me, although I am experiencing a problem with version 1.0.10 – when trying to transfer certain non-utf8 files like documents and PDF files, this results in an exception. I have traced down the problem, found a fix, and submitted a ticket at Fedora – please take a look when you have the time – https://fedorahosted.org/pysmbc/ticket/3
Cheers,
Yavor
Hi,
This module looks perfect for my needs, but I’m getting build errors, because my libsmbclient.h doesn’t declare smbc_open_fn. Can you document the supported version(s) of libsbmclient ?
Thanks,
Graeme
Currently libsmbclient 3.2.x or later is required.
I’m trying this out on a DFS and seeing an error when trying to navigate to a share where SMB signing is required:
>>> ctx.stat(“smb://<>/optimus/IronHide”)
cli_negprot: SMB signing is mandatory and we have disabled it.
protocol negotiation failed
Couldn’t resolve \IronHide
It seems adding “client signing = auto” to my smb.conf file does not fix the error. I don’t see an attribute in the Context object to change. Is there a way to allow SMB Signing with pysmbc?
Thanks,
Robert
The only part of the libsmbclient interface that seems relevant is “smbc_set_credentials” which includes a parameter for “signing state” (on/off/force). Maybe I should make that function available.
I just checked in a change to add Context.set_credentials_with_fallback. The function I mentioned earlier seems to be deprecated in favour of this one, although it doesn’t have a parameter about signing state. Might be worth trying out though. Let me know if it helps.