You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
try:
import django
from django.conf import settings
if not settings.configured:
django.setup()
print('Imported django settings.')
try:
exec_strs = [
(app, 'from {}.models import *'.format(app))
for app in settings.INSTALLED_APPS
]
for app, x in exec_strs:
try:
exec(x)
except:
pass
else:
print('Imported models for app {}'.format(app))
except:
pass
except django.core.exceptions.ImproperlyConfigured as msg:
print('Erro na configuração do django ao importar módulo: {}'.format(msg))
On latest bpython, it prints an ascii decode error whenever I start bpython (I'm running Python 3.9.2).
I have this code set up on
.pythonrc:On latest bpython, it prints an ascii decode error whenever I start bpython (I'm running Python 3.9.2).
The issue is this code:
bpython/bpython/inspection.py
Line 332 in 34f0e70
It assumes old style comment block
coding: utf-8, and if it fails, then assumes ascii encoding.You could assume
utf-8encoding if there is no block, or try to decode the string and catch aUnicodeDecodeError.