diff --git a/readthedocs/misc/changelog.rst b/readthedocs/misc/changelog.rst index ff0cfb4a..2eab348c 100644 --- a/readthedocs/misc/changelog.rst +++ b/readthedocs/misc/changelog.rst @@ -13,6 +13,45 @@ it can take advantage of new goodies! .. contents:: List of All Versions +Dropped imghdr support (v1.31) +============================== + ++------------------------+ +| Scheme layer used: 165 | ++------------------------+ + +This release contains a breaking change in preparation for Python 3.12. +If you were sending photos from in-memory ``bytes`` or ``BytesIO`` containing images, +you should now use ``BytesIO`` and set the ``.name`` property to a dummy name. +This will allow Telethon to detect the correct extension (and file type). + +.. code-block:: python + + # before + image_data = b'...' + client.send_file(chat, image_data) + + # after + from io import BytesIO + image_data = BytesIO(b'...') + image_data.name = 'a.jpg' # any name, only the extension matters + client.send_file(chat, image_data) + + +Bug fixes +~~~~~~~~~ + +* Code generation wasn't working under PyPy. +* Obtaining markdown or HTML from message text could produce unexpected results sometimes. +* Other fixes for bugs from the previous version, which were already fixed in patch versions. + +Breaking Changes +~~~~~~~~~~~~~~~~ + +* ``imghdr`` is deprecated in newer Python versions, so Telethon no longer uses it. + This means there might be some cases where Telethon fails to infer the file extension for buffers containing images. + If you were relying on this, add ``.name = 'a.jpg'`` (or other extension) to the ``BytesIO`` buffers you upload. + Layer bump and small changes (v1.30) ==================================== diff --git a/telethon/version.py b/telethon/version.py index 832c0ac0..82cc411e 100644 --- a/telethon/version.py +++ b/telethon/version.py @@ -1,3 +1,3 @@ # Versions should comply with PEP440. # This line is parsed in setup.py: -__version__ = '1.30.3' +__version__ = '1.31.0'