pathlib includes classes for managing filesystem paths formatted using either the POSIX standard or Microsoft Windows syntax. It includes so called “pure” classes, which operate on strings but do not interact with an actual filesystem, and “concrete” classes, which extend the API to include operations that reflect or modify data on the local filesystem.
Read more…
This post is part of the Python Module of the Week series for Python 3.
The codecs module provides stream and file interfaces for transcoding data. It is most commonly used to work with Unicode text, but other encodings are also available for other purposes.
Read more…
This post is part of the Python Module of the Week series for Python 3. See PyMOTW.com for more articles from the series.
What’s new in 4.0.1? use the right method to emit warnings (Fixes #5) Fixes #1 — disable smart quotes so that we can recognize contractions/posessives correctly (contributed by Alex Gaynor)
What’s new in 4.0.0? Don’t fail by default (contributed by Stephen Finucane) Mark the extension as safe for parallel reading (contributed by Alex Gaynor) be more verbose about configuration options switch to testrepository for running tests update python 3.3 to 3.5
My book, The Python 3 Standard Library by Example, is the InformIT.com eBook Deal of the Week this week. Save $20 off the list price by purchasing directly from the publisher at http://informit.com/deals before 14 October.
The linecache module is used within other parts of the Python standard library when dealing with Python source files. The implementation of the cache holds the contents of files, parsed into separate lines, in memory. The API returns the requested line(s) by indexing into a list , and saves time over repeatedly reading the file and parsing lines to find the one desired. This is especially useful when looking for multiple lines from the same file, such as when producing a traceback for an error report.
New Features Add support for redirect responses that indicate that a path is not going to be valid again in the future and return a 410 response.
Add detection of redirection cycles or loops. If a path redirects back to itself when all of the rules are evaluated, report it as an error.
Add detection of multiple redirection hops. If a path redirects to another path that also redirects, repeatedly for too many steps, report an error.