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

Fixes for Python 3 #82

Merged
merged 4 commits into from
Aug 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ New features:

Bug fixes:

- Add support for Python 3.
[davisagli]

- Support for Plone 5.x toolbar, i18n, ...
[jensens]

Expand Down
6 changes: 3 additions & 3 deletions src/plone/app/robotframework/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def create_content(self, *args, **kwargs):
content = None
if HAS_DEXTERITY:
# The title attribute for Dexterity types needs to be unicode
if 'title' in kwargs and isinstance(kwargs['title'], str):
if 'title' in kwargs and isinstance(kwargs['title'], six.binary_type):
kwargs['title'] = kwargs['title'].decode('utf-8')
from plone.dexterity.interfaces import IDexterityFTI
from plone.dexterity.utils import createContentInContainer
Expand Down Expand Up @@ -285,7 +285,7 @@ def prefill_image_types(portal, kwargs):

def random_image():
import random
from six import StringIO
from six import BytesIO
from PIL import Image
from PIL import ImageDraw

Expand All @@ -302,7 +302,7 @@ def random_image():
)
del draw

result = StringIO()
result = BytesIO()
img.save(result, 'PNG')
result.seek(0)
return result
Expand Down
2 changes: 1 addition & 1 deletion src/plone/app/robotframework/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_keyword_names(self):
'get_keyword_documentation',
'run_keyword'
])
names = filter(lambda x: x[0] != '_' and x not in blacklist, dir(self))
names = [x for x in dir(self) if x[0] != '_' and x not in blacklist]
return names

def get_keyword_arguments(self, name):
Expand Down