Permalink
Browse files

[fc] Repository: plone.formwidget.namedfile

Branch: refs/heads/master
Date: 2015-02-28T06:32:12+01:00
Author: Timo Stollenwerk (tisto) <tisto@plone.org>
Commit: plone/plone.formwidget.namedfile@ba3e1fa

Do not use format() since it will break for Python 2.6.

Files changed:
M plone/formwidget/namedfile/converter.py

diff --git a/plone/formwidget/namedfile/converter.py b/plone/formwidget/namedfile/converter.py
index 71395ca..7070eb1 100644
--- a/plone/formwidget/namedfile/converter.py
+++ b/plone/formwidget/namedfile/converter.py
@@ -54,9 +54,10 @@ def b64encode_file(filename, data):
         filename = filename.encode('utf-8')
     filenameb64 = base64.standard_b64encode(filename or '')
     datab64 = base64.standard_b64encode(data)
-    return "filenameb64:{};datab64:{}".format(
+    filename = "filenameb64:%s;datab64:%s" % (
         filenameb64, datab64
-    ).encode('ascii')
+    )
+    return filename.encode('ascii')
 
 
 def b64decode_file(value):
  • Loading branch information...
tisto committed Feb 28, 2015
1 parent 9874afd commit 17ce1ff961baf5687f342234236487ea15a275d2
Showing with 22 additions and 74 deletions.
  1. +22 −74 last_commit.txt
@@ -1,82 +1,30 @@
Repository: plone.app.upgrade
Repository: plone.formwidget.namedfile
Branch: refs/heads/master
Date: 2015-02-27T18:10:28+01:00
Author: Jure Cerjak (jcerjak) <jcerjak@termitnjak.si>
Commit: https://github.com/plone/plone.app.upgrade/commit/c19fdbc06d50af1a1f94fc9f4e2379b990a246b6
Date: 2015-02-28T06:32:12+01:00
Author: Timo Stollenwerk (tisto) <tisto@plone.org>
Commit: https://github.com/plone/plone.formwidget.namedfile/commit/ba3e1fa4dbb786f11b0eea390bf7da4bb843b750

don't do bare excepts
Do not use format() since it will break for Python 2.6.

Files changed:
M plone/app/upgrade/v30/tests.py

diff --git a/plone/app/upgrade/v30/tests.py b/plone/app/upgrade/v30/tests.py
index 1bf4207..2a3a2cf 100644
--- a/plone/app/upgrade/v30/tests.py
+++ b/plone/app/upgrade/v30/tests.py
@@ -13,6 +13,7 @@
from plone.portlets.interfaces import ILocalPortletAssignmentManager
from plone.portlets.constants import CONTEXT_CATEGORY as CONTEXT_PORTLETS

+from zExceptions import BadRequest
from zope.location.interfaces import ISite
from zope.component import getGlobalSiteManager
from zope.component import getSiteManager
@@ -668,12 +669,12 @@ def testUpdateMemberSecurity(self):
pprop = getToolByName(self.portal, 'portal_properties')
try:
self.portal.manage_addProperty('validate_email', False, 'boolean')
- except: # property is already there
+ except BadRequest: # property is already there
pass
try:
pprop.site_properties.manage_addProperty(
'allowAnonymousViewAbout', True, 'boolean')
- except: # property is already there
+ except BadRequest: # property is already there
pass

updateMemberSecurity(self.portal)


Repository: plone.app.upgrade
Branch: refs/heads/master
Date: 2015-02-27T22:19:32+01:00
Author: Gil Forcada (gforcada) <gforcada@gnome.org>
Commit: https://github.com/plone/plone.app.upgrade/commit/b7590713a780b7ddca79a2aecdb3f3454abfaa95

Merge pull request #27 from plone/plip10359-security-controlpanel

don't do bare excepts

Files changed:
M plone/app/upgrade/v30/tests.py

diff --git a/plone/app/upgrade/v30/tests.py b/plone/app/upgrade/v30/tests.py
index 1bf4207..2a3a2cf 100644
--- a/plone/app/upgrade/v30/tests.py
+++ b/plone/app/upgrade/v30/tests.py
@@ -13,6 +13,7 @@
from plone.portlets.interfaces import ILocalPortletAssignmentManager
from plone.portlets.constants import CONTEXT_CATEGORY as CONTEXT_PORTLETS
M plone/formwidget/namedfile/converter.py

diff --git a/plone/formwidget/namedfile/converter.py b/plone/formwidget/namedfile/converter.py
index 71395ca..7070eb1 100644
--- a/plone/formwidget/namedfile/converter.py
+++ b/plone/formwidget/namedfile/converter.py
@@ -54,9 +54,10 @@ def b64encode_file(filename, data):
filename = filename.encode('utf-8')
filenameb64 = base64.standard_b64encode(filename or '')
datab64 = base64.standard_b64encode(data)
- return "filenameb64:{};datab64:{}".format(
+ filename = "filenameb64:%s;datab64:%s" % (
filenameb64, datab64
- ).encode('ascii')
+ )
+ return filename.encode('ascii')

+from zExceptions import BadRequest
from zope.location.interfaces import ISite
from zope.component import getGlobalSiteManager
from zope.component import getSiteManager
@@ -668,12 +669,12 @@ def testUpdateMemberSecurity(self):
pprop = getToolByName(self.portal, 'portal_properties')
try:
self.portal.manage_addProperty('validate_email', False, 'boolean')
- except: # property is already there
+ except BadRequest: # property is already there
pass
try:
pprop.site_properties.manage_addProperty(
'allowAnonymousViewAbout', True, 'boolean')
- except: # property is already there
+ except BadRequest: # property is already there
pass

updateMemberSecurity(self.portal)
def b64decode_file(value):


0 comments on commit 17ce1ff

Please sign in to comment.