PRAW v7.0.0 Release Notes

Release Date: 2020-04-24 // almost 3 years ago
  • โž• Added

    • ๐Ÿ‘ config_interpolation parameter for :class:.Reddit supporting basic and extended modes.
    • โž• Add :meth:.Redditors.partial_redditors that returns lightweight redditor objects that contain only a few fields. This is useful for resolving 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 Confict exception generated by trying to sticky the same post multiple times.
    • A new method 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.
    • 0๏ธโƒฃ 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:.Redditor.moderated instead.