[issue19094] urljoin should raise a TypeError if URL is not a string

2021-06-11 Thread Jacob Walls
Change by Jacob Walls : -- pull_requests: +25276 pull_request: https://github.com/python/cpython/pull/26687 ___ Python tracker ___

[issue19094] urljoin should raise a TypeError if URL is not a string

2021-06-11 Thread Irit Katriel
Change by Irit Katriel : -- versions: +Python 3.11 -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue19094] urljoin should raise a TypeError if URL is not a string

2021-06-10 Thread Jacob Walls
Jacob Walls added the comment: Hi vajrasky, do you have any interest in converting your patch to a GitHub PR? If not I can see about doing so myself. Cheers. -- nosy: +jacobtylerwalls ___ Python tracker

[issue19094] urljoin should raise a TypeError if URL is not a string

2021-02-12 Thread Irit Katriel
Irit Katriel added the comment: Still broken in 3.10: Running Release|x64 interpreter... Python 3.10.0a5+ (heads/master:bf2e7e55d7, Feb 11 2021, 23:09:25) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import urllib.parse >>>

[issue19094] urljoin should raise a TypeError if URL is not a string

2014-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: About acceptable behavior with wrong arguments types see discussions in issue22766 and http://comments.gmane.org/gmane.comp.python.devel/150073 . -- nosy: +serhiy.storchaka versions: +Python 3.5 -Python 3.3 ___

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-10-01 Thread Vajrasky Kok
Vajrasky Kok added the comment: Okay, attached the patch based on your comment, Senthil Kumaran. Thanks. The reason I use isinstance to check the type is because I want to support the inheritance as much as possible. class new_str(str): ... pass urljoin(new_str('http://python.org') +

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-10-01 Thread Jason R. Coombs
Jason R. Coombs added the comment: Vajrasky, you're right. Comparing against type(obj) is an anti-pattern. isinstance is better. Duck typing is even better (in many cases). -- ___ Python tracker rep...@bugs.python.org

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-30 Thread Senthil Kumaran
Senthil Kumaran added the comment: I have provided my comments in the review tool. Please check them out. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19094 ___

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-28 Thread Vajrasky Kok
Vajrasky Kok added the comment: I modified the patch to handle the last case using your way as well. Anyway, I found out that urlsplit and urlparse got the same issue as well. urlparse('python.org', b'http://') Traceback (most recent call last): File stdin, line 1, in module File

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-28 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- nosy: +orsenthil stage: - patch review type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19094 ___

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-27 Thread Jason R. Coombs
Jason R. Coombs added the comment: I don't mind the AttributeError - that's a reasonable exception when passing invalid types in, and that's in fact the current behavior. The example of (['a'], []) does bother me though. Those inputs are also seemingly invalid, though somewhat more compatible

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-26 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19094 ___ ___

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: This is the preliminary patch to raise TypeError in that situation. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file31876/urljoin_throws_type_error.patch ___ Python tracker

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-26 Thread Jason R. Coombs
Jason R. Coombs added the comment: Thanks Vajraski for the patch (especially the tests). A colleague reminded me of an aphorism by Raymond Hettinger from the recent PyCon paraphrased: duck typing is superior to isinstance. Maybe instead consider something like this: diff -r 7f13d5ecf71f

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: What about this one? urljoin(['a'], []) ['a'] urljoin(['a'], ['b']) . omitted .. AttributeError: 'list' object has no attribute 'decode' Is this desirable? Both patches missed this case. Should we only accept str and bytes? --

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-25 Thread Jason R. Coombs
New submission from Jason R. Coombs: import urllib.parse urllib.parse.urljoin('foo', []) 'foo' That should raise a TypeError, not succeed quietly as if an empty string were passed. -- components: Library (Lib) messages: 198418 nosy: jason.coombs priority: normal severity: normal