[python-win32] win32com + Brother Printer + Django

Tim Roberts timr at probo.com
Sun Mar 25 02:23:43 EDT 2018


On Mar 23, 2018, at 9:44 AM, Scott Vitale <scott at spigotlabs.com> wrote:
> 
> I'm looking for some win32com help... I have a simple Python script that creates a `Dispatch` object for a `bpac.Document` type (it's a Brother printer SDK class).  It works perfectly fine in a standalong script, but as soon as I attempt to call this code from Django, it hangs on creating the `Dispatch` object....so bizarre.
> 
> I've tried calling `CoInitialize` in a variety of ways, no difference in behavior.
> 
> The other oddity is that I can create `bpac.Printer` objects with no issue.  It's only the `bpac.Document` type that hangs.  Unfortunately I don't have access to the library source and I'm not sure how to debug why it's hanging.

How are you running your Django app?  Is it running as a service?  Is it networked, or directly connected?  Microsoft does not recommend printing from Windows services, in parts because of security considerations.  Your service is running as a special Windows user (unless you've configured it), and that special user needs permissions to use the printer.
— 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list