Changeset 70566 in vbox for trunk/src/VBox/ValidationKit/testboxscript
- Timestamp:
- Jan 12, 2018 6:25:48 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 120253
- Location:
- trunk/src/VBox/ValidationKit/testboxscript
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testboxscript/testboxconnection.py
r70560 r70566 32 32 # Standard python imports. 33 33 import sys; 34 import urllib35 34 if sys.version_info[0] >= 3: 36 import http.client as httplib; # pylint: disable=import-error,no-name-in-module 37 import urllib.parse as urlparse; # pylint: disable=import-error,no-name-in-module 35 import http.client as httplib; # pylint: disable=import-error,no-name-in-module 36 import urllib.parse as urlparse; # pylint: disable=import-error,no-name-in-module 37 from urllib.parse import urlencode as urllib_urlencode; # pylint: disable=import-error,no-name-in-module 38 38 else: 39 import httplib; # pylint: disable=import-error 40 import urlparse; # pylint: disable=import-error 39 import httplib; # pylint: disable=import-error 40 import urlparse; # pylint: disable=import-error 41 from urllib import urlencode as urllib_urlencode; # pylint: disable=import-error 41 42 42 43 # Validation Kit imports. … … 59 60 # Read the whole response (so we can log it). 60 61 sBody = oResponse.read(); 62 sBody = sBody.decode('utf-8'); 61 63 62 64 # Check the content type. … … 199 201 sServerPath = '/%s/testboxdisp.py' % (self._oParsedUrl.path.strip('/'),); # pylint: disable=E1101 200 202 dParams[constants.tbreq.ALL_PARAM_ACTION] = sAction; 201 sBody = urllib .urlencode(dParams);203 sBody = urllib_urlencode(dParams); 202 204 ##testboxcommons.log2('sServerPath=%s' % (sServerPath,)); 203 205 try: -
trunk/src/VBox/ValidationKit/testboxscript/testboxtasks.py
r70548 r70566 642 642 oFile = open(sPath, "rb"); 643 643 sStr = oFile.read(); 644 sStr = sStr.decode('utf-8'); 644 645 oFile.close(); 645 646 return sStr.strip(); … … 779 780 try: 780 781 oFile = open(sPath, "wb"); 781 oFile.write(sContent );782 oFile.write(sContent.encode('utf-8')); 782 783 oFile.flush(); 783 784 try: os.fsync(oFile.fileno());
Note:
See TracChangeset
for help on using the changeset viewer.