Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixes and updates#78

Open
CristiFati wants to merge 7 commits intoActiveState:master from
CristiFati:cfati_dev00
Open

Fixes and updates #78
CristiFati wants to merge 7 commits intoActiveState:master from
CristiFati:cfati_dev00

Conversation

@CristiFati
Copy link

@CristiFati CristiFati commented Dec 3, 2021

The main one is setting functions argtypes and restype. Modern Python versions raise an exception:

Traceback (most recent call last):
 File "..\..\GitHub\CristiFati\code\recipes\Python305690円_Enumerate_printer_job\recipe-305690.py", line 194, in <module>
 prt.EnumJobs(pJob, prt.pcbNeeded)
 File "..\..\GitHub\CristiFati\code\recipes\Python305690円_Enumerate_printer_job\recipe-305690.py", line 164, in EnumJobs
 ret = ws.EnumJobsA(self.OpenPrinter(),
ctypes.ArgumentError: argument 5: <class 'OverflowError'>: int too long to convert

preventing funky Undefined Behaviors: [SO]: C function called from Python via ctypes returns incorrect value (@CristiFati's answer).

I'm not sure how some of the code worked (if it did). Still uncertain about ReadPrinter part.

There are other problems to be addressed:

  • Some harcodings (int values)
  • Error checking (via GetLastError)
  • Some structures are out of date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /