[issue39113] PyUnicode_AsUTF8AndSize Sometimes Segfaults With Incomplete Surrogate Pair

2019-12-20 Thread william.ayd
william.ayd added the comment: Hmm my mistake - thanks! -- ___ Python tracker <https://bugs.python.org/issue39113> ___ ___ Python-bugs-list mailing list Unsub

[issue39113] PyUnicode_AsUTF8AndSize Sometimes Segfaults With Incomplete Surrogate Pair

2019-12-20 Thread william.ayd
New submission from william.ayd : With the attached extension module, if I run the following in the REPL: >>> import libtest >>> >>> libtest.error_if_not_utf8("foo") 'foo' >>> libtest.error_if_not_utf8("\ud83d") Traceback (most recent cal

[issue35041] urllib.parse.quote safe Parameter Not Optional

2018-10-21 Thread william.ayd
william.ayd added the comment: What if we instead just raised for anything that isn't a string or a byte? The docstring for quote suggests that it should only accept str or byte objects for safe, though it doesn't enforce that: https://github.com/python/cpython/blob

[issue35041] urllib.parse.quote safe Parameter Not Optional

2018-10-21 Thread william.ayd
william.ayd added the comment: Hmm well I still personally feel that the implementation is somewhat off mores than the documentation. Specifically I think it is confusing that it accepts an empty iterable but not one containing elements. This is fine: urllib.parse.quote("/&q

[issue35041] urllib.parse.quote safe Parameter Not Optional

2018-10-21 Thread william.ayd
william.ayd added the comment: Semantics aside is it still the intended behavior that these calls should work: urllib.parse.quote("/", safe='') AND urllib.parse.quote("/", safe=[]) But that this should raise? urllib.parse.quote("/", safe=Non

[issue35041] urllib.parse.quote safe Parameter Not Optional

2018-10-21 Thread william.ayd
New submission from william.ayd : The safe parameter in urllib.parse.quote is documented as optional. However, the following will raise TypeError: 'NoneType' object is not iterable: urllib.parse.quote("/", safe=None) whereas explicitly providing an iterable will allow the function