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/2005-June/054491.html below:

[Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

[Python-Dev] Adding the 'path' module (was Re: Some RFE for review) [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)Neil Hodgson nyamatongwe at gmail.com
Tue Jun 28 03:19:45 CEST 2005
Andrew Durdin:

> While we'ew discussing outstanding issues: In a related discussion of
> the path module on c.l.py, Thomas Heller pointed out that the path
> module doesn't correctly handle unicode paths:
> ...

   Here is a patch that avoids failure when paths can not be
represented in a single 8 bit encoding. It adds a _cwd variable in the
initialisation and then calls this rather than os.getcwd. I sent the
patch to Jason as well.

_base = str
_cwd = os.getcwd
try:
   if os.path.supports_unicode_filenames:
       _base = unicode
       _cwd = os.getcwdu
except AttributeError:
   pass

#...

   def getcwd():
       """ Return the current working directory as a path object. """
       return path(_cwd())

   Neil
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