Skip to content
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

MakoMiddleware::__init__() creates temporary directories even when one is provided in settings #1

Open
tuxdna opened this issue May 12, 2010 · 0 comments

Comments

@tuxdna
Copy link

tuxdna commented May 12, 2010

Copied from: http://code.google.com/p/django-mako/issues/detail?id=3

What steps will reproduce the problem?

  1. remove all the temporary folders created by tempfile.mkdtemp(): rm -rf
    /tmp/tmp*
  2. now open a python shell and enter the following lines. note that same
    concept is used in middleware.py too:

import tempfile
settings = 'a string'

fetch the value of attribute 'upper' of instance 'settings',

since a string always has 'upper' attribute( a method ),

it will be returned. but still a temporary directory will be created

meth = getattr(settings,'upper',tempfile.mkdtemp())

  1. a temporary directory will be created, check it like:
    ls -ld /tmp/tmp*

What is the expected output? What do you see instead?

  • If the settings file already contains a 'MAKO_MODULE_DIR', no temporary
    directories should be created.

What version of the product are you using? On what operating system?

  • SVN trunk, on Fedora 12

Please provide any additional information below.

  • Attached patch fixes the issue. Please apply it to SVN trunk.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant