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

Fix VirtualHostMonster not being able to set mappings under Python 3. #709

Merged
merged 4 commits into from
Oct 13, 2019

Conversation

thet
Copy link
Member

@thet thet commented Oct 3, 2019

Fixes #708

@thet thet added the bug label Oct 3, 2019
@thet thet requested review from icemac and dataflake October 3, 2019 09:33
@d-maurer
Copy link
Contributor

d-maurer commented Oct 3, 2019 via email

@thet
Copy link
Member Author

thet commented Oct 3, 2019

@d-maurer tnx for the explanation! I couldn't find any references to LineError. IMO Exception is sufficient here, even it's normally bad practice to use such an generic Exception type.

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.

Congratulations to finding and fixing a 15 year old bug!

The PR looks mostly LGTM, I added some change suggestions.

CHANGES.rst Outdated
@@ -9,6 +9,7 @@ https://github.com/zopefoundation/Zope/blob/4.x/CHANGES.rst
5.0a1 (unreleased)
------------------

- Fix VirtualHostMonster not being able to set mappings under Python 3. Fixes #708
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Fix VirtualHostMonster not being able to set mappings under Python 3. Fixes #708
- Fix VirtualHostMonster not being able to set mappings under Python 3.
(`#708 <https://github.com/zopefoundation/Zope/issues/708>`_)

@@ -104,7 +104,7 @@ def set_map(self, map_text, RESPONSE=None):
if hostname not in host_map:
host_map[hostname] = {}
host_map[hostname][port] = pp
except 'LineError' as msg:
except Exception as msg:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
except Exception as msg:
except ValueError as msg:

This would restore the original behavior. (See my other comment.)

@icemac
Copy link
Member

icemac commented Oct 8, 2019

Additionally the pylint errors should be fixed.

@dataflake dataflake self-assigned this Oct 13, 2019
@dataflake dataflake added this to In progress in Zope 5.0 via automation Oct 13, 2019
@dataflake dataflake added this to In progress in Zope 4 bugfix via automation Oct 13, 2019
@dataflake dataflake modified the milestones: 4.1.3, 5.0 Oct 13, 2019
@dataflake dataflake merged commit ccdd919 into master Oct 13, 2019
Zope 5.0 automation moved this from In progress to Done Oct 13, 2019
Zope 4 bugfix automation moved this from In progress to Done Oct 13, 2019
@dataflake dataflake deleted the bugfix/708 branch October 13, 2019 15:59
dataflake added a commit that referenced this pull request Oct 13, 2019
…#709)

* Fix VirtualHostMonster not being able to set mappings under Python 3.
Fixes #708

* - Exception conversion lost in the merge

* - fix linting error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Zope 4 bugfix
  
Done
Zope 5.0
  
Done
Development

Successfully merging this pull request may close these issues.

VHM mappings can't be set
4 participants