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

Create non-conflicting template module names #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

melor
Copy link

@melor melor commented Oct 4, 2012

The genUniqueModuleName() implementation generated module name
conflicts when rendering many templates in quick succession.
The combination of poor time resolution of str(time.time()) due
to the default string representation and too small value range
for the random part resulted in this.

Added a simple retry in case of conflicts.

Fixes mysterious looking failures that look like this:

File "cheetah_DynamicallyCompiledCheetahTemplate_1336479589_95_84044.py", line 58, in init
TypeError: super() argument 1 must be type, not None

The genUniqueModuleName() implementation generated module name
conflicts when rendering many templates in quick succession.
The combination of poor time resolution of str(time.time()) due
to the default string representation and too small value range
for the random part resulted in this.

Added a simple retry in case of conflicts.

Fixes mysterious looking failures that look like this:

  File "cheetah_DynamicallyCompiledCheetahTemplate_1336479589_95_84044.py", line 58, in __init__
  TypeError: super() argument 1 must be type, not None
@phdru
Copy link

phdru commented Mar 20, 2017

Applied at CheetahTemplate3/cheetah3@a2aa277

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants