[issue36372] Flawed handling of URL redirect

2019-03-19 Thread Brrr Grrr
New submission from Brrr Grrr : I'm unable to use `urlopen` to open 'https://www.annemergmed.com/article/S0196-0644(99)70271-4/abstract' with Python 3.7. I believe this to be flawed URL redirection, possibly due to flawed URL parsing. ```python from sys import version

[issue36372] Flawed handling of URL redirect

2019-03-19 Thread Brrr Grrr
Brrr Grrr added the comment: Please note that the `requests` package, for example, has no trouble reading this URL. I don't want to use that package for this task for certain other reasons though. ```python >>> import requests >>> requests.__version__ '2.2

[issue36372] Flawed handling of URL redirect

2019-03-19 Thread Brrr Grrr
Brrr Grrr added the comment: This error is not due to cookies either. I tried `HTTPCookieProcessor` with no luck. Cookies help with opening certain other URLs but evidently not with this one. -- ___ Python tracker <https://bugs.python.

[issue36372] Flawed handling of URL redirect

2019-03-19 Thread Brrr Grrr
Brrr Grrr added the comment: That's not to say that cookies are not needed for this URL. They may very well be needed using HTTPCookieProcessor. I'm saying that cookies alone won't solve this issue. -- ___ Python tracker <https

[issue36372] Flawed handling of URL redirect

2019-03-19 Thread Brrr Grrr
Brrr Grrr added the comment: I now used a custom HTTPRedirectHandler with `max_redirections = 20`. The default is 10. This workaround addresses the issue, although it doesn't rule out a cleaner fix. -- ___ Python tracker <https://bugs.py