classification
Title: Fix a wrong exception type in ctypes documentation
Type: Stage: resolved
Components: Documentation Versions: Python 3.9, Python 3.8, Python 3.7, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, miss-islington, shihai1991, xiang.zhang
Priority: normal Keywords: patch

Created on 2019-07-06 04:28 by shihai1991, last changed 2019-07-07 16:03 by xiang.zhang. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 14615 merged shihai1991, 2019-07-06 04:29
PR 14635 merged miss-islington, 2019-07-07 15:40
PR 14636 merged miss-islington, 2019-07-07 15:40
PR 14637 merged miss-islington, 2019-07-07 15:50
Messages (7)
msg347419 - (view) Author: hai shi (shihai1991) * Date: 2019-07-06 04:28
Python 3.9.0a0 (heads/master-dirty:80097e0, Jul  6 2019, 02:14:54)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
>>> class POINT(Structure):
...     _fields_ = [("x", c_int),
...                 ("y", c_int)]
...
>>> POINT(1, 2, 3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: too many initializers

and the init function in:
https://github.com/python/cpython/blob/master/Modules/_ctypes/_ctypes.c#L4335
msg347420 - (view) Author: hai shi (shihai1991) * Date: 2019-07-06 04:34
or the value error replace type error in struct_init().
msg347471 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2019-07-07 15:34
Should be TypeError. It's changed from ValueError to TypeError in https://bugs.python.org/issue1831.
msg347472 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2019-07-07 15:40
New changeset f6cdd3ff687ebbf8209d793a18a042ea495c4aeb by Xiang Zhang (Hai Shi) in branch 'master':
bpo-37513: Change ValueError to TypeError in an example in ctypes doc (GH-14615)
https://github.com/python/cpython/commit/f6cdd3ff687ebbf8209d793a18a042ea495c4aeb
msg347473 - (view) Author: miss-islington (miss-islington) Date: 2019-07-07 15:46
New changeset bc0a6ced30267d4e21e7566bfd6d14b30d6d1604 by Miss Islington (bot) in branch '3.7':
bpo-37513: Change ValueError to TypeError in an example in ctypes doc (GH-14615)
https://github.com/python/cpython/commit/bc0a6ced30267d4e21e7566bfd6d14b30d6d1604
msg347474 - (view) Author: miss-islington (miss-islington) Date: 2019-07-07 15:46
New changeset 3f7d0c9665ca546bb0073376cb83e31dd13b48d9 by Miss Islington (bot) in branch '3.8':
bpo-37513: Change ValueError to TypeError in an example in ctypes doc (GH-14615)
https://github.com/python/cpython/commit/3f7d0c9665ca546bb0073376cb83e31dd13b48d9
msg347476 - (view) Author: miss-islington (miss-islington) Date: 2019-07-07 15:59
New changeset 00bf4d64ecb01027be40c32d822e47e55d6b5c76 by Miss Islington (bot) in branch '2.7':
bpo-37513: Change ValueError to TypeError in an example in ctypes doc (GH-14615)
https://github.com/python/cpython/commit/00bf4d64ecb01027be40c32d822e47e55d6b5c76
History
Date User Action Args
2019-07-07 16:03:08xiang.zhangsetstatus: open -> closed
title: Fix a type error in ctypes.rst -> Fix a wrong exception type in ctypes documentation
stage: patch review -> resolved
resolution: fixed
versions: + Python 2.7, Python 3.7, Python 3.8, Python 3.9
2019-07-07 15:59:17miss-islingtonsetmessages: + msg347476
2019-07-07 15:50:00miss-islingtonsetpull_requests: + pull_request14451
2019-07-07 15:46:49miss-islingtonsetmessages: + msg347474
2019-07-07 15:46:05miss-islingtonsetnosy: + miss-islington
messages: + msg347473
2019-07-07 15:40:30xiang.zhangsetmessages: + msg347472
2019-07-07 15:40:29miss-islingtonsetpull_requests: + pull_request14450
2019-07-07 15:40:22miss-islingtonsetpull_requests: + pull_request14449
2019-07-07 15:34:20xiang.zhangsetnosy: + xiang.zhang
messages: + msg347471
2019-07-06 04:34:29shihai1991setmessages: + msg347420
2019-07-06 04:29:45shihai1991setkeywords: + patch
stage: patch review
pull_requests: + pull_request14429
2019-07-06 04:28:06shihai1991create