Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
956272d2
Commit
956272d2
authored
3 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Fix HTTP test harness for python3
parent
808d1a73
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!35
Convert viewer tree to utilize python3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llcorehttp/tests/test_llcorehttp_peer.py
+9
-9
9 additions, 9 deletions
indra/llcorehttp/tests/test_llcorehttp_peer.py
with
9 additions
and
9 deletions
indra/llcorehttp/tests/test_llcorehttp_peer.py
+
9
−
9
View file @
956272d2
...
...
@@ -98,9 +98,9 @@ def read(self):
while
size_remaining
:
chunk_size
=
min
(
size_remaining
,
max_chunk_size
)
chunk
=
self
.
rfile
.
read
(
chunk_size
)
L
.
append
(
chunk
)
L
.
append
(
chunk
.
decode
(
'
utf-8
'
)
)
size_remaining
-=
len
(
chunk
)
return
''
.
join
(
L
)
return
(
''
.
join
(
L
)
).
encode
(
'
utf-8
'
)
# end of swiped read() logic
def
read_xml
(
self
):
...
...
@@ -132,7 +132,7 @@ def do_POST(self):
# self.answer(self.read())
try
:
self
.
answer
(
dict
(
reply
=
"
success
"
,
status
=
200
,
reason
=
self
.
read
()))
reason
=
self
.
read
()
.
decode
(
'
utf-8
'
)
))
except
self
.
ignore_exceptions
as
e
:
print
(
"
Exception during POST (ignoring): %s
"
%
str
(
e
),
file
=
sys
.
stderr
)
...
...
@@ -141,7 +141,7 @@ def do_PUT(self):
# self.answer(self.read())
try
:
self
.
answer
(
dict
(
reply
=
"
success
"
,
status
=
200
,
reason
=
self
.
read
()))
reason
=
self
.
read
()
.
decode
(
'
utf-8
'
)
))
except
self
.
ignore_exceptions
as
e
:
print
(
"
Exception during PUT (ignoring): %s
"
%
str
(
e
),
file
=
sys
.
stderr
)
...
...
@@ -183,7 +183,7 @@ def answer(self, data, withdata=True):
self
.
send_header
(
"
Content-type
"
,
"
text/plain
"
)
self
.
end_headers
()
if
body
:
self
.
wfile
.
write
(
body
)
self
.
wfile
.
write
(
body
.
encode
(
'
utf-8
'
)
)
elif
"
/bug2295/
"
in
self
.
path
:
# Test for https://jira.secondlife.com/browse/BUG-2295
#
...
...
@@ -218,7 +218,7 @@ def answer(self, data, withdata=True):
self
.
send_header
(
"
Content-type
"
,
"
text/plain
"
)
self
.
end_headers
()
if
body
:
self
.
wfile
.
write
(
body
)
self
.
wfile
.
write
(
body
.
encode
(
'
utf-8
'
)
)
elif
"
fail
"
not
in
self
.
path
:
data
=
data
.
copy
()
# we're going to modify
# Ensure there's a "reply" key in data, even if there wasn't before
...
...
@@ -230,7 +230,7 @@ def answer(self, data, withdata=True):
self
.
reflect_headers
()
self
.
send_header
(
"
Content-type
"
,
"
application/llsd+xml
"
)
self
.
send_header
(
"
Content-Length
"
,
str
(
len
(
response
)))
self
.
send_header
(
"
X-LL-Special
"
,
"
Mememememe
"
)
;
self
.
send_header
(
"
X-LL-Special
"
,
"
Mememememe
"
)
self
.
end_headers
()
if
withdata
:
self
.
wfile
.
write
(
response
)
...
...
@@ -253,8 +253,8 @@ def answer(self, data, withdata=True):
def
reflect_headers
(
self
):
for
name
in
list
(
self
.
headers
.
keys
()):
# print
"Header: %s: %s" % (name, self.headers[name])
self
.
send_header
(
"
X-Reflect-
"
+
name
,
self
.
headers
[
name
])
# print
(
"Header: %s: %s" % (name, self.headers[name])
)
self
.
send_header
(
"
X-Reflect-
"
+
name
,
str
(
self
.
headers
[
name
])
)
if
not
VERBOSE
:
# When VERBOSE is set, skip both these overrides because they exist to
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment