~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mail_client.py

  • Committer: Alexander Belchenko
  • Date: 2008-02-26 10:14:52 UTC
  • mto: This revision was merged to the branch mainline in revision 3267.
  • Revision ID: bialix@ukr.net-20080226101452-a4l4pxn4s9ge2z3w
bzr send @ win32: ensure that command line to invoking Thunderbird is 8-bit string, not unicode (because subprocess does not understand non-ascii unicode)

Show diffs side-by-side

added added

removed removed

Lines of Context:
145
145
        """
146
146
        for name in self._get_client_commands():
147
147
            cmdline = [name]
 
148
            if sys.platform == 'win32':
 
149
                user_encoding = osutils.get_user_encoding()
 
150
                if to:
 
151
                    to = to.encode(user_encoding, 'replace')
 
152
                if subject:
 
153
                    subject = subject.encode(user_encoding, 'replace')
148
154
            cmdline.extend(self._get_compose_commandline(to, subject,
149
155
                                                         attach_path))
150
156
            try:
223
229
        if subject is not None:
224
230
            message_options['subject'] = subject
225
231
        if attach_path is not None:
226
 
            message_options['attachment'] = urlutils.local_path_to_url(
227
 
                attach_path)
 
232
            message_options['attachment'] = str(urlutils.local_path_to_url(
 
233
                attach_path))
228
234
        options_list = ["%s='%s'" % (k, v) for k, v in
229
235
                        sorted(message_options.iteritems())]
230
236
        return ['-compose', ','.join(options_list)]