Merge pull request #5121 from laughsuggestion/develop

smtplib login expects strings for username and password
This commit is contained in:
Achilles Rasquinha 2018-03-07 16:43:12 +05:30 committed by GitHub
commit 85fd2e15bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View file

@ -191,8 +191,7 @@ class SMTPServer:
self._sess.ehlo()
if self.login and self.password:
ret = self._sess.login((self.login or "").encode('utf-8'),
(self.password or "").encode('utf-8'))
ret = self._sess.login((self.login or ""), (self.password or ""))
# check if logged correctly
if ret[0]!=235:

View file

@ -98,7 +98,7 @@ def get_static_file_response():
raise NotFound
response = Response(wrap_file(frappe.local.request.environ, f), direct_passthrough=True)
response.mimetype = mimetypes.guess_type(frappe.flags.file_path)[0] or b'application/octet-stream'
response.mimetype = mimetypes.guess_type(frappe.flags.file_path)[0] or 'application/octet-stream'
return response
def build_response(path, data, http_status_code, headers=None):