Skip to content

Commit 103a4c5

Browse files
committed
Several fixes after failing tests
1 parent e3541e8 commit 103a4c5

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

tests/twisted/gabbletest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def streamStarted(self, root=None):
233233

234234
def auth(self, auth):
235235
assert (base64.b64decode(bytes(auth)) ==
236-
b'\x00%s\x00%s' % (self.username, self.password))
236+
b'\x00%s\x00%s' % (self.username.encode(), self.password.encode()))
237237

238238
success = domish.Element((ns.NS_XMPP_SASL, 'success'))
239239
self.xmlstream.send(success)
@@ -555,7 +555,7 @@ def disconnect_conn(q, conn, stream, expected_before=[], expected_after=[]):
555555
return before_events[:-2], after_events[:-1]
556556

557557
def element_repr(element):
558-
"""__repr__ cannot safely return non-ASCII: see
558+
r"""__repr__ cannot safely return non-ASCII: see
559559
<http://bugs.python.org/issue5876>. So we print non-ASCII characters as
560560
\uXXXX escapes in debug output
561561

tests/twisted/sasl/telepathy-password.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import constants as cs
88
from saslutil import connect_and_get_sasl_channel
99

10-
PASSWORD = "pass"
10+
PASSWORD = b"pass"
1111

1212
def test_close_straight_after_accept(q, bus, conn, stream):
1313
chan, props = connect_and_get_sasl_channel(q, bus, conn)

tools/c-constants-gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __call__(self):
1717
self.do_footer()
1818

1919
def write(self, code):
20-
stdout.write(code.encode('utf-8'))
20+
stdout.write(code)
2121

2222
# Header
2323
def do_header(self):

tools/glib-interfaces-gen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ def __init__(self, prefix, implfile, declfile, dom):
1414
self.spec = get_by_path(dom, "spec")[0]
1515

1616
def h(self, code):
17-
self.decls.write(code.encode('utf-8'))
17+
self.decls.write(code)
1818

1919
def c(self, code):
20-
self.impls.write(code.encode('utf-8'))
20+
self.impls.write(code)
2121

2222
def __call__(self):
2323
for f in self.h, self.c:

0 commit comments

Comments
 (0)