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

SimpleTALTemplate::render StringIO issue #322

Open
hayate opened this Issue May 11, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@hayate
Contributor

hayate commented May 11, 2012

In SimpleTALTemplate in the render method around line 2877 the output variable is initialized with StringIO but StringIO is not imported as StringIO but as BytesIO (see around line 93)

possible solution around line 93, for python 2.x branch:
from StringIO import StringIO as BytesIO, StringIO

also for better performance cStringIO can be used
try
from cStringIO import StringIO as BytesIO, StringIO
except ImportError:
from StringIO import StringIO as BytesIO, StringIO

@defnull

This comment has been minimized.

Show comment
Hide comment
@defnull

defnull May 14, 2012

Member

Uhm... thats a critical error and it was not noticed for months? Interesting. Perhaps it is a good time to remove SimpleTALTemplate support instead of fixing it. Or move it to a plugin.

I don't use/know/need TAL support at all. Thats why there are no tests and the adapter is very basic. If no one volunteers to maintain that adapter (and write some tests) I should probably remove it within the next two releases.

I'll leave this Issue open for discussions.

Member

defnull commented May 14, 2012

Uhm... thats a critical error and it was not noticed for months? Interesting. Perhaps it is a good time to remove SimpleTALTemplate support instead of fixing it. Or move it to a plugin.

I don't use/know/need TAL support at all. Thats why there are no tests and the adapter is very basic. If no one volunteers to maintain that adapter (and write some tests) I should probably remove it within the next two releases.

I'll leave this Issue open for discussions.

@hayate

This comment has been minimized.

Show comment
Hide comment
@hayate

hayate May 16, 2012

Contributor

I also don't use TAL, i realized about the error when byte compiling bottle with cython, incidentally __file__ is not available on byte compiled python code but following code fix it:

if not hasattr(sys.modules[__name__], '__file__'):
    import inspect
    __file__ = inspect.getfile(inspect.currentframe())
Contributor

hayate commented May 16, 2012

I also don't use TAL, i realized about the error when byte compiling bottle with cython, incidentally __file__ is not available on byte compiled python code but following code fix it:

if not hasattr(sys.modules[__name__], '__file__'):
    import inspect
    __file__ = inspect.getfile(inspect.currentframe())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment