Description
When trying to use PackagePage after applying the patch from MoinMoinBugs/PackagePagesFailsBecauseAllowedActionsMissing I found the following problems:
If I want to install a new created package without any changes I get a crash while the message is right
You did not change the page content, not saved! message = u'You did not change the page content, not saved!'
/usr/lib/python2.3/site-packages/MoinMoin/request.py in run (self=<MoinMoin.request.RequestCGI object>)
1006 from MoinMoin.wikiaction import getHandler
1007 handler = getHandler(self, action)
1008 handler(self.page.page_name, self)
1009
1010 # 5. Or redirect to another page
handler = <function execute>
self = <MoinMoin.request.RequestCGI object>
self.page = <MoinMoin.Page.Page instance>
self.page.page_name = u'NeueSeite'
/usr/lib/python2.3/site-packages/MoinMoin/action/AttachFile.py in execute (pagename=u'NeueSeite', request=<MoinMoin.request.RequestCGI object>)
450 elif request.form['do'][0] == 'install':
451 if request.user.name in request.cfg.superuser:
452 install_package(pagename, request)
453 else:
454 msg = _('You are not allowed to install files.')
global install_package = <function install_package>
pagename = u'NeueSeite'
request = <MoinMoin.request.RequestCGI object>
/usr/lib/python2.3/site-packages/MoinMoin/action/AttachFile.py in install_package (pagename=u'NeueSeite', request=<MoinMoin.request.RequestCGI object>)
631
632 if package.isPackage():
633 if package.installPackage():
634 msg=_("Attachment '%(filename)s' installed.") % {'filename': wikiutil.escape(target)}
635 else:
package = <MoinMoin.packages.ZipPackage instance>
package.installPackage = <bound method ZipPackage.installPackage of <MoinMoin.packages.ZipPackage instance>>
/usr/lib/python2.3/site-packages/MoinMoin/packages.py in installPackage (self=<MoinMoin.packages.ZipPackage instance>)
336 commands = self.getScript().splitlines()
337
338 return self.runScript(commands)
339
340 def getScript(self):
self = <MoinMoin.packages.ZipPackage instance>
self.runScript = <bound method ZipPackage.runScript of <MoinMoin.packages.ZipPackage instance>>
commands = [u'MoinMoinPackage|1', u'AddRevision|1|NeueSeite|ReimarBauer|Created by the PackagePages action.', u'Print|Thank you for using PackagePages!']
/usr/lib/python2.3/site-packages/MoinMoin/packages.py in runScript (self=<MoinMoin.packages.ZipPackage instance>, commands=[u'MoinMoinPackage|1', u'AddRevision|1|NeueSeite|ReimarBauer|Created by the PackagePages action.', u'Print|Thank you for using PackagePages!'])
305
306 try:
307 fn(*elements[1:])
308 except ScriptExit:
309 break
fn = <bound method ZipPackage.do_addrevision of <MoinMoin.packages.ZipPackage instance>>
elements = [u'AddRevision', u'1', u'NeueSeite', u'ReimarBauer', u'Created by the PackagePages action.']
/usr/lib/python2.3/site-packages/MoinMoin/packages.py in do_addrevision (self=<MoinMoin.packages.ZipPackage instance>, filename=u'1', pagename=u'NeueSeite', author=u'ReimarBauer', comment=u'Created by the PackagePages action.', trivial=False)
210
211 page = PageEditor(self.request, pagename, do_editor_backup=0, uid_override=author)
212 page.saveText(self.extract_file(filename), 0, trivial=trivial, comment=comment)
213
214 page.clean_acl_cache()
page = <MoinMoin.PageEditor.PageEditor instance>
page.saveText = <bound method PageEditor.saveText of <MoinMoin.PageEditor.PageEditor instance>>
self = <MoinMoin.packages.ZipPackage instance>
self.extract_file = <bound method ZipPackage.extract_file of <MoinMoin.packages.ZipPackage instance>>
filename = u'1'
trivial = False
comment = u'Created by the PackagePages action.'
/usr/lib/python2.3/site-packages/MoinMoin/PageEditor.py in saveText (self=<MoinMoin.PageEditor.PageEditor instance>, newtext=u'Describe NeueSeite here.\n\naha mal sehen\n', rev=0, **kw={'comment': u'Created by the PackagePages action.', 'trivial': False})
925 elif newtext == self.get_raw_body():
926 msg = _('You did not change the page content, not saved!')
927 raise self.Unchanged, msg
928 else:
929 from wikiacl import parseACL
self = <MoinMoin.PageEditor.PageEditor instance>
self.Unchanged = <class MoinMoin.PageEditor.Unchanged>
msg = u'You did not change the page content, not saved!'There is another raise condition if you have some special characters on the page you have packaged. By checking out you got this error
/usr/lib/python2.3/site-packages/MoinMoin/request.py in run (self=<MoinMoin.request.RequestCGI object>)
1006 from MoinMoin.wikiaction import getHandler
1007 handler = getHandler(self, action)
1008 handler(self.page.page_name, self)
1009
1010 # 5. Or redirect to another page
handler = <function execute>
self = <MoinMoin.request.RequestCGI object>
self.page = <MoinMoin.Page.Page instance>
self.page.page_name = u'StartSeite'
/usr/lib/python2.3/site-packages/MoinMoin/action/AttachFile.py in execute (pagename=u'StartSeite', request=<MoinMoin.request.RequestCGI object>)
450 elif request.form['do'][0] == 'install':
451 if request.user.name in request.cfg.superuser:
452 install_package(pagename, request)
453 else:
454 msg = _('You are not allowed to install files.')
global install_package = <function install_package>
pagename = u'StartSeite'
request = <MoinMoin.request.RequestCGI object>
/usr/lib/python2.3/site-packages/MoinMoin/action/AttachFile.py in install_package (pagename=u'StartSeite', request=<MoinMoin.request.RequestCGI object>)
631
632 if package.isPackage():
633 if package.installPackage():
634 msg=_("Attachment '%(filename)s' installed.") % {'filename': wikiutil.escape(target)}
635 else:
package = <MoinMoin.packages.ZipPackage instance>
package.installPackage = <bound method ZipPackage.installPackage of <MoinMoin.packages.ZipPackage instance>>
/usr/lib/python2.3/site-packages/MoinMoin/packages.py in installPackage (self=<MoinMoin.packages.ZipPackage instance>)
336 commands = self.getScript().splitlines()
337
338 return self.runScript(commands)
339
340 def getScript(self):
self = <MoinMoin.packages.ZipPackage instance>
self.runScript = <bound method ZipPackage.runScript of <MoinMoin.packages.ZipPackage instance>>
commands = [u'MoinMoinPackage|1', u'AddRevision|1|StartSeite|ReimarBauer|Created by the PackagePages action.', u'Print|Thank you for using PackagePages!']
/usr/lib/python2.3/site-packages/MoinMoin/packages.py in runScript (self=<MoinMoin.packages.ZipPackage instance>, commands=[u'MoinMoinPackage|1', u'AddRevision|1|StartSeite|ReimarBauer|Created by the PackagePages action.', u'Print|Thank you for using PackagePages!'])
305
306 try:
307 fn(*elements[1:])
308 except ScriptExit:
309 break
fn = <bound method ZipPackage.do_addrevision of <MoinMoin.packages.ZipPackage instance>>
elements = [u'AddRevision', u'1', u'StartSeite', u'ReimarBauer', u'Created by the PackagePages action.']
/usr/lib/python2.3/site-packages/MoinMoin/packages.py in do_addrevision (self=<MoinMoin.packages.ZipPackage instance>, filename=u'1', pagename=u'StartSeite', author=u'ReimarBauer', comment=u'Created by the PackagePages action.', trivial=False)
210
211 page = PageEditor(self.request, pagename, do_editor_backup=0, uid_override=author)
212 page.saveText(self.extract_file(filename), 0, trivial=trivial, comment=comment)
213
214 page.clean_acl_cache()
page = <MoinMoin.PageEditor.PageEditor instance>
page.saveText = <bound method PageEditor.saveText of <MoinMoin.PageEditor.PageEditor instance>>
self = <MoinMoin.packages.ZipPackage instance>
self.extract_file = <bound method ZipPackage.extract_file of <MoinMoin.packages.ZipPackage instance>>
filename = u'1'
trivial = False
comment = u'Created by the PackagePages action.'
/usr/lib/python2.3/site-packages/MoinMoin/PageEditor.py in saveText (self=<MoinMoin.PageEditor.PageEditor instance>, newtext='## Please edit system and help pages ONLY in the...ebFaq weiter.\n\nDieses Wiki basiert auf MoinMoin.\n', rev=0, **kw={'comment': u'Created by the PackagePages action.', 'trivial': False})
879 if not (wikiutil.isTemplatePage(self.request, self.page_name) or
880 wikiutil.isFormPage(self.request, self.page_name)):
881 newtext = self._expand_variables(newtext)
882
883 msg = ""
newtext = '## Please edit system and help pages ONLY in the...ebFaq weiter.\n\nDieses Wiki basiert auf MoinMoin.\n'
self = <MoinMoin.PageEditor.PageEditor instance>
self._expand_variables = <bound method PageEditor._expand_variables of <MoinMoin.PageEditor.PageEditor instance>>
/usr/lib/python2.3/site-packages/MoinMoin/PageEditor.py in _expand_variables (self=<MoinMoin.PageEditor.PageEditor instance>, text='## Please edit system and help pages ONLY in the...ebFaq weiter.\n\nDieses Wiki basiert auf MoinMoin.\n')
649 # TODO: Use a more stream-lined re.sub algorithm
650 for name in variables:
651 text = text.replace('@%s@' % name, variables[name])
652 return text
653
text = '## Please edit system and help pages ONLY in the...ebFaq weiter.\n\nDieses Wiki basiert auf MoinMoin.\n'
text.replace = <built-in method replace of str object>
name = 'ME'
variables = {'DATE': '[[Date(2005-11-01T14:36:01Z)]]', 'MAILTO': u'[[MailTo(ree@localhost)]]', 'ME': u'ReimarBauer', 'PAGE': u'StartSeite', 'SIG': u'-- ReimarBauer [[DateTime(2005-11-01T14:36:01Z)]]', 'TIME': '[[DateTime(2005-11-01T14:36:01Z)]]', 'USER': u'-- ReimarBauer', 'USERNAME': u'ReimarBauer'}
UnicodeDecodeError
'ascii' codec can't decode byte 0xc3 in position 330: ordinal not in range(128)
args = ('ascii', '## Please edit system and help pages ONLY in the...ebFaq weiter.\n\nDieses Wiki basiert auf MoinMoin.\n', 330, 331, 'ordinal not in range(128)')
encoding = 'ascii'
end = 331
object = '## Please edit system and help pages ONLY in the...ebFaq weiter.\n\nDieses Wiki basiert auf MoinMoin.\n'
reason = 'ordinal not in range(128)'
start = 330
Details
MoinMoin Version |
1.5.0-beta1 |
OS and Version |
linux |
Python Version |
2.3 |
Server Setup |
apache2 |
Server Details |
cgi-bin |
Workaround
Discussion
Plan
- Priority:
- Assigned to:
Status: Fixed in moin--main--1.5--patch-265.
