RoySmith created this task.
RoySmith added projects: Pywikibot, Pywikibot-tests.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  **Steps to replicate the issue** (include links if applicable):
  
  - checkout pywikibot/core.git to 77482f4bab1822c7b604f7d1a4787ad2742ec991 
<https://phabricator.wikimedia.org/rPWBC77482f4bab1822c7b604f7d1a4787ad2742ec991>
  - pytest tests/http_tests.py::TestHttpStatus::test_follow_redirects
  
  **What happens?**:
  Different results on different platforms.
  
  On MacOS 12.6.1, Python 3.9.13:
  
    E       AssertionError: '//en.wikipedia.org/wiki/Main_Page' not found in 
'https://en.wikipedia.org/wiki/Main%20Page'
  
  On debian 11.7 (bullseye), Python 3.9.2, the test passes.
  
  On both platforms, running curl manually on the command line shows a two-step 
redirect:
  
    http://en.wikipedia.org/wiki/Main%20Page -> 
https://en.wikipedia.org/wiki/Main%20Page
    https://en.wikipedia.org/wiki/Main%20Page -> 
https://en.wikipedia.org/wiki/Main_Page
  
  If I run this on MacOS:
  
    r = requests.get('http://en.wikipedia.org/wiki/Main%20Page')
    print(len(r.history))
    print(r.url)
  
  it prints what I would expect:
  
    2
    https://en.wikipedia.org/wiki/Main_Page
  
  but single-stepping through the test code in the debugger, after:
  
    response = session.request(method, uri,
                               headers=headers, auth=auth, timeout=timeout,
                               **kwargs)
  
  in pywikibot/comms/http.py, I get:
  
    len(response.history)
    1
    response.url
    'https://en.wikipedia.org/wiki/Main%20Page'
  
  Unclear at this point why it's not doing the 2nd redirect.  I'll keep digging.

TASK DETAIL
  https://phabricator.wikimedia.org/T336610

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: RoySmith
Cc: Aklapper, pywikibot-bugs-list, RoySmith, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Framawiki, Mdupont, JJMC89, Dvorapa, Altostratus, binbot, Avicennasis, 
mys_721tx, Xqt, jayvdb, Masti, Alchimista
_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to