Mercurial > hg
comparison hgext/gpg.py @ 30925:82f1ef8b4477
py3: convert the mode argument of os.fdopen to unicodes (2 of 2)
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 13 Feb 2017 22:15:28 +0530 |
parents | d5883fd055c6 |
children | 279cbde7bf3d |
comparison
equal
deleted
inserted
replaced
30924:48dea083f66d | 30925:82f1ef8b4477 |
---|---|
16 cmdutil, | 16 cmdutil, |
17 commands, | 17 commands, |
18 error, | 18 error, |
19 match, | 19 match, |
20 node as hgnode, | 20 node as hgnode, |
21 pycompat, | |
21 util, | 22 util, |
22 ) | 23 ) |
23 | 24 |
24 cmdtable = {} | 25 cmdtable = {} |
25 command = cmdutil.command(cmdtable) | 26 command = cmdutil.command(cmdtable) |
42 """ returns of the good and bad signatures""" | 43 """ returns of the good and bad signatures""" |
43 sigfile = datafile = None | 44 sigfile = datafile = None |
44 try: | 45 try: |
45 # create temporary files | 46 # create temporary files |
46 fd, sigfile = tempfile.mkstemp(prefix="hg-gpg-", suffix=".sig") | 47 fd, sigfile = tempfile.mkstemp(prefix="hg-gpg-", suffix=".sig") |
47 fp = os.fdopen(fd, 'wb') | 48 fp = os.fdopen(fd, pycompat.sysstr('wb')) |
48 fp.write(sig) | 49 fp.write(sig) |
49 fp.close() | 50 fp.close() |
50 fd, datafile = tempfile.mkstemp(prefix="hg-gpg-", suffix=".txt") | 51 fd, datafile = tempfile.mkstemp(prefix="hg-gpg-", suffix=".txt") |
51 fp = os.fdopen(fd, 'wb') | 52 fp = os.fdopen(fd, pycompat.sysstr('wb')) |
52 fp.write(data) | 53 fp.write(data) |
53 fp.close() | 54 fp.close() |
54 gpgcmd = ("%s --logger-fd 1 --status-fd 1 --verify " | 55 gpgcmd = ("%s --logger-fd 1 --status-fd 1 --verify " |
55 "\"%s\" \"%s\"" % (self.path, sigfile, datafile)) | 56 "\"%s\" \"%s\"" % (self.path, sigfile, datafile)) |
56 ret = util.filter("", gpgcmd) | 57 ret = util.filter("", gpgcmd) |