Changeset 948:483488585dd8 for src
- Timestamp:
- 05/07/19 18:31:40 (6 years ago)
- Branch:
- python3
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/update.py
r919 r948 11 11 import hashlib 12 12 import traceback 13 import io 13 14 14 15 if os.name=="nt": … … 195 196 def _send(self, words): 196 197 """Send the given words via the socket.""" 197 self._sock.send( "\t".join(words) + "\n")198 self._sock.send(bytes("\t".join(words) + "\n", "utf-8")) 198 199 199 200 #------------------------------------------------------------------------------ … … 226 227 try: 227 228 updateManifest = Manifest() 228 f= urllib.request.urlopen(updateURL + "/" + manifestName) 229 updateManifest.readFrom(f) 229 reply = urllib.request.urlopen(updateURL + "/" + manifestName) 230 charset = reply.headers.get_content_charset() 231 content = reply.read().decode("utf-8" if charset is None else charset) 232 updateManifest.readFrom(io.StringIO(content)) 230 233 231 234 except Exception as e: … … 290 293 try: 291 294 sum = hashlib.md5() 292 sum.update( path)295 sum.update(bytes(path, "utf-8")) 293 296 toremoveDir = getToremoveDir(toremoveDir, directory) 294 297 targetPath = os.path.join(toremoveDir, sum.hexdigest()) … … 505 508 break; 506 509 507 buffer += data510 buffer += str(data, "utf-8") 508 511 buffer = processMLXUpdate(buffer, listener) 509 512
Note:
See TracChangeset
for help on using the changeset viewer.