New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: unmarshallable object (python 3) #23
Comments
I'm not convinced this should work. From the python documentation (2 and 3)
It appears to work in python 2 only because
Additionally, python 2 just treats a string subclass as a string and throws away any extra attributes:
Finally, this isn't specific to
In short: the problem is actually that python 2 is silently accepting something it shouldn't |
It appears that It does fail loudly at least from 3.0 onwards -- I can't find any relevant change but presumably had something to do with all the 3.x unicode changes. |
I use unipath in Jinja2 Bytecode Cache for Django project Python 2.7 from unipath import Path
# Absolute filesystem path to the Django project directory:
DJANGO_ROOT = Path(__file__).ancestor(2)
# Absolute filesystem path to the top-level project folder:
SITE_ROOT = DJANGO_ROOT.parent
TEMPLATES = [
{
'BACKEND': 'service.core.jinja2.engine.Jinja2',
'NAME': 'jinja',
'DIRS': [SITE_ROOT.child('templates')],
'APP_DIRS': False,
'OPTIONS': {
'context_processors': CONTEXT_PROCESSORS,
'environment': 'service.core.jinja2.environment',
'autoescape': False,
'newstyle_gettext': False,
'debug': DEBUG,
},
}, This error [ValueError: unmarshallable object] appeared after migration to Python 3.x workaround: 'DIRS': [unicode(SITE_ROOT.child('templates'))], |
@kwist-sgr see the link in my previous comment: if jinja you were not supposed to be able to do this in python 2 but python didn't check for subtypes of built-in classes. Python 3 specifically checks for this. Try replacing
with
|
Python 2.7.12
Python 3.5.2
The text was updated successfully, but these errors were encountered: