-
Notifications
You must be signed in to change notification settings - Fork 55
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
error when doing GenericSetup export #396
Comments
I don't see how this can be related with collective.cover; could you please give more information? |
It's really simple, if you follow the steps I outlined, you will reproduce the behavior. You can't do an Export in portal_setup, it only fails when I add a cover content item to the site. When you remove the cover object from the site, Export works again. I also tried adding another dexterity content item, or an AT item, and it did not fail. Export fails only with a Cover object in the site. |
yes, but this seems to be an issue in Generic Setup of Dexterity; as you can see there is no cover code mentioned above. could you please dig a little bit deeper? |
Just FYI, we tested this in newer versions and the error still exists. Did the same as @fulv with '1.4b2.dev0' (commit 0b43480): create a Plone Site, create a simple cover with empty layout, go to portal_setup and do "Export All Steps", it gives you the same error.
In a vanilla Plone 4.3.12, we don't have this problem. We have no idea why this happens. |
Well, the problem isn't with "Export all steps", is with the option
Adding |
that's weird, because the content type is not a container; but I think it was probably a container in the past so it may have something left behind. maybe this?
|
I think this issue is still valid. And it's defnitely a problem of this package.
security.declareProtected( ManagePortal, 'writeDataFile' )
def writeDataFile( self, filename, text, content_type, subdir=None ):
""" See IExportContext.
"""
if subdir is not None:
filename = '/'.join( ( subdir, filename ) )
parents = filename.split('/')[:-1]
while parents:
path = '/'.join(parents) + '/'
if path not in self._archive.getnames():
info = TarInfo(path)
info.type = DIRTYPE
# tarfile.filemode(0755) == '-rwxr-xr-x'
info.mode = 0755
info.mtime = time.time()
self._archive.addfile(info)
parents.pop()
info = TarInfo(filename)
if isinstance(text, str):
stream = StringIO(text)
info.size = len(text)
elif isinstance(text, unicode):
raise ValueError("Unicode text is not supported, even if it only "
"contains ascii. Please encode your data. See "
"GS 1.7.0 changes for more")
else:
# Assume text is a an instance of a class like
# Products.Archetypes.WebDAVSupport.PdataStreamIterator,
# as in the case of ATFile
stream = text.file
info.size = text.size
info.mtime = time.time()
self._archive.addfile( info, stream ) It's not a text, it's not a unicode, it's something else and that something else should be treated the same way as the |
feel free to open a new issue and provide more details on how to reproduce the problem. |
This is collective.cover 1.0a7 on Plone 4.3.2.
Steps:
Result:
The text object in writeDataFile is:
The text was updated successfully, but these errors were encountered: