Kann jemand mir den tatsächlichen Grund hinter der Warnung, die ich in dieser Django Middleware bekomme, sagen, und wie kann ich das lösen?DeprecationWarning: BaseException.message wurde ab Python 2.6 als Ausnahme abgelehnt .__ class__, exception.message,
Ich erhalte diese Botschaft "DeprecationWarning: BaseException.message wie von Python veraltet ist 2,6 Ausnahme Klasse, Exception.Message,."
class GeneralMiddleware(object):
def process_exception(self, request, exception):
if exception.__class__ is SandboxError:
# someone is trying to access a sandbox that he has no
# permission to
return HttpResponseRedirect("/notpermitted/")
exc_type, value, tb = sys.exc_info()
data = traceback.format_tb(
tb, None) + traceback.format_exception_only(
exc_type, value)
msg = (
"Failure when calling method:\n"
u"URL:'%s'\nMethod:'%s'\nException Type:'%s'\n"
u"Error Message '%s'\nFull Message:\n%s"
% (request.get_full_path(), request.method,
exception.__class__, exception.message,
Try 'isinstance (Ausnahme, SandboxError)' statt 'Ausnahme .__ class__ ist SandboxError'. – Blender
Es funktioniert nicht für mich Mixer ... danke für Ihre schnelle Antwort. Eigentlich bekomme ich die Warnung auf Ausnahme .__ class__, exception.message diese Zeile. – PythonDev