I'm getting an "EOL while scanning single-quoted string" error when using tg-admin quickstart. I traced the problem to /usr/lib/python2.5/site-packages/TurboGears-1.0.3.2-py2.5.egg/turbogears/qstemplates/quickstart/+package+/model.py_tmpl at line 242, where triple-single quotes are used to define docstrings for two functions. This seems like it should be fine, but all the other docstrings in the package are enclosed with triple-double-quotes, and the triple-single-quote version gets mangled somewhere in the process of being used as a Cheetah template:
EOL while scanning single-quoted string (cheetah_DynamicallyCompiledCheetahTemplate_2007082521424955858.py, line 319) Line|Python Code ----|------------------------------------------------------------- 317 | 318 | def _set_password(self, password): 319 | '''' The problem is fixed by replacing both sets of triple-single-quotes with triple-double-quotes. I'm on Kubuntu Gutsy Tribe 4, using TG 1.0.3.2. I'm attaching a dump from the failed run, the broken model.py_tmpl ( model.py_tmpl.broken), the fixed version (model.py_tmpl.fixed), and a diff file. I think this is all ready to create a ticket, but I'm restraining myself and bringing it up here first Thanks, -- - Catherine http://catherinedevlin.blogspot.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---
Enter project name: Enter package name [tgerr]: Do you need Identity
(usernames/passwords) in this project? [no] Selected and implied templates:
TurboGears#tgbase tg base template
TurboGears#turbogears web framework
Variables:
egg: tgerr
elixir: False
identity: none
package: tgerr
project: tgerr
sqlalchemy: False
Creating template tgbase
Creating directory ./tgerr
Recursing into +einame+.egg-info
Creating ./tgerr/tgerr.egg-info/
Copying PKG-INFO to ./tgerr/tgerr.egg-info/PKG-INFO
Copying paster_plugins.txt to ./tgerr/tgerr.egg-info/paster_plugins.txt
Copying sqlobject.txt_tmpl to ./tgerr/tgerr.egg-info/sqlobject.txt
Recursing into +package+
Creating ./tgerr/tgerr/
Copying __init__.py_tmpl to ./tgerr/tgerr/__init__.py
Copying release.py_tmpl to ./tgerr/tgerr/release.py
Recursing into static
Creating ./tgerr/tgerr/static/
Recursing into css
Creating ./tgerr/tgerr/static/css/
Copying empty to ./tgerr/tgerr/static/css/empty
Recursing into images
Creating ./tgerr/tgerr/static/images/
Copying favicon.ico to ./tgerr/tgerr/static/images/favicon.ico
Copying tg_under_the_hood.png to
./tgerr/tgerr/static/images/tg_under_the_hood.png
Copying under_the_hood_blue.png to
./tgerr/tgerr/static/images/under_the_hood_blue.png
Recursing into javascript
Creating ./tgerr/tgerr/static/javascript/
Copying empty to ./tgerr/tgerr/static/javascript/empty
Recursing into templates
Creating ./tgerr/tgerr/templates/
Copying __init__.py_tmpl to ./tgerr/tgerr/templates/__init__.py
Creating template turbogears
Recursing into +package+
Recursing into config
Creating ./tgerr/tgerr/config/
Copying __init__.py_tmpl to ./tgerr/tgerr/config/__init__.py
Copying app.cfg_tmpl to ./tgerr/tgerr/config/app.cfg
Copying log.cfg_tmpl to ./tgerr/tgerr/config/log.cfg
Copying controllers.py_tmpl to ./tgerr/tgerr/controllers.py
Copying json.py_tmpl to ./tgerr/tgerr/json.py
Copying json.pyTraceback (most recent call last):
File "/usr/bin/tg-admin", line 8, in <module>
load_entry_point('TurboGears==1.0.3.2', 'console_scripts', 'tg-admin')()
File
"/usr/lib/python2.5/site-packages/TurboGears-1.0.3.2-py2.5.egg/turbogears/command/base.py",
line 389, in main
command.run()
File
"/usr/lib/python2.5/site-packages/TurboGears-1.0.3.2-py2.5.egg/turbogears/command/quickstart.py",
line 203, in run
command.run(cmd_args)
File
"/usr/lib/python2.5/site-packages/PasteScript-1.3.5-py2.5.egg/paste/script/command.py",
line 210, in run
result = self.command()
File
"/usr/lib/python2.5/site-packages/PasteScript-1.3.5-py2.5.egg/paste/script/create_distro.py",
line 125, in command
template, output_dir, vars)
File
"/usr/lib/python2.5/site-packages/PasteScript-1.3.5-py2.5.egg/paste/script/create_distro.py",
line 167, in create_template
template.run(self, output_dir, vars)
File
"/usr/lib/python2.5/site-packages/TurboGears-1.0.3.2-py2.5.egg/turbogears/command/quickstart.py",
line 33, in run
super(TGTemplate, self).run(command, output_dirs, vars)
File
"/usr/lib/python2.5/site-packages/PasteScript-1.3.5-py2.5.egg/paste/script/templates.py",
line 57, in run
self.write_files(command, output_dir, vars)
File
"/usr/lib/python2.5/site-packages/PasteScript-1.3.5-py2.5.egg/paste/script/templates.py",
line 126, in write_files
template_renderer=self.template_renderer)
File
"/usr/lib/python2.5/site-packages/PasteScript-1.3.5-py2.5.egg/paste/script/copydir.py",
line 94, in copy_dir
svn_add=svn_add, template_renderer=template_renderer)
File
"/usr/lib/python2.5/site-packages/PasteScript-1.3.5-py2.5.egg/paste/script/copydir.py",
line 103, in copy_dir
template_renderer=template_renderer)
File
"/usr/lib/python2.5/site-packages/PasteScript-1.3.5-py2.5.egg/paste/script/copydir.py",
line 278, in substitute_content
searchList=[vars])
File "/var/lib/python-support/python2.5/Cheetah/Template.py", line 1199, in
__init__
self._compile(source, file, compilerSettings=compilerSettings)
File "/var/lib/python-support/python2.5/Cheetah/Template.py", line 1487, in
_compile
_tmpl to ./tgerr/tgerr/json.py
keepRefToGeneratedCode=True)
File "/var/lib/python-support/python2.5/Cheetah/Template.py", line 786, in
compile
raise parseError
Cheetah.Parser.ParseError:
Error in the Python code which Cheetah generated for this template:
================================================================================
EOL while scanning single-quoted string
(cheetah_DynamicallyCompiledCheetahTemplate_2007082521424955858.py, line 319)
Line|Python Code
----|-------------------------------------------------------------
317 |
318 | def _set_password(self, password):
319 | ''''
^
320 | algo defined in the configuration
321 | ''''
322 | self._password = identity.encrypt_password(password)
================================================================================
Here is the corresponding Cheetah code.
** I had to guess the line & column numbers, so they are probably incorrect:
Line 277, column 1
Line|Cheetah Code
----|-------------------------------------------------------------
274 |assign(Permission, permissions_table,
275 | properties=dict(groups=relation(Group,
276 | secondary=group_permission_table, backref='permissions')))
277 |#else
^
278 |#
279 |# identity model
280 |#
model.py_tmpl.broken
Description: Binary data
model.py_tmpl.fixed
Description: Binary data
242c242 < ''' --- > """ 245c245 < ''' --- > """ 249c249 < ''' --- > """ 251c251 < ''' --- > """

