Praw

Latest version: v7.8.1

Safety actively analyzes 685670 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 7

7.1.2

------------------

**Fixed**

- Asynchronous check would not work on Python 3.6 as
:py:func:`~asyncio.get_running_loop` only exists on Python 3.7+.

7.1.1

------------------

**Added**

- Add method :meth:`.Subreddits.premium` to reflect the naming change in Reddit's API.
- Ability to submit image galleries with :meth:`~.Subreddit.submit_gallery`.
- Ability to pass a gallery url to :meth:`.Reddit.submission`.
- Ability to specify modmail mute duration.
- Add method :meth:`.invited` to get invited moderators of a subreddit.
- Ability to submit text/self posts with inline media.
- Add method :meth:`.Submission.award` and :meth:`.Comment.award` with the ability to
specify type of award, anonymity, and message when awarding a submission or comment.
- Ability to specify subreddits by name using the `subreddits` parameter in
:meth:`.Reddit.info`.
- A check to see if PRAW is running in an asynchronous environment and will advise the
user to use `Async PRAW <https://asyncpraw.readthedocs.io>`_. This also adds a
configuration option to disable the check.

**Changed**

- Drop support for Python 3.5, which is end-of-life on 2020-09-13.
- :class:`.BoundedSet` will now utilize a Last-Recently-Used (LRU) storing mechanism,
which will change the order in which elements are removed from the set.
- Improved :meth:`~.Subreddit.submit_image` and :meth:`~.Subreddit.submit_video`
performance in slow network environments by removing a race condition when
establishing a websocket connection.

**Deprecated**

- :meth:`.Subreddits.gold` is superseded by :meth:`.Subreddits.premium`.
- :meth:`.Submission.gild` is superseded by :meth:`.Submission.award`.
- :meth:`.Comment.gild` is superseded by :meth:`.Comment.award`.

**Fixed**

- An issue where leaving as a moderator fails if you are using token auth.
- An issue where an incorrect error was being raised due to invalid submission urls.
- Some cases where streams yield the same item multiple times. This cannot be prevented
in every case.

7.1.0

------------------

**Added**

- :class:`.Rule` to represent one rule of a subreddit.
- :class:`.SubredditRules` to get and add rules.
- Ability to submit polls with :meth:`~.Subreddit.submit_poll`.
- :class:`.PollData` and :class:`.PollOption`.
- Ability to view poll data and poll options via the ``.poll_data`` attribute on poll
submissions.
- Add method :meth:`~.Reddit.delete` to :class:`.Reddit` class to support HTTP DELETE
requests.
- Added :class:`.CalendarConfiguration` to represent the configuration of a
:class:`.Calendar` widget.
- Added :class:`.Hover` to represent the hover state of a :class:`.Button`.
- Added :class:`.Styles` to represent widget styling information.
- Ability to stream live thread updates via new class :class:`.LiveThreadStream` with
method :meth:`~.LiveThreadStream.updates`.

**Changed**

- :meth:`.RemovalReason.update`'s parameters are now optional.
- :meth:`.SubredditRemovalReasons.__getitem__` now takes integers and slices to get
removal reasons from the list of reasons as returned by Reddit.

**Deprecated**

- :attr:`.WebSocketException.original_exception` is deprecated and slated for removal in
PRAW 8.0.

**Fixed**

- An issue where certain subreddit settings could not be set through
:meth:`.SubredditModeration.update`, such as ``welcome_message_enabled`` and
``welcome_message_text``. This change also removes the need for PRAW to track current
subreddit settings and send unmodified ones in the update request.
- Instances of ``BadRequest``\ s captured by PRAW that do not contain any detailed JSON
data are re-raised as the original ``BadRequest``.
- :meth:`~.Subreddit.submit_image` and :meth:`~.Subreddit.submit_video` will throw
:class:`.MediaPostFailed` when Reddit fails to post an image or video post.

7.0.0

------------------

**Added**

- ``config_interpolation`` parameter for :class:`.Reddit` supporting basic and extended
modes.
- Add :meth:`.partial_redditors` that returns lightweight redditor objects that contain
only a few fields. This is useful for resolving :class:`.Redditor` IDs to their
usernames in bulk.
- :meth:`.User.friends` has a new parameter ``user`` that takes either an instance of
:class:`.Redditor` or a string containing a redditor name and returns an instance of
:class:`.Redditor` if the authenticated user is friends with the user, otherwise
throws an exception.
- :meth:`.SubmissionModeration.flair` has the parameter ``flair_template_id`` for
applying flairs with template IDs.
- :meth:`.Emoji.update` supports modifying an emoji's permissions.
- :meth:`.SubredditEmoji.add` now supports optionally passing booleans to set an emoji's
permissions upon upload.
- Methods :meth:`.SubredditLinkFlairTemplates.update` and
:meth:`.SubredditRedditorFlairTemplates.update` contain a new parameter, ``fetch``,
that toggles the automatic fetching of existing data from Reddit. It is set to True by
default.
- Values in methods :meth:`.SubredditLinkFlairTemplates.update` and
:meth:`.SubredditRedditorFlairTemplates.update` that are left as the defaults will no
longer be over-written if the ``fetch`` parameter is set to ``True``, but will fill in
existing values for the flair template.
- The parameter ``text`` for methods :meth:`.SubredditLinkFlairTemplates.update` and
:meth:`.SubredditRedditorFlairTemplates.update` is no longer required.
- There is a new method, :meth:`~.Subreddit.post_requirements`, to fetch a subreddit's
post requirements.
- Method :meth:`.SubmissionModeration.sticky` will now ignore the Conflict exception
generated by trying to sticky the same post multiple times.
- A new method :meth:`.CommentModeration.show` will uncollapse a comment that was
collapsed because of Crowd Control
- Methods :meth:`~.Subreddit.submit_image` and :meth:`~.Subreddit.submit_video` will
throw :class:`.TooLargeMediaException` if the submitted media is rejected by Reddit
due to the size of the media.
- Class :class:`.Reddit` has an attribute, ``validate_on_submit``, that can be set after
class initialization that causes methods :meth:`~.Subreddit.submit`,
:meth:`~.Subreddit.submit_image`, :meth:`~.Subreddit.submit_video`, and
:meth:`.Submission.edit` to check that the submission matches a subreddit's post
validation rules. This attribute will be functionally useless once Reddit implements
their change. This attribute will be deprecated on the next release after Reddit's
change, and will be removed on the next major release after Reddit's change.

.. warning::

In May-June 2020, Reddit will force all submissions to run through a subreddit's
validation rules.

- Introduced a data class, :class:`.RedditErrorItem`, to represent an individual error
item returned from Reddit.
- Class :class:`.RedditAPIException` now serves as a container for the
:class:`.RedditErrorItem`\ s. You can access the items by doing
``RedditAPIException.items``, which returns a list.
- :class:`.APIException` is an alias to :class:`.RedditAPIException`.
- Parameter ``discussion_type`` to methods :meth:`~.Subreddit.submit`,
:meth:`~.Subreddit.submit_image`, and :meth:`~.Subreddit.submit_video` to support
submitting as a live discussion (set to ``"CHAT"``).
- Instances of :class:`.Trophy` can be compared for equality with each other.
- :class:`.Reddit` has a new configurable parameter, ``timeout``. This defaults to 16
seconds. It controls how long PRAW will wait for a response before throwing an
exception.
- PRAW now handles ratelimit errors returned as instances of
:class:`.RedditAPIException`.
- :class:`.Reddit` has one new parameter, ``ratelimit_seconds`` . The parameter
configures the maximum amount of seconds to catch ratelimits for. It defaults to 5
seconds when not specified.

**Changed**

- ``prawcore.BadRequest`` should no longer be raised. Instead, a more useful
:class:`.RedditAPIException` instance will be raised.
- Set the default comment sort to ``confidence`` instead of ``best`` because it turns
out ``best`` isn't actually the correct value for the parameter.

**Deprecated**

- :class:`.APIException` is deprecated and slated for removal in PRAW 8.0.

**Fixed**

- :meth:`.SubredditFlair.update` will not error out when the flair text contains quote
marks.

**Removed**

- Converting :class:`.APIException` to string will no longer escape unicode characters.
- Module ``praw.models.modaction`` no longer exists. Please use the module
``praw.models.mod_action``, or directly import ``ModAction`` from ``praw.models``.
- Methods :meth:`.SubredditLinkFlairTemplates.update` and
:meth:`.SubredditRedditorFlairTemplates.update` will no longer create flairs that are
using an invalid template id, but instead throw a :class:`.InvalidFlairTemplateID`.
- Method ``reddit.user.moderator_subreddits`` has been removed. Please use
:meth:`.moderated` instead.

6.5.1

------------------

**Fixed**

- Removed usages of ``NoReturn`` that caused PRAW to fail due to ``ImportError`` in
Python ``<3.5.4`` and ``<3.6.2``.

6.5.0

------------------

**Added**

- :meth:`.set_original_content` supports marking a submission as original content.
- :meth:`.unset_original_content` supports unmarking a submission as original content.
- :meth:`.moderated` to get a list of a redditor's moderated subreddits.
- Parameter ``without_websockets`` to :meth:`~.Subreddit.submit_image` and
:meth:`~.Subreddit.submit_video` to submit without using WebSockets.
- :meth:`.Reddit.redditor` supports ``fullname`` param to fetch a :class:`.Redditor` by
the fullname instead of name. :class:`.Redditor` constructor now also has ``fullname``
param.
- Add :class:`.RemovalReason` and :class:`.SubredditRemovalReasons` to work with removal
reasons
- Attribute ``removal_reasons`` to :class:`.SubredditModeration` to interact with new
removal reason classes
- Parameters ``mod_note`` and ``reason_id`` to :meth:`~.ThingModerationMixin.remove` to
optionally apply a removal reason on removal
- Add :class:`.SubredditModerationStream` to enable moderation streams
- Attribute ``stream`` to :class:`.SubredditModeration` to interact with new moderation
streams
- Add :meth:`~.SubredditModerationStream.edited` to allow streaming of
:meth:`.SubredditModeration.edited`
- Add :meth:`~.SubredditModerationStream.log` to allow streaming of
:meth:`.SubredditModeration.log`
- Add :meth:`~.SubredditModerationStream.modmail_conversations` to allow streaming of
:meth:`.Modmail.conversations`
- Add :meth:`~.SubredditModerationStream.modqueue` to allow streaming of
:meth:`.SubredditModeration.modqueue`
- Add :meth:`~.SubredditModerationStream.reports` to allow streaming of
:meth:`.SubredditModeration.reports`
- Add :meth:`~.SubredditModerationStream.spam` to allow streaming of
:meth:`.SubredditModeration.spam`
- Add :meth:`~.SubredditModerationStream.unmoderated` to allow streaming of
:meth:`.SubredditModeration.unmoderated`
- Add :meth:`~.SubredditModerationStream.unread` to allow streaming of
:meth:`.SubredditModeration.unread`
- Parameter ``exclude_before`` to :func:`.stream_generator` to allow
:meth:`~.SubredditModerationStream.modmail_conversations` to work
- Parameters ``allowable_content`` and ``max_emojis`` to
:meth:`~.SubredditRedditorFlairTemplates.add`,
:meth:`~.SubredditLinkFlairTemplates.add`, and
:meth:`~.SubredditFlairTemplates.update`, as well as its child classes.

**Deprecated**

- Method ``reddit.user.moderator_subreddits`` as :meth:`.moderated` provides more
functionality.
- The file for ModActions (``praw/models/modaction.py``) has been moved to
``praw/models/mod_action.py`` and the previous has been deprecated.

**Expected Changes**

- The behavior of ``APIException`` will no longer unicode-escape strings in the next
minor release.

Page 3 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.