diff --git a/CHANGES.rst b/CHANGES.rst
index fa4b521..511e015 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,7 +4,9 @@
 4.6.2 (unreleased)
 ------------------
 
-- Nothing changed yet.
+- Fix an ``AssertionError`` clearing a non-empty ``PersistentMapping``
+  that has no connection. See `issue 139
+  <https://github.com/zopefoundation/persistent/issues/139>`_.
 
 
 4.6.1 (2020-03-06)
diff --git a/persistent/mapping.py b/persistent/mapping.py
index 57f61fa..a9d07a5 100644
--- a/persistent/mapping.py
+++ b/persistent/mapping.py
@@ -101,7 +101,6 @@ class PersistentMapping(IterableUserDict, persistent.Persistent):
         self.__super_clear()
         if needs_changed:
             self._p_changed = 1
-            assert self._p_changed
 
     def update(self, *args, **kwargs):
         """

AssertionError clearing PersistentMap not added to connection.
```pycon
>>> import persistent.mapping
>>> pm = persistent.mapping.PersistentMapping()
>>> pm['k'] = 'v'
>>> pm.clear()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jmadden/Projects/GithubSources/persistent/persistent/mapping.py", line 104, in clear
    assert self._p_changed
AssertionError
```

This was a bug introduced in https://github.com/zopefoundation/persistent/pull/127 that slipped through review.
diff --git a/persistent/tests/test_mapping.py b/persistent/tests/test_mapping.py
index f932790..75d2395 100644
--- a/persistent/tests/test_mapping.py
+++ b/persistent/tests/test_mapping.py
@@ -273,6 +273,15 @@ class PersistentMappingTests(unittest.TestCase):
         pm.clear()
         self.assertFalse(pm._p_changed)
 
+    def test_clear_no_jar(self):
+        # https://github.com/zopefoundation/persistent/issues/139
+        self._makeOne = self._getTargetClass()
+        self.test_clear_empty()
+
+        pm = self._makeOne(a=42)
+        pm.clear()
+        self.assertFalse(pm._p_changed)
+
     def test_clear_empty_legacy_container(self):
         pm = self._makeOne()
         pm.__dict__['_container'] = pm.__dict__.pop('data')

pip install -e .[test,docs]
parse_log_pytest
pytest
zope.testrunner pytest
apt-get update apt-get install -y gcc
3.9
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.16
babel==2.17.0
certifi==2025.1.31
cffi==1.17.1
charset-normalizer==3.4.1
docutils==0.21.2
exceptiongroup @ file:///croot/exceptiongroup_1706031385326/work
idna==3.10
imagesize==1.4.1
importlib_metadata==8.6.1
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
Jinja2==3.1.6
manuel==1.13.0
MarkupSafe==3.0.2
packaging @ file:///croot/packaging_1734472117206/work
-e git+https://github.com/zopefoundation/persistent.git@ce84010b4c73556620ae8ca8c289d368d5fa1e04#egg=persistent
pluggy @ file:///croot/pluggy_1733169602837/work
pycparser==2.22
Pygments==2.19.1
pytest @ file:///croot/pytest_1738938843180/work
repoze.sphinx.autointerface==1.0.0
requests==2.32.3
snowballstemmer==2.2.0
Sphinx==7.4.7
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
tomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work
urllib3==2.3.0
zipp==3.21.0
zope.exceptions==5.2
zope.interface==7.2
zope.testrunner==7.2

name: persistent
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
  - ca-certificates=2025.2.25=h06a4308_0
  - exceptiongroup=1.2.0=py39h06a4308_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - packaging=24.2=py39h06a4308_0
  - pip=25.0=py39h06a4308_0
  - pluggy=1.5.0=py39h06a4308_0
  - pytest=8.3.4=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tomli=2.0.1=py39h06a4308_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.16
      - babel==2.17.0
      - certifi==2025.1.31
      - cffi==1.17.1
      - charset-normalizer==3.4.1
      - docutils==0.21.2
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==8.6.1
      - jinja2==3.1.6
      - manuel==1.13.0
      - markupsafe==3.0.2
      - pycparser==2.22
      - pygments==2.19.1
      - repoze-sphinx-autointerface==1.0.0
      - requests==2.32.3
      - snowballstemmer==2.2.0
      - sphinx==7.4.7
      - sphinxcontrib-applehelp==2.0.0
      - sphinxcontrib-devhelp==2.0.0
      - sphinxcontrib-htmlhelp==2.1.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==2.0.0
      - sphinxcontrib-serializinghtml==2.0.0
      - urllib3==2.3.0
      - zipp==3.21.0
      - zope-exceptions==5.2
      - zope-interface==7.2
      - zope-testrunner==7.2
prefix: /opt/conda/envs/persistent

persistent/tests/test_mapping.py::PersistentMappingTests::test_clear_no_jar
persistent/tests/test_mapping.py::Test_default::test___get___from_class persistent/tests/test_mapping.py::Test_default::test___get___from_instance persistent/tests/test_mapping.py::PersistentMappingTests::testTheWorld persistent/tests/test_mapping.py::PersistentMappingTests::test___repr___converts_legacy_container_attr persistent/tests/test_mapping.py::PersistentMappingTests::test_clear_empty persistent/tests/test_mapping.py::PersistentMappingTests::test_clear_empty_legacy_container persistent/tests/test_mapping.py::PersistentMappingTests::test_clear_nonempty persistent/tests/test_mapping.py::PersistentMappingTests::test_copy persistent/tests/test_mapping.py::PersistentMappingTests::test_copy_legacy_container persistent/tests/test_mapping.py::PersistentMappingTests::test_update_keywords persistent/tests/test_mapping.py::PersistentMappingTests::test_volatile_attributes_not_persisted persistent/tests/test_mapping.py::Test_legacy_PersistentDict::test_PD_is_alias_to_PM persistent/tests/test_mapping.py::test_suite
persistent/mapping.py CHANGES.rst
persistent/mapping.py CHANGES.rst