~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lockdir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-09-03 20:58:40 UTC
  • mfrom: (3626.1.6 unicode_hostname)
  • Revision ID: pqm@pqm.ubuntu.com-20080903205840-mteswj8dfvld7vo3
(Mark Hammond) Fix bug #256550 by using a Unicode api on Windows for
        the host name.

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
        )
129
129
from bzrlib.trace import mutter, note
130
130
from bzrlib.transport import Transport
131
 
from bzrlib.osutils import rand_chars, format_delta
 
131
from bzrlib.osutils import rand_chars, format_delta, get_host_name
132
132
from bzrlib.rio import read_stanza, Stanza
133
133
import bzrlib.ui
134
134
 
422
422
    def _prepare_info(self):
423
423
        """Write information about a pending lock to a temporary file.
424
424
        """
425
 
        import socket
426
425
        # XXX: is creating this here inefficient?
427
426
        config = bzrlib.config.GlobalConfig()
428
427
        try:
429
428
            user = config.user_email()
430
429
        except errors.NoEmailInUsername:
431
430
            user = config.username()
432
 
        s = Stanza(hostname=socket.gethostname(),
 
431
        s = Stanza(hostname=get_host_name(),
433
432
                   pid=str(os.getpid()),
434
433
                   start_time=str(int(time.time())),
435
434
                   nonce=self.nonce,