Issue13938
Created on 2012-02-04 05:31 by mhammond, last changed 2015-07-22 19:43 by rbcollins. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| fix_stringtypes_fixer.patch | mhammond, 2012-02-04 05:31 | fix and test | review | |
| Messages (9) | |||
|---|---|---|---|
| msg152592 - (view) | Author: Mark Hammond (mhammond) * | Date: 2012-02-04 05:31 | |
test_types.py converts "types.StringTypes" to "str" - but types.StringTypes is a tuple, so expressions like "type(x) in type.StringTypes" fails after conversion with "TypeError: argument of type 'type' is not iterable" Attaching a fix and test. Note that the fixer still seems "strange" after this fix - types.StringType gets converted to "bytes" but types.StringTypes uses str. This means the expression "type.StringType in type.StringTypes" evaluates to True in 2.x but False once converted - however, that should probably be tackled in a different bug - the fact the expression now causes a TypeError once converted is more blatantly wrong and the focus of this bug. |
|||
| msg222130 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2014-07-02 21:29 | |
A short patch LGTM. Can we have a commit review please. |
|||
| msg247140 - (view) | Author: Roundup Robot (python-dev) | Date: 2015-07-22 18:19 | |
New changeset b97b6cc381d7 by Robert Collins in branch 'default': Issue #13938: 2to3 converts StringTypes to a tuple. Patch from Mark Hammond. https://hg.python.org/cpython/rev/b97b6cc381d7 |
|||
| msg247141 - (view) | Author: Robert Collins (rbcollins) * | Date: 2015-07-22 18:19 | |
I've applied this to 3.6. |
|||
| msg247142 - (view) | Author: R. David Murray (r.david.murray) * | Date: 2015-07-22 18:26 | |
Looking at the audit log its not clear to me which versions Benjamin wanted this applied to, though it looks like 2.7 at least. |
|||
| msg247144 - (view) | Author: Robert Collins (rbcollins) * | Date: 2015-07-22 18:42 | |
Not clear to me either: I figured that after three years the relevance to 2.7 was pretty low, but I can transplant it if you think thats relevant. |
|||
| msg247146 - (view) | Author: R. David Murray (r.david.murray) * | Date: 2015-07-22 18:55 | |
Well, it's a patch to 2to3, which I'm assuming is sometimes (often?) run using 2.7 to convert code to run under python3. I personally don't use transplant in cases like this, I just apply the patch independently to the 2.7 branch. That may just be because I've never used transplant, but we are treating the two branches as independent and I don't want to screw that up :) |
|||
| msg247147 - (view) | Author: Robert Collins (rbcollins) * | Date: 2015-07-22 19:05 | |
So, I don't think I've ever done 2.x stuff with hg here, I'll leave this open till I've looked up the docs and applied it safely. ... unless you'd like to do the 2.7 application ? :) |
|||
| msg247149 - (view) | Author: Roundup Robot (python-dev) | Date: 2015-07-22 19:42 | |
New changeset ce34c78ebf65 by Robert Collins in branch '2.7': Issue #13938: 2to3 converts StringTypes to a tuple. Patch from Mark Hammond. https://hg.python.org/cpython/rev/ce34c78ebf65 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2015-07-22 19:43:16 | rbcollins | set | status: open -> closed resolution: fixed stage: commit review -> resolved |
| 2015-07-22 19:42:01 | python-dev | set | messages: + msg247149 |
| 2015-07-22 19:05:03 | rbcollins | set | messages: + msg247147 |
| 2015-07-22 18:55:34 | r.david.murray | set | messages: + msg247146 |
| 2015-07-22 18:42:21 | rbcollins | set | messages: + msg247144 |
| 2015-07-22 18:26:25 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg247142 |
| 2015-07-22 18:19:46 | rbcollins | set | nosy:
+ rbcollins messages: + msg247141 |
| 2015-07-22 18:19:27 | python-dev | set | nosy:
+ python-dev messages: + msg247140 |
| 2014-08-22 09:32:11 | Claudiu.Popa | set | type: enhancement stage: commit review |
| 2014-07-02 21:29:15 | BreamoreBoy | set | nosy:
+ BreamoreBoy messages:
+ msg222130 |
| 2012-02-16 05:10:02 | meador.inge | set | nosy:
+ meador.inge |
| 2012-02-06 15:50:21 | eric.araujo | set | assignee: benjamin.peterson nosy:
+ benjamin.peterson |
| 2012-02-04 05:31:32 | mhammond | create | |