diff --git a/CHANGES.rst b/CHANGES.rst
index 6848934..f74b382 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -8,6 +8,8 @@ Changes
 
 - Drop support for Python 2.6.
 
+- bugfix: fix leak by converting ``request.URL`` to string in
+  ``ErrorReportingUtility``
 
 4.2.0 (2014-12-27)
 ------------------
diff --git a/src/zope/error/error.py b/src/zope/error/error.py
index eb727f1..48d9a6a 100644
--- a/src/zope/error/error.py
+++ b/src/zope/error/error.py
@@ -188,7 +188,7 @@ class ErrorReportingUtility(Persistent):
                 # TODO: Temporary fix, which Steve should undo. URL is
                 #      just too HTTPRequest-specific.
                 if hasattr(request, 'URL'):
-                    url = request.URL
+                    url = str(request.URL)
                 username = self._getUsername(request)
                 req_html = self._getRequestAsHTML(request)
 

ErrorReportingUtility.raising leaks requests
```
                if hasattr(request, 'URL'):
                    url = request.URL
```
URL is URLGetter, not a simple string

That's a huge issue in tests, every request running into an exception leaves the Request around.
diff --git a/src/zope/error/tests.py b/src/zope/error/tests.py
index 14e632c..486227a 100644
--- a/src/zope/error/tests.py
+++ b/src/zope/error/tests.py
@@ -21,7 +21,7 @@ from zope.exceptions.exceptionformatter import format_exception
 from zope.testing import cleanup
 
 from zope.error.error import ErrorReportingUtility, getFormattedException
-from zope.error._compat import _u_type, PYTHON2
+from zope.error._compat import _u_type, PYTHON2, _basestring
 
 if PYTHON2:
     from cStringIO import StringIO
@@ -56,6 +56,20 @@ class TestRequest(object):
     def items(self):
         return []
 
+    def getURL(self):
+        return self._environ['PATH_INFO']
+
+
+class URLGetter(object):
+
+    __slots__ = "__request"
+
+    def __init__(self, request):
+        self.__request = request
+
+    def __str__(self):
+        return self.__request.getURL()
+
 
 class ErrorReportingUtilityTests(cleanup.CleanUp, unittest.TestCase):
 
@@ -119,6 +133,21 @@ class ErrorReportingUtilityTests(cleanup.CleanUp, unittest.TestCase):
         username = getErrLog[0]['username']
         self.assertEqual(username, u'unauthenticated, \u0441, \u0441, \u0441')
 
+    def test_ErrorLog_url(self):
+        # We want a string for the URL in the error log, nothing else
+        request = TestRequest(environ={'PATH_INFO': '/foobar'})
+        # set request.URL as zope.publisher would
+        request.URL = URLGetter(request)
+
+        errUtility = ErrorReportingUtility()
+        exc_info = getAnErrorInfo(u"Error")
+        errUtility.raising(exc_info, request=request)
+        getErrLog = errUtility.getLogEntries()
+        self.assertEqual(1, len(getErrLog))
+
+        url = getErrLog[0]['url']
+        self.assertTrue(isinstance(url, _basestring))
+
     def test_ErrorLog_nonascii(self):
         # Emulate a unicode url, it gets encoded to utf-8 before it's passed
         # to the request. Also add some unicode field to the request's

pip install -e .[test]
parse_log_pytest
pytest
pytest
3.5
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
certifi==2021.5.30
cffi==1.15.1
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
more-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
persistent==4.9.3
pluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pycparser==2.21
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pytest==6.2.4
six==1.17.0
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
typing_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work
zipp @ file:///tmp/build/80754af9/zipp_1633618647012/work
-e git+https://github.com/zopefoundation/zope.error.git@37e3820202fb84ecac44f3d23e743e8f032d5577#egg=zope.error
zope.event==4.6
zope.exceptions==4.6
zope.interface==5.5.2
zope.location==4.3
zope.proxy==4.6.1
zope.schema==6.2.1
zope.testing==5.0.1

name: zope.error
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=21.4.0=pyhd3eb1b0_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - importlib-metadata=4.8.1=py36h06a4308_0
  - importlib_metadata=4.8.1=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - more-itertools=8.12.0=pyhd3eb1b0_0
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=21.3=pyhd3eb1b0_0
  - pip=21.2.2=py36h06a4308_0
  - pluggy=0.13.1=py36h06a4308_0
  - py=1.11.0=pyhd3eb1b0_0
  - pyparsing=3.0.4=pyhd3eb1b0_0
  - pytest=6.2.4=py36h06a4308_2
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - toml=0.10.2=pyhd3eb1b0_0
  - typing_extensions=4.1.1=pyh06a4308_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.6.0=pyhd3eb1b0_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - cffi==1.15.1
      - persistent==4.9.3
      - pycparser==2.21
      - six==1.17.0
      - zope-event==4.6
      - zope-exceptions==4.6
      - zope-interface==5.5.2
      - zope-location==4.3
      - zope-proxy==4.6.1
      - zope-schema==6.2.1
      - zope-testing==5.0.1
prefix: /opt/conda/envs/zope.error

src/zope/error/tests.py::ErrorReportingUtilityTests::test_ErrorLog_url
src/zope/error/tests.py::ErrorReportingUtilityTests::test_ErrorLog src/zope/error/tests.py::ErrorReportingUtilityTests::test_ErrorLog_nonascii src/zope/error/tests.py::ErrorReportingUtilityTests::test_ErrorLog_unicode src/zope/error/tests.py::ErrorReportingUtilityTests::test_checkForEmptyLog src/zope/error/tests.py::ErrorReportingUtilityTests::test_checkProperties src/zope/error/tests.py::GetPrintableTests::test_getFormattedException src/zope/error/tests.py::GetPrintableTests::test_getFormattedException_as_html src/zope/error/tests.py::GetPrintableTests::test_non_str_those_conversion_fails_are_returned_specially src/zope/error/tests.py::GetPrintableTests::test_non_str_those_conversion_fails_are_returned_with_escaped_name src/zope/error/tests.py::GetPrintableTests::test_non_str_values_get_converted_using_a_str_call src/zope/error/tests.py::GetPrintableTests::test_str_values_get_converted_to_unicode src/zope/error/tests.py::GetPrintableTests::test_xml_tags_get_escaped src/zope/error/tests.py::test_suite
src/zope/error/error.py CHANGES.rst
src/zope/error/error.py CHANGES.rst