changeset 139:bb3ca6c5a037

fix and test for all-decimal host
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Sat, 30 Sep 2023 14:13:19 +0100
parents ee5d5d712176
children d8b134f6ab03
files lib/python/cc/lmh/sort_date.py lib/python/cc/lmh/test/key_tests.tsv
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lib/python/cc/lmh/sort_date.py	Sat Sep 30 14:12:39 2023 +0100
+++ b/lib/python/cc/lmh/sort_date.py	Sat Sep 30 14:13:19 2023 +0100
@@ -131,17 +131,18 @@
       #  Python surt handling of 'octal' numbers in numeric IPv4 addresses
       #  and it should!  See discussion wrt 15,225,107,143)
       #  in .../azure/notes.txt
+      #  Java also apparently doesn't decode arbitrary digit-strings as IP
       try:
         bytestrs = host.split(b'.')
         host = b'.'.join(b'%d'%int(bs) for bs in bytestrs)
       except ValueError:
         pass
       # </change>
-      ip = OGU.attemptIPFormats(host)
-      if ip:
-        host = ip;
-      else:
-        host = escapeOnce(host.lower())
+    ip = OGU.attemptIPFormats(host)
+    if ip:
+      host = ip;
+    else:
+      host = escapeOnce(host.lower())
 
     url.host = host
 
--- a/lib/python/cc/lmh/test/key_tests.tsv	Sat Sep 30 14:12:39 2023 +0100
+++ b/lib/python/cc/lmh/test/key_tests.tsv	Sat Sep 30 14:13:19 2023 +0100
@@ -12,3 +12,4 @@
 Multi PHPSESS	http://www.rudolfreisen.cz/zajezdy/lastminute-zajezdy/?lastfirstform&amp;search=http%3A%2F%2Fcomfort31.traffics-ibe.com%2Ftibet.php%3Fstp%3D4%26mop%3Dyes%26ixp%3Dpauschal%26cfg%3D0080017030000000%26vnd%3D1555063200%26bsd%3D1558864800%26tdm%3D7%26tdx%3D7%26mmc%3D1w%26typ%3DP%26fdir%3D1%26epc%3D2%26ka1%3D%26ka2%3D%26ka3%3D%26kpc%3D%26kpa%3D%26hmi%3DALLE%26stc%3D3%26zac%3D%252A%26vpc%3DAI%26dsi%3DALLE%26dsr%3D100388%26bst%3D%26vnt%3D%26refer%3D2%26tsc%3D1%26out%3Ddetail%26lng%3Dcs%26icd%3D%26enc%3DUTF-8%26tps%3Dt5%26mpo%3Dl%26sub%3Dall%26CurrencySymbol%3DEUR%26hmask%3D1%26rmask%3D1%26ntc%3D1%26region%3D100388%26verschlagw%5B%5D%3Dben%26PHPSESSID%3D98a1981a1b7b2547f61ee39e7b674f3c%26mmc%3D1w%26mpo%3Dl%26tps%3Dt5%26enc%3DUTF-8%26lng%3Dcs%26PHPSESSID%3D98a1981a1b7b2547f61ee39e7b674f3c%26gid%3D265591%26azh%3DAGA%26hsc%3Dc87229ad96ef3ad4b8b2a1b00e75c429%26PHPSESSID%3D98a1981a1b7b2547f61ee39e7b674f3c	cz,rudolfreisen)/zajezdy/lastminute-zajezdy?&amp;search=http://comfort31.traffics-ibe.com/tibet.php?stp=4&azh=aga&bsd=1558864800&bst=&cfg=0080017030000000&currencysymbol=eur&dsi=alle&dsr=100388&enc=utf-8&enc=utf-8&epc=2&fdir=1&hmask=1&hmi=alle&hsc=c87229ad96ef3ad4b8b2a1b00e75c429&icd=&ixp=pauschal&ka1=&ka2=&ka3=&kpa=&kpc=&lastfirstform&lng=cs&lng=cs&mmc=1w&mmc=1w&mop=yes&mpo=l&mpo=l&ntc=1&out=detail&phpsesgid=265591&phpsessid=98a1981a1b7b2547f61ee39e7b674f3c&refer=2&region=100388&rmask=1&stc=3&sub=all&tdm=7&tdx=7&tps=t5&tps=t5&tsc=1&typ=p&verschlagw[]=ben&vnd=1555063200&vnt=&vpc=ai&zac=*
 UTF-8 in host	https://kabarettfrühling.at/	at,xn--kabarettfrhling-8vb)/
 Escaped UTF-8 in URI	https://www.entr\u00FCmpelung-wien.at/entr%C3%BCmpelung1/entr%C3%BCmpelung	at,xn--entrmpelung-wien-mzb)/entr%c3%bcmpelung1/entr%c3%bcmpelung
+All-decimal IP host	http://02154475288/	24,175,106,128)/