On Sat, May 1, 2021, 3:17 AM Cameron Simpson <c...@cskk.id.au> wrote:

> >Let's take a not-absurd hypothetical:
> >
> >GET [http://example.com/picture] 200 image/jpeg
> >POST [http://nowhere.org/data] 200 application/json
> >PUT [https://example.org/page] 200 text/html
>
> Though for this, they are ok. Or even just:
>
>     method, _url_, code, mimetype = line.split(None,3)
>

Notice that in my example, I agree extra square brackets that I want to get
rid of as well, which your line doesn't do. Of course an extra line or two
could. But often enough, I want to remove certain fixed substrings in lines
that don't have a uniform delimiter like a space.

There shouldn't be any whitespace in a log line URL - it should be
> percent encoded.
>

Lots of things "should be" :-). Sadly, I deal with "actually existing data."
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/EN65SJDKJ75WWM7R7M5O6JYUBO67RCFJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to