Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Translate OS X / Windows file URLs to directory paths

Project Description

Using Linux? Tired of receiving emails with links to files of the form X:\some%20path\on\remote%20share\spreadsheet.xls? Then we can help! takes an unusable path as input and prints a useful one as output. That’s it.

It can handle Windows drive prefixes (if configured), and will also sort out file:// and smb:// prefixes.

Should work with Python 2.4 - 3.3 and pypy (probably more, but that’s as far as it’s been tested).


Install system-wide with sudo pip install or sudo easy_install This will put an executable named into your $PATH.


You need to create a config.ini file that contains the root of your network mounts and any drive mappings (see config.example.ini or the example below to get started).

By default, will check for $HOME/.config/pathfix/config.ini, so it’s best to keep your config there. If you are installing from source, you can also just keep a config.ini in the source tree next to

We assume all your network shares are mounted under a common root, with the form:

/<network mount root>/<host name>/<share name>

If you installed from source, you may find it helpful to symlink to /usr/local/bin or somewhere else on your PATH, or you can just python install and you’ll get the executable on your path.


For example, if you have this in your config.ini:

network_root = /media/network

x = host1:share1
y = host2:share2

Then you can do, for example:

% "X:\some%20path\on\remote%20share\spreadsheet.xls"
/media/network/host1/share1/some path/on/remote share/spreadsheet.xls

Which you can use in subshells to fix arguments to other applications, for example:

% libreoffice "$( "X:\some%20path\on\remote%20share\spreadsheet.xls")"


Pull requests are welcome, but please do include test cases that cover any updates.

There are no requirements unless you’re using Python 2.4-2.6, or 3.0-3.1, in which case (if you’re installing from source) you need to install argparse:

pip install -r requirements.txt

To make sure it all still works, run the tests:

python test
Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date (4.5 kB) Copy SHA256 Checksum SHA256 Source Jan 16, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting