~ubuntu-branches/ubuntu/saucy/click/saucy-proposed

« back to all changes in this revision

Viewing changes to click/hooks.py

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2013-07-30 15:14:16 UTC
  • Revision ID: package-import@ubuntu.com-20130730151416-ajoe6kqrb59kkamo
Tags: 0.2.10
* Force click's stdout encoding to UTF-8 regardless of the locale.
* Don't encode non-ASCII characters in JSON dumps.
* Treat manifests as UTF-8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
from functools import partial
30
30
import grp
 
31
import io
31
32
import json
32
33
import os
33
34
import pwd
48
49
    manifest_path = os.path.join(
49
50
        root, package, version, ".click", "info", "%s.manifest" % package)
50
51
    try:
51
 
        with open(manifest_path) as manifest:
 
52
        with io.open(manifest_path, encoding="UTF-8") as manifest:
52
53
            return json.load(manifest).get("hooks", {})
53
54
    except IOError:
54
55
        return {}