mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[2.2.x] Fixed #30324 -- Forced utf-8 encoding when loading the template for the technical 500 debug page.
Regression in50b8493. Related toea542a9. Backport ofefb257a017from master
This commit is contained in:
		
				
					committed by
					
						 Carlton Gibson
						Carlton Gibson
					
				
			
			
				
	
			
			
			
						parent
						
							54b65b83a2
						
					
				
				
					commit
					9da25fb832
				
			| @@ -328,14 +328,14 @@ class ExceptionReporter: | ||||
|  | ||||
|     def get_traceback_html(self): | ||||
|         """Return HTML version of debug 500 HTTP error page.""" | ||||
|         with Path(CURRENT_DIR, 'templates', 'technical_500.html').open() as fh: | ||||
|         with Path(CURRENT_DIR, 'templates', 'technical_500.html').open(encoding='utf-8') as fh: | ||||
|             t = DEBUG_ENGINE.from_string(fh.read()) | ||||
|         c = Context(self.get_traceback_data(), use_l10n=False) | ||||
|         return t.render(c) | ||||
|  | ||||
|     def get_traceback_text(self): | ||||
|         """Return plain text version of debug 500 HTTP error page.""" | ||||
|         with Path(CURRENT_DIR, 'templates', 'technical_500.txt').open() as fh: | ||||
|         with Path(CURRENT_DIR, 'templates', 'technical_500.txt').open(encoding='utf-8') as fh: | ||||
|             t = DEBUG_ENGINE.from_string(fh.read()) | ||||
|         c = Context(self.get_traceback_data(), autoescape=False, use_l10n=False) | ||||
|         return t.render(c) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user