[issue29800] functools.partial segfaults in repr when keywords attribute is abused

2017-03-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 0641ada9b78b6a06f539d4bde42c1ad1b90579a7 by Serhiy Storchaka (Michael Seifert) in branch '3.5': bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords are not strings (#649) (#672)

[issue29800] functools.partial segfaults in repr when keywords attribute is abused

2017-03-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 6c3d5274687c97f9c13800ad50e73e15b54f629d by Serhiy Storchaka (Michael Seifert) in branch 'master': bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords are not strings (#649)

[issue29800] functools.partial segfaults in repr when keywords attribute is abused

2017-03-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 53b2667dcf2a7d13af466a5fb91844f5125a920d by Serhiy Storchaka (Michael Seifert) in branch '3.6': bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords are not strings (#649) (#671)

[issue29800] functools.partial segfaults in repr when keywords attribute is abused

2017-03-17 Thread Larry Hastings
Changes by Larry Hastings : -- pull_requests: +623 ___ Python tracker ___ ___

[issue29800] functools.partial segfaults in repr when keywords attribute is abused

2017-03-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Michael! -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue29800] functools.partial segfaults in repr when keywords attribute is abused

2017-03-15 Thread Michael Seifert
Changes by Michael Seifert : -- pull_requests: +555 ___ Python tracker ___ ___

[issue29800] functools.partial segfaults in repr when keywords attribute is abused

2017-03-15 Thread Michael Seifert
Changes by Michael Seifert : -- pull_requests: +554 ___ Python tracker ___ ___

[issue29800] functools.partial segfaults in repr when keywords attribute is abused

2017-03-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you create PRs for 3.6 and 3.5 Michael? -- ___ Python tracker ___

[issue29800] functools.partial segfaults in repr when keywords attribute is abused

2017-03-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It would be nice if you provided the solution with %S. But if you don't do this, and nobody other provide other pull request, I'll merge the current solution. When the dictionary keys are changed during iteration PyDict_Next() can skip some key-value pairs

[issue29800] functools.partial segfaults in repr when keywords attribute is abused

2017-03-13 Thread Michael Seifert
Michael Seifert added the comment: Given that this my first contribution to CPython I'm not too sure about the etiquette. When do I know (or who decides) when an agreement on a fix is reached? I wouldn't mind retracting the pull request if someone else wants to fix it differently. I actually

[issue29800] functools.partial segfaults in repr when keywords attribute is abused

2017-03-13 Thread Łukasz Langa
Łukasz Langa added the comment: I'd also prefer %S instead of a hard-coded check. -- nosy: +lukasz.langa ___ Python tracker ___

[issue29800] functools.partial segfaults in repr when keywords attribute is abused

2017-03-13 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___

[issue29800] functools.partial segfaults in repr when keywords attribute is abused

2017-03-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PyUnicode_FromFormat() crashes in debug build if the argument for %U is not a unicode string. I thought about using %S. This would correspond possible Python implementation (`'%s=%r' % (key, value)`). But in that case we should increase refcounts of key

[issue29800] functools.partial segfaults in repr when keywords attribute is abused

2017-03-13 Thread Josh Rosenberg
Josh Rosenberg added the comment: I feel like adding a type check to partial_repr might not be the correct fix here. If PyUnicode_FromFormat returned NULL and set an exception here, then the existing code would work as written (raising an exception, but not segfaulting). Alternatively, if the

[issue29800] functools.partial segfaults in repr when keywords attribute is abused

2017-03-12 Thread Michael Seifert
Changes by Michael Seifert : -- pull_requests: +536 ___ Python tracker ___ ___

[issue29800] functools.partial segfaults in repr when keywords attribute is abused

2017-03-12 Thread Michael Seifert
New submission from Michael Seifert: It's possible to create a segfault when one (inappropriatly) changes the functools.partial.keywords attribute manually. A minimal example reproducing the segfault is: >>> from functools import partial >>> p = partial(int) >>> p.keywords[1] = 10 >>> repr(p)