This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2015年04月13日 02:44 by larry, last changed 2022年04月11日 14:58 by admin.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| skipitems.patch | llllllllll, 2015年04月13日 22:43 | review | ||
| skipitems.patch | llllllllll, 2015年07月15日 22:26 | review | ||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 8204 | open | llllllllll, 2018年07月09日 16:05 | |
| Messages (8) | |||
|---|---|---|---|
| msg240587 - (view) | Author: Larry Hastings (larry) * (Python committer) | Date: 2015年04月13日 02:44 | |
tl;dr: skipitem() in Python 3 still supports "w" and "w#", which were abandoned. They should be removed. -- If: * you have an extension that parses its arguments with PyArg_ParseTupleAndKeywords (or its cousins), * you have optional positional parameters, and * you run out of positional arguments CPython will call skipitem() to skip over the remaining positional parameters so it can process keyword arguments. It does this by knowing all the format units, and iterating over them and throwing away the various varargs pointers until it hits the keyword arguments part of the format string. PyArg_ParseTuple() etc. in Python 2 supported "w" and "w#" for parsing "objects with the read-write buffer interface". These were removed in Python 3. skipitem() in Python 3 still supports both skipping "w" and "w#". But in fact the only legal format unit starting with a 'w' in Python 3 is 'w*'. So a function with a 'w*' as an optional parameter that got skipped would be misinterpreted; skipitem would see the 'w', not recognize the following '*' and leave it there, then the next function that read a character from the format string (either skipitem() or convertsimple()) would see the '*' and throw an "impossible <bad format char>" exception. |
|||
| msg240794 - (view) | Author: Joe Jevnik (llllllllll) * | Date: 2015年04月13日 22:43 | |
here is a patch and test case. I added an entry to Misc/NEWS. I tried to follow the format; however, let me know if I have done this incorrectly. |
|||
| msg246780 - (view) | Author: Joe Jevnik (llllllllll) * | Date: 2015年07月15日 22:26 | |
Sorry it took so long to get back to this. I didn't realize this was still open. I have provided the update to the docs and moved it to the 3.6 section. I also made sure the patch still applies and the tests all pass. |
|||
| msg247383 - (view) | Author: Joe Jevnik (llllllllll) * | Date: 2015年07月25日 19:36 | |
bumping so that we don't forget about this. |
|||
| msg253226 - (view) | Author: Joe Jevnik (llllllllll) * | Date: 2015年10月20日 15:52 | |
bumping this issue |
|||
| msg263709 - (view) | Author: Joe Jevnik (llllllllll) * | Date: 2016年04月19日 05:20 | |
bump |
|||
| msg263776 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2016年04月19日 21:36 | |
I reviewed skipitems.patch. |
|||
| msg321300 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2018年07月09日 06:38 | |
Do you mind to convert your patch into a pull request Joe? |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:15 | admin | set | github: 68114 |
| 2018年07月09日 16:05:58 | llllllllll | set | pull_requests: + pull_request7754 |
| 2018年07月09日 06:39:12 | serhiy.storchaka | set | components:
+ Interpreter Core versions: + Python 3.7, Python 3.8, - Python 3.5 |
| 2018年07月09日 06:38:38 | serhiy.storchaka | set | messages: + msg321300 |
| 2016年04月19日 21:36:52 | vstinner | set | nosy:
+ vstinner messages: + msg263776 |
| 2016年04月19日 05:54:10 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka versions: - Python 3.4 |
| 2016年04月19日 05:20:46 | llllllllll | set | messages: + msg263709 |
| 2015年10月20日 16:02:47 | berker.peksag | set | stage: test needed -> patch review type: crash -> behavior versions: + Python 3.6 |
| 2015年10月20日 15:52:11 | llllllllll | set | messages: + msg253226 |
| 2015年07月25日 19:36:41 | llllllllll | set | messages: + msg247383 |
| 2015年07月15日 22:26:53 | llllllllll | set | files:
+ skipitems.patch messages: + msg246780 |
| 2015年04月13日 22:43:33 | llllllllll | set | files:
+ skipitems.patch nosy: + llllllllll messages: + msg240794 keywords: + patch |
| 2015年04月13日 02:44:00 | larry | create | |