/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/mail_client.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-07-28 02:47:10 UTC
  • mfrom: (7519.1.1 merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200728024710-a2ylds219f1lsl62
Merge lp:brz/3.1.

Merged from https://code.launchpad.net/~jelmer/brz/merge-3.1/+merge/388173

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
 
 
19
17
import errno
20
18
import os
21
19
import subprocess
32
30
    urlutils,
33
31
    registry,
34
32
    )
35
 
from .sixish import (
36
 
    PY3,
37
 
    text_type,
38
 
    )
39
33
 
40
34
mail_client_registry = registry.Registry()
41
35
 
235
229
        :param  u:  possible unicode string.
236
230
        :return:    encoded string if u is unicode, u itself otherwise.
237
231
        """
238
 
        if not PY3 and isinstance(u, text_type):
239
 
            return u.encode(osutils.get_user_encoding(), 'replace')
240
232
        return u
241
233
 
242
234
    def _encode_path(self, path, kind):
248
240
                        path itself otherwise.
249
241
        :raise:         UnableEncodePath.
250
242
        """
251
 
        if not PY3 and isinstance(path, text_type):
252
 
            try:
253
 
                return path.encode(osutils.get_user_encoding())
254
 
            except UnicodeEncodeError:
255
 
                raise errors.UnableEncodePath(path, kind)
256
243
        return path
257
244
 
258
245