<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, 12 Apr 2016 at 22:38 Michael Mysinger via Python-Dev <<a href="mailto:python-dev@python.org">python-dev@python.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ethan Furman <ethan <at> <a href="http://stoneleaf.us" rel="noreferrer" target="_blank">stoneleaf.us</a>> writes:<br>
<br>
> Do we allow bytes to be returned from os.fspath()?  If yes, then do we<br>
> allow bytes from __fspath__()?<br>
<br>
De-lurking. Especially since the ultimate goal is better interoperability, I<br>
feel like an implementation that people can play with would help guide the<br>
few remaining decisions. To help test the various options you could<br>
temporarily add a _allow_bytes=GLOBAL_CONFIG_OPTION default argument to both<br>
pathlib.__fspath__() and os.fspath(), with distinct configurable defaults for<br>
each.<br>
<br>
In the spirit of Python 3 I feel like bytes might not be needed in practice,<br>
but something like this with defaults of False will allow people to easily<br>
test all the various options.<br></blockquote><div><br></div><div><a href="https://gist.github.com/brettcannon/b3719f54715787d54a206bc011869aa1">https://gist.github.com/brettcannon/b3719f54715787d54a206bc011869aa1</a> has the four potential approaches implemented (although it doesn't follow the "separate functions" approach some are proposing and instead goes with the allow_bytes approach I originally proposed). </div></div></div>