This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ikelos
Recipients barneygale, eryksun, ikelos
Date 2022-02-05.23:32:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1644103976.22.0.699686735662.issue46654@roundup.psfhosted.org>
In-reply-to
Content
> Why are you adding `.as_uri()`?

The API we provide accepts URIs, so whilst the example seems a little contrived, the code itself expects a URI and then calls open (making use of the ability to add open handlers).

> Builtin open() calls C open().

As best I can tell the file handler is defined in urllib/request.py as file_open.  This appears to do some preprocessing to remove the file scheme and (and explicitly throws an exception if there's a host that isn't localhost) before it gets to the C open().  I wondered why it didn't check if it was on windows and, if so, construct an appropriate path (since quadruple hash I don't think adheres to the URI RFC, but seems to open correctly)?
History
Date User Action Args
2022-02-05 23:32:56ikelossetrecipients: + ikelos, eryksun, barneygale
2022-02-05 23:32:56ikelossetmessageid: <1644103976.22.0.699686735662.issue46654@roundup.psfhosted.org>
2022-02-05 23:32:56ikeloslinkissue46654 messages
2022-02-05 23:32:56ikeloscreate