Unicode handling broken for NextContinuationToken

Bug #1768348 reported by Darrell Bishop
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Swift3
New
Undecided
Unassigned

Bug Description

Unicode handling broken for NextContinuationToken in servicing container listings.

This fixes it:

```
diff -ru swift3.orig/swift3/controllers/bucket.py swift3/swift3/controllers/bucket.py
--- swift3.orig/swift3/controllers/bucket.py 2018-03-21 21:23:40.000000000 +0000
+++ swift3/swift3/controllers/bucket.py 2018-05-01 20:08:03.589958449 +0000
@@ -156,10 +156,10 @@
             if is_truncated:
                 if 'name' in objects[-1]:
                     SubElement(elem, 'NextContinuationToken').text = \
- b64encode(objects[-1]['name'])
+ b64encode(objects[-1]['name'].encode('utf8'))
                 if 'subdir' in objects[-1]:
                     SubElement(elem, 'NextContinuationToken').text = \
- b64encode(objects[-1]['subdir'])
+ b64encode(objects[-1]['subdir'].encode('utf8'))
             if 'continuation-token' in req.params:
                 SubElement(elem, 'ContinuationToken').text = \
                     req.params['continuation-token']
```

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.