A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2014-January/131231.html below:

[Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5

[Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5 [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5Ethan Furman ethan at stoneleaf.us
Sat Jan 11 20:54:26 CET 2014
On 01/11/2014 11:49 AM, Stephen J. Turnbull wrote:
> MRAB writes:
>
>   > > with open("outfile.pdf", "w", encoding="latin-1") as f:
>   > >      f.write(pdf)
>   > >
>   > [snip]
>   > The second example won't work because you're forgetting about the
>   > handling of line endings in text mode.
>
> Not so fast!  Forgot, yes (me too!), but not work?  Not quite:
>
>      with open("outfile.pdf", "w", encoding="latin-1", newline="") as f:
>          f.write(pdf)
>
> should do the trick.

Well, it's good that there is a work-a-round.  Are we going to have a document listing all the work-a-rounds needed to 
program a bytes-oriented style using unicode?

--
~Ethan~
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4