/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/i18n.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-02-03 23:21:15 UTC
  • mfrom: (7290.42.6 paramiko-compat)
  • Revision ID: breezy.the.bot@gmail.com-20200203232115-g7k11bhsfeiqcprv
Fix compatibility with newer versions of paramiko, which break on noise before keys in pem files.

Merged from https://code.launchpad.net/~jelmer/brz/paramiko-compat/+merge/378480

Show diffs side-by-side

added added

removed removed

Lines of Context:
141
141
 
142
142
    :param base: plugins can specify their own local directory
143
143
    """
 
144
    if sys.version_info > (3,):
 
145
        decode_path = str
 
146
    else:
 
147
        fs_enc = sys.getfilesystemencoding()
 
148
 
 
149
        def decode_path(path):
 
150
            return path.decode(fs_enc)
144
151
    if getattr(sys, 'frozen', False):
145
152
        if base is None:
146
 
            base = os.path.dirname(sys.executable)
 
153
            base = os.path.dirname(decode_path(sys.executable))
147
154
        return os.path.join(base, u'locale')
148
155
    else:
149
156
        if base is None:
150
 
            base = os.path.dirname(__file__)
 
157
            base = os.path.dirname(decode_path(__file__))
151
158
        dirpath = os.path.realpath(os.path.join(base, u'locale'))
152
159
        if os.path.exists(dirpath):
153
160
            return dirpath
154
 
    return os.path.join(sys.prefix, u"share", u"locale")
 
161
    return os.path.join(decode_path(sys.prefix), u"share", u"locale")
155
162
 
156
163
 
157
164
def _check_win32_locale():