Skip to content

Commit

Permalink
Replace .encode('utf-8') => .encode()`
Browse files Browse the repository at this point in the history
  • Loading branch information
sgaynetdinov committed Dec 3, 2018
1 parent cad9600 commit b706297
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vk/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ def _file_upload(self, file_obj):
boundary = uuid.uuid4().hex

buffer = io.BytesIO()
buffer.write('--{0}\r\n'.format(boundary).encode('utf-8'))
buffer.write('Content-Disposition: file; name="photo"; filename="photo.jpg"\r\n'.encode('utf-8'))
buffer.write('Content-Type: application/octet-stream\r\n'.encode('utf-8'))
buffer.write('--{0}\r\n'.format(boundary).encode())
buffer.write('Content-Disposition: file; name="photo"; filename="photo.jpg"\r\n'.encode())
buffer.write('Content-Type: application/octet-stream\r\n'.encode())
buffer.write(b'\r\n')
buffer.write(file_obj.read())
buffer.write(b'\r\n')
buffer.write('--{0}--\r\n'.format(boundary).encode('utf-8'))
buffer.write('--{0}--\r\n'.format(boundary).encode())

return buffer.getvalue(), boundary

0 comments on commit b706297

Please sign in to comment.