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

field2* converters should not handle files #963

Merged
merged 9 commits into from
May 6, 2021
Merged

field2* converters should not handle files #963

merged 9 commits into from
May 6, 2021

Conversation

jugmac00
Copy link
Member

Until now field converters could be applied on files with unclear outcome.

The problems with trying to convert files to text (detect MIME type, guess charset...)
were discussed in length in #558 (comment).

Handling files only makes sense for the field2bytes converter.

This fixes #558

Copy link
Member

@icemac icemac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I general I like the idea, i just have some questions resp. suggestions.

CHANGES.rst Outdated Show resolved Hide resolved
src/ZPublisher/Converters.py Show resolved Hide resolved
@icemac icemac requested a review from d-maurer May 5, 2021 06:30
Copy link
Contributor

@d-maurer d-maurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think we need deprecation warnings in Zope 5: Zope 5 is Python 3 only and the file case is wrongly handled by the converters; thus, any user should already have been warned.

From my point of view, deprecation warnings are also not necessary in Zope 4: I assume that the "convert file" case is very rarely used.

@jugmac00
Copy link
Member Author

jugmac00 commented May 6, 2021

@icemac and @d-maurer, thank you for taking the time for the review!

@jugmac00 jugmac00 merged commit f3bfc64 into master May 6, 2021
@jugmac00 jugmac00 deleted the issue_558 branch May 6, 2021 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Several possible problems within the ZPublisher Converters module
3 participants