For this initial testing, I'm running Django directly.  In production it
will be run behind Apache/mod_wsgi.

Setting sys.coinit_flags = 0 fixes the hang when running Django from a
simple command line.  This confirms to me that the issue is
thread-related.  What I'm seeing now is that the hang still occurs when
running under the PyCharm debugger, but functions correctly in all other
cases (run directly, run under Apache/mod_wsgi).

It's no longer a blocking issue for me, but it would still be nice to
understand root cause and if anything can be done (in my code or in
PyCharm) to make the debugger function correctly.  If you guys have any
ideas on how to further debug or collect information on what might be
hanging, that'd be greatly appreciated.

Scott Vitale
Founder & CEO
720.288.6336
@svvitale <https://twitter.com/svvitale>

<http://spigotlabs.com>

Learn about my perspectives on development, business, and my personal quest
to shake up the #eventtech world on Medium <https://bit.ly/svvitale-medium>

On Sun, Mar 25, 2018 at 4:00 PM, <[email protected]> wrote:

> Send python-win32 mailing list submissions to
>         [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mail.python.org/mailman/listinfo/python-win32
> or, via email, send a message with subject or body 'help' to
>         [email protected]
>
> You can reach the person managing the list at
>         [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of python-win32 digest..."
>
>
> Today's Topics:
>
>    1. Re: win32com + Brother Printer + Django (Tim Roberts)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 24 Mar 2018 23:23:43 -0700
> From: Tim Roberts <[email protected]>
> To: Python-Win32 List <[email protected]>
> Subject: Re: [python-win32] win32com + Brother Printer + Django
> Message-ID: <[email protected]>
> Content-Type: text/plain;       charset=utf-8
>
> On Mar 23, 2018, at 9:44 AM, Scott Vitale <[email protected]> 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, [email protected]
> Providenza & Boekelheide, Inc.
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> python-win32 mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/python-win32
>
>
> ------------------------------
>
> End of python-win32 Digest, Vol 179, Issue 11
> *********************************************
>

ᐧ
_______________________________________________
python-win32 mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to