============= Release Notes ============= Version 1.4 (in development) ============================ Version 1.3 =========== Breaking changes ---------------- * To prevent malicious web servers from reading arbitrary files from the client, files must now be opened explicitly by the user in order to upload their contents in form submission. For example, instead of: browser["upload"] = "/path/to/file" you would now use: browser["upload"] = open("/path/to/file", "rb") This remediates `CVE-2023-34457 `__. Our thanks to @e-c-d for reporting and helping to fix the vulnerability! Main changes ------------ * Added support for Python 3.11. * Allow submitting a form with no submit element. This can be achieved by passing ``submit=False`` to ``StatefulBrowser.submit_selected``. Thanks @alexreg! [`#480 `__] Bug fixes --------- * When uploading a file, only the filename is now submitted to the server. Previously, the full file path was being submitted, which exposed more local information than users may have been expecting. [`#375 `__] Version 1.1 =========== Main changes ------------ * Dropped support for EOL Python versions: 2.7 and 3.5. * Increased minimum version requirement for requests from 2.0 to 2.22.0 and beautifulsoup4 from 4.4 to 4.7. * Use encoding from the HTTP request when no HTML encoding is specified. [`#355 `__] * Added the ``put`` method to the ``Browser`` class. This is a light wrapper around ``requests.Session.put``. [`#359 `__] * Don't override ``Referer`` headers passed in by the user. [`#364 `__] * ``StatefulBrowser`` methods ``follow_link`` and ``download_link`` now support passing a dictionary of keyword arguments to ``requests``, via ``requests_kwargs``. For symmetry, they also support passing Beautiful Soup args in as ``bs4_kwargs``, although any excess ``**kwargs`` are sent to Beautiful Soup as well, just as they were previously. [`#368 `__] Version 1.0 =========== This is the last release that will support Python 2.7. Thanks to the many contributors that made this release possible! Main changes: ------------- * Added support for Python 3.8 and 3.9. * ``StatefulBrowser`` has new properties ``page``, ``form``, and ``url``, which can be used in place of the methods ``get_current_page``, ``get_current_form`` and ``get_url`` respectively (e.g. the new ``x.page`` is equivalent to ``x.get_current_page()``). These methods may be deprecated in a future release. [`#175 `__] * ``StatefulBrowser.form`` will raise an ``AttributeError`` instead of returning ``None`` if no form has been selected yet. Note that ``StatefulBrowser.get_current_form()`` still returns ``None`` for backward compatibility. Bug fixes --------- * Decompose ```` element. Bug fixes --------- * Checking checkboxes with ``browser["name"] = ("val1", "val2")`` now unchecks all checkbox except the ones explicitly specified. * ``StatefulBrowser.submit_selected`` and ``StatefulBrowser.open`` now reset __current_page to None when the result is not an HTML page. This fixes a bug where __current_page was still the previous page. * We don't error out anymore when trying to uncheck a box which doesn't have a ``checkbox`` attribute. * ``Form.new_control`` now correctly overrides existing elements. Internal changes ---------------- * The testsuite has been further improved and reached 100% coverage. * Tests are now run against the local version of MechanicalSoup, not against the installed version. * ``Browser.add_soup`` will now always attach a *soup*-attribute. If the response is not text/html, then soup is set to None. * ``Form.set(force=True)`` creates an ```` element instead of an ````. Version 0.8 =========== Main changes: ------------- * `Browser` and `StatefulBrowser` can now be configured to raise a `LinkNotFound` exception when encountering a 404 Not Found error. This is activated by passing `raise_on_404=True` to the constructor. It is disabled by default for backward compatibility, but is highly recommended. * `Browser` now has a `__del__` method that closes the current session when the object is deleted. * A `Link` object can now be passed to `follow_link`. * The user agent can now be customized. The default includes `MechanicalSoup` and its version. * There is now a direct interface to the cookiejar in `*Browser` classes (`(set|get)_cookiejar` methods). * This is the last MechanicalSoup version supporting Python 2.6 and 3.3. Bug fixes: ---------- * We used to crash on forms without action="..." fields. * The `choose_submit` method has been fixed, and the `btnName` argument of `StatefulBrowser.submit_selected` is now a shortcut for using `choose_submit`. * Arguments to `open_relative` were not properly forwarded. Internal changes: ----------------- * The testsuite has been greatly improved. It now uses the pytest API (not only the `pytest` launcher) for more concise code. * The coverage of the testsuite is now measured with codecov.io. The results can be viewed on: https://codecov.io/gh/hickford/MechanicalSoup * We now have a requires.io badge to help us tracking issues with dependencies. The report can be viewed on: https://requires.io/github/hickford/MechanicalSoup/requirements/ * The version number now appears in a single place in the source code. Version 0.7 =========== see Git history, no changelog sorry.