Skip to content

Commit

Permalink
gh-107600: Docs: Update ctypes.ArgumentError error message (#107601)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasr8 authored Aug 4, 2023
1 parent 19f32b2 commit 09a8cc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ from within *IDLE* or *PythonWin*::
>>> printf(b"%f bottles of beer\n", 42.5)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ArgumentError: argument 2: TypeError: Don't know how to convert parameter 2
ctypes.ArgumentError: argument 2: TypeError: Don't know how to convert parameter 2
>>>

As has been mentioned before, all Python types except integers, strings, and
Expand Down Expand Up @@ -444,7 +444,7 @@ prototype for a C function), and tries to convert the arguments to valid types::
>>> printf(b"%d %d %d", 1, 2, 3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ArgumentError: argument 2: TypeError: wrong type
ctypes.ArgumentError: argument 2: TypeError: 'int' object cannot be interpreted as ctypes.c_char_p
>>> printf(b"%s %d %f\n", b"X", 2, 3)
X 2 3.000000
13
Expand Down

0 comments on commit 09a8cc7

Please sign in to comment.