Commit a7c11bcf authored by Andreas Zeidler's avatar Andreas Zeidler

Merged revisions 80850-81880 via svnmerge from

svn+ssh://svn.zope.org/repos/main/Zope/branches/2.10

........
  r80942 | andreasjung | 2007-10-20 13:33:36 +0200 (Sat, 20 Oct 2007) | 4 lines
  
        - Collector #151020: HTTP_CHAR_SET headers containing 'x-user-defined'
          caused a LookupError exception. Unknown encodings are from now on
          silently discarded.
........
  r80944 | andreasjung | 2007-10-20 13:37:27 +0200 (Sat, 20 Oct 2007) | 2 lines
  
  collector -> Launchpad
........
  r81167 | hannosch | 2007-10-28 10:40:32 +0100 (Sun, 28 Oct 2007) | 2 lines
  
  Backported discouraged warning for manage_* events from trunk
........
  r81176 | andreasjung | 2007-10-29 14:08:34 +0100 (Mon, 29 Oct 2007) | 2 lines
  
  preparing 2.10.5
........
  r81816 | wichert | 2007-11-13 10:20:30 +0100 (Tue, 13 Nov 2007) | 1 line
  
  Base the default location of softwarehome on Zope2, which is guaranteed not to be a namespace but always located inside the Zope2 software home. This fixes Zope2 breaking on systems which uses namespace packages for Products.*
........
parent 76338da2
...@@ -8,7 +8,14 @@ Zope Changes ...@@ -8,7 +8,14 @@ Zope Changes
- Backported feature from Zope 2.11 to support named temporary files. - Backported feature from Zope 2.11 to support named temporary files.
Zope 2.10.5 (unreleased) Zope 2.10.5 (2007/10/30)
Other changes
- Turned deprecation warnings for manage_afterAdd, manage_beforeDelete
and manage_afterClone methods into discouraged warnings. These methods
will not be removed in Zope 2.11, but stay for the foreseeable future.
Using events is still highly encouraged.
Bugs fixed Bugs fixed
...@@ -33,6 +40,10 @@ Zope Changes ...@@ -33,6 +40,10 @@ Zope Changes
- Collector #2339: ZPT: fixed unicode issue when using the 'structure' - Collector #2339: ZPT: fixed unicode issue when using the 'structure'
directive directive
- Launchpad #151020: HTTP_CHAR_SET headers containing 'x-user-defined'
caused a LookupError exception. Unknown encodings are from now on
silently discarded.
Zope 2.10.4 (2007/06/23) Zope 2.10.4 (2007/06/23)
Other changes Other changes
......
ZOPEVERSION = 2.10.4-final ZOPEVERSION = 2.10.5-final
ZOPEDIRNAME := Zope-$(ZOPEVERSION) ZOPEDIRNAME := Zope-$(ZOPEVERSION)
ZOPE_REQUIRED_FILES=tmp/$(ZOPEDIRNAME).tgz ZOPE_REQUIRED_FILES=tmp/$(ZOPEDIRNAME).tgz
......
ZOPE_MAJOR_VERSION = '2.10' ZOPE_MAJOR_VERSION = '2.10'
ZOPE_MINOR_VERSION = '4' ZOPE_MINOR_VERSION = '5'
ZOPE_BRANCH_NAME = '$Name$'[6:] or 'no-branch' ZOPE_BRANCH_NAME = '$Name$'[6:] or 'no-branch'
# always start prerelease branches with '0' to avoid upgrade # always start prerelease branches with '0' to avoid upgrade
......
...@@ -26,7 +26,8 @@ from App.Common import package_home ...@@ -26,7 +26,8 @@ from App.Common import package_home
try: try:
home = os.environ['SOFTWARE_HOME'] home = os.environ['SOFTWARE_HOME']
except KeyError: except KeyError:
home = os.path.abspath(package_home(Products.__dict__)) import Zope2
home = os.path.abspath(package_home(Zope2.__dict__))
home, e = os.path.split(home) home, e = os.path.split(home)
d, e = os.path.split(home) d, e = os.path.split(home)
......
...@@ -272,24 +272,21 @@ class CopyContainer(ExtensionClass.Base): ...@@ -272,24 +272,21 @@ class CopyContainer(ExtensionClass.Base):
try: try:
orig_container._delObject(orig_id, suppress_events=True) orig_container._delObject(orig_id, suppress_events=True)
except TypeError: except TypeError:
# BBB: removed in Zope 2.11
orig_container._delObject(orig_id) orig_container._delObject(orig_id)
warnings.warn( warnings.warn(
"%s._delObject without suppress_events is deprecated " "%s._delObject without suppress_events is discouraged."
"and will be removed in Zope 2.11." % % orig_container.__class__.__name__,
orig_container.__class__.__name__, DeprecationWarning) DeprecationWarning)
ob = aq_base(ob) ob = aq_base(ob)
ob._setId(id) ob._setId(id)
try: try:
self._setObject(id, ob, set_owner=0, suppress_events=True) self._setObject(id, ob, set_owner=0, suppress_events=True)
except TypeError: except TypeError:
# BBB: removed in Zope 2.11
self._setObject(id, ob, set_owner=0) self._setObject(id, ob, set_owner=0)
warnings.warn( warnings.warn(
"%s._setObject without suppress_events is deprecated " "%s._setObject without suppress_events is discouraged."
"and will be removed in Zope 2.11." % % self.__class__.__name__, DeprecationWarning)
self.__class__.__name__, DeprecationWarning)
ob = self._getOb(id) ob = self._getOb(id)
notify(ObjectMovedEvent(ob, orig_container, orig_id, self, id)) notify(ObjectMovedEvent(ob, orig_container, orig_id, self, id))
...@@ -362,11 +359,9 @@ class CopyContainer(ExtensionClass.Base): ...@@ -362,11 +359,9 @@ class CopyContainer(ExtensionClass.Base):
try: try:
self._delObject(id, suppress_events=True) self._delObject(id, suppress_events=True)
except TypeError: except TypeError:
# BBB: removed in Zope 2.11
self._delObject(id) self._delObject(id)
warnings.warn( warnings.warn(
"%s._delObject without suppress_events is deprecated " "%s._delObject without suppress_events is discouraged." %
"and will be removed in Zope 2.11." %
self.__class__.__name__, DeprecationWarning) self.__class__.__name__, DeprecationWarning)
ob = aq_base(ob) ob = aq_base(ob)
ob._setId(new_id) ob._setId(new_id)
...@@ -376,11 +371,9 @@ class CopyContainer(ExtensionClass.Base): ...@@ -376,11 +371,9 @@ class CopyContainer(ExtensionClass.Base):
try: try:
self._setObject(new_id, ob, set_owner=0, suppress_events=True) self._setObject(new_id, ob, set_owner=0, suppress_events=True)
except TypeError: except TypeError:
# BBB: removed in Zope 2.11
self._setObject(new_id, ob, set_owner=0) self._setObject(new_id, ob, set_owner=0)
warnings.warn( warnings.warn(
"%s._setObject without suppress_events is deprecated " "%s._setObject without suppress_events is discouraged." %
"and will be removed in Zope 2.11." %
self.__class__.__name__, DeprecationWarning) self.__class__.__name__, DeprecationWarning)
ob = self._getOb(new_id) ob = self._getOb(new_id)
......
...@@ -68,10 +68,8 @@ def maybeWarnDeprecated(ob, method_name): ...@@ -68,10 +68,8 @@ def maybeWarnDeprecated(ob, method_name):
return return
class_ = ob.__class__ class_ = ob.__class__
warnings.warn( warnings.warn(
"%s.%s.%s is deprecated and will be removed in Zope 2.11, " "%s.%s.%s is discouraged. You should use event subscribers instead." %
"you should use event subscribers instead, and meanwhile " (class_.__module__, class_.__name__, method_name),
"mark the class with <five:deprecatedManageAddDelete/>"
% (class_.__module__, class_.__name__, method_name),
DeprecationWarning) DeprecationWarning)
################################################## ##################################################
......
...@@ -131,6 +131,15 @@ class ZPTUnicodeEncodingConflictResolution(ZopeTestCase): ...@@ -131,6 +131,15 @@ class ZPTUnicodeEncodingConflictResolution(ZopeTestCase):
result = zpt.pt_render() result = zpt.pt_render()
self.assertEqual(result.startswith(unicode('<div></div>', 'iso-8859-15')), True) self.assertEqual(result.startswith(unicode('<div></div>', 'iso-8859-15')), True)
def testBug151020(self):
manage_addPageTemplate(self.app, 'test',
text='<div tal:content="python: request.get(\'data\')" />',
encoding='ascii')
zpt = self.app['test']
self.app.REQUEST.set('HTTP_ACCEPT_CHARSET', 'x-user-defined, iso-8859-15')
self.app.REQUEST.set('data', unicode('', 'iso-8859-15').encode('utf-8'))
result = zpt.pt_render()
self.assertEqual(result.startswith(unicode('<div></div>', 'iso-8859-15')), False)
class ZopePageTemplateFileTests(ZopeTestCase): class ZopePageTemplateFileTests(ZopeTestCase):
......
...@@ -84,7 +84,7 @@ class PreferredCharsetResolver: ...@@ -84,7 +84,7 @@ class PreferredCharsetResolver:
try: try:
return unicode(text, enc) return unicode(text, enc)
except UnicodeDecodeError: except (LookupError, UnicodeDecodeError):
pass pass
return text return text
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment