[python-win32] why do I get error 1804 from win32print.SetJob?

Tim Roberts timr at probo.com
Tue Nov 20 13:49:26 EST 2018


Glenn Linderman wrote:
> Of course, the GetJob is decoding the structure properly... but its 
> PyBuildValue parameter strings are much more complex than the 
> PyArg_ParseTupleAndKewyords parameter strings, and there is mention of 
> TCHAR in the JobToPy, but not in the PyToJob, so that makes it further 
> seem like my speculations above might have some chance of being the 
> problem.

I should not have scoffed at your speculation, because your analysis was 
correct.  The win32print code is calling SetJobW, which expects Unicode, 
but the JOB_INFO_1 structure is filled with ANSI strings.  That's a very 
nasty bug.  I'll file a bug report.

In the meantime, I'll fix up my little C++ example to do the job for you.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3980 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-win32/attachments/20181120/713ef520/attachment-0001.bin>


More information about the python-win32 mailing list