Skip to content

Commit

Permalink
Updated links
Browse files Browse the repository at this point in the history
  • Loading branch information
yasoob committed Aug 17, 2015
1 parent 7230e80 commit 7954a08
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions open_function.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ read was successful. If there is any error just after ``f = open(...)``,
``f.close()`` will not be called (depending on the Python interpreter,
the file handle may still be returned, but that's another story). To
make sure that the file gets closed whether an exception occurs or not,
pack it into a
```with`` <http://freepythontips.wordpress.com/2013/07/28/the-with-statement/>`__
statement:
pack it into a ```with`` statement:

.. code:: python
Expand Down Expand Up @@ -64,7 +62,7 @@ computer, all files are just bytes, not characters.

Unfortunately, ``open`` does not allow explicit encoding specification
in Python 2.x. However, the function
```io.open`` <http://docs.python.org/2/library/io.html#io.open>`__ is
`io.open <http://docs.python.org/2/library/io.html#io.open>`__ is
available in both Python 2.x and 3.x (where it is an alias of ``open``),
and does the right thing. You can pass in the encoding with the
``encoding`` keyword. If you don't pass in any encoding, a system- (and
Expand Down

0 comments on commit 7954a08

Please sign in to comment.