maxlath / wikibase-cli

read and edit a Wikibase instance from the command line
MIT License
227 stars 24 forks source link

wd open --wikipedia silently failing #160

Closed tmtmtmtm closed 2 years ago

tmtmtmtm commented 2 years ago

Since upgrading to macOS 11.6, wd open -p has been silently failing in most cases.

Checking with -u shows that the URL being generated contains spaces, and is presumably therefore being rejected as invalid:

> wd o -p Q6279 -u                                
https://en.wikipedia.org/wiki/Joe Biden

(And, indeed, wd o -p Q1744 works)

maxlath commented 2 years ago

in v15.16.9, you should now get the following:

wd o -p Q6279 -u
# https://en.wikipedia.org/wiki/Joe_Biden

Also, in anticipation of possible non-ascii/special characters encoding problems, those characters are now URL encoded:

wd o -p Q1541914 -l ar -u
# https://ar.wikipedia.org/wiki/%D8%AD%D9%83%D8%A7%D9%8A%D8%A9_%D8%A7%D9%84%D8%A3%D9%85%D8%A9_%28%D8%B1%D9%88%D8%A7%D9%8A%D8%A9%29
tmtmtmtm commented 2 years ago

That did the trick. Thanks for the quick fix!