Added
- Add support for Python 3.13.
- Add support for Python 3.14.
- Add support for optional Markdown-formatted
selftextwhen submitting link, image,
gallery, and video posts. - Add a :ref:
migration guide <praw8_migration>covering all breaking changes in PRAW
8. - Add :class:
.Mediaand its subclasses :class:.EmojiMedia, :class:.PostMedia,
:class:.StylesheetAsset, :class:.StylesheetImage, and :class:.WidgetMediato
consolidate media uploads. Media can be constructed from a file path, or from
bytescontent along with aname, so media no longer has to be written to disk
before uploading. - :class:
.Announcementand :class:.AnnouncementHelper, exposed as
:attr:.Reddit.announcements, for listing, hiding, and marking the currently
authenticated user's announcements as read. Provides :meth:.Announcement.hide,
:meth:.Announcement.mark_read, :meth:.AnnouncementHelper.hide,
:meth:.AnnouncementHelper.mark_read, and :meth:.AnnouncementHelper.mark_all_read.
:attr:.Announcement.sent_datetimeand :attr:.Announcement.read_datetimereturn the
announcement'ssent_atandread_attimestamps as timezone-aware
:class:datetime.datetimeobjects (read_datetimeisNonefor unread
announcements). - :meth:
.Redditor.overviewto iterate over a Redditor's combined comments and
submissions, mirroring the user overview page on Reddit. - An
exception_handlerkeyword argument to :func:.stream_generator(and thus all
streammethods) that is invoked with any exception raised while fetching items,
allowing the stream to resume rather than terminate. Re-raise from the handler to stop
the stream. - :attr:
~.Comment.created_datetimeto objects with a creation time (for example
:class:.Comment, :class:.Submission, :class:.Redditor, :class:.Subreddit,
:class:.Collection, and :class:.ModNote), returning a timezone-aware
:class:datetime.datetime. - :attr:
~.Collection.updated_datetimeto :class:.Collection,
:attr:~.PollData.voting_end_datetimeto :class:.PollData, and
:attr:~.Comment.edited_datetimeto :class:.Commentand :class:.Submission
(Nonewhen the object has not been edited), all returning timezone-aware
:class:datetime.datetimeobjects. - Warn when a
praw.iniin the current working directory sets theoauth_urlor
reddit_urlendpoint, as such a file can redirect credentials to an untrusted host.
The warning can be silenced by setting thePRAW_ALLOW_ENDPOINT_OVERRIDE
environment variable. - A
py.typedmarker (:PEP:561) so that downstream projects can type check against
PRAW's inline annotations.
Changed
-
Bumped prawcore to 3.0.2.
-
Drop support for Python 3.8, which was end-of-life on 2024-10-07.
-
Drop support for Python 3.9, which was end-of-life on 2025-10-31.
-
Change
Reddit.user.meto raise :class:.ReadOnlyExceptionwhen called in
:attr:.read_onlymode. -
The
subredditattribute of :class:.Redditoris a :class:.UserSubreddit
instance. -
The
dataargument toObjector.objectifymust now be passed by keyword. -
The
mark_readargument tosubreddit.modmail(:class:.ModmailConversation)
must now be passed by keyword. -
The
flair_typeargument to :class:.SubredditFlairTemplatesmust be passed by
keyword. -
The
selftextandurlarguments to :meth:.Subreddit.submitare no longer
mutually exclusive. Whenurlis providedselftextwill be used as optional
body text to accompany the link submission. An exception is raised when trying to use
inline_mediawithselftextfor aurlsubmission because Reddit does not
support inline media in body text for link submissions. -
Subreddit.submit_video,Subreddit.submit_gallery, and
Subreddit.submit_imagenow accept an optional Markdown-formattedselftext
parameter. -
The
reason_idargument to :class:.RemovalReasonhas been renamed toid. -
Media upload methods now accept :class:
.Mediainstances instead of file paths:- The
image_pathargument to :meth:.SubredditEmoji.addhas been replaced by
media, which takes an :class:.EmojiMediainstance. - The
image_patharguments to the :class:.SubredditStylesheetupload_*
methods have been replaced bymedia, which must be passed positionally.
:meth:.SubredditStylesheet.upload, :meth:.upload_header,
:meth:.upload_mobile_header, and :meth:.upload_mobile_icontake a
:class:.StylesheetImageinstance, while :meth:.upload_banner,
:meth:.upload_banner_additional_image, :meth:.upload_banner_hover_image, and
:meth:.upload_mobile_bannertake a :class:.StylesheetAssetinstance. - The
file_pathargument to :meth:.SubredditWidgetsModeration.upload_imagehas
been replaced bymedia, which takes a :class:.WidgetMediainstance and must be
passed positionally. - The
pathargument to :class:.InlineMedia(:class:.InlineGif,
:class:.InlineImage, and :class:.InlineVideo) has been replaced bymedia,
which takes a :class:.PostMediainstance.
- The
-
An unknown media type now raises :class:
.ClientExceptionwhen uploading media,
instead of falling back to JPEG. -
Media uploads to Reddit's S3 buckets now respect the configured
timeoutand raise
prawcore.RequestExceptionon transport errors, consistent with all other requests,
instead of having no timeout and raising rawrequestsexceptions. -
Subreddit.submit_gallery,Subreddit.submit_image,Subreddit.submit_poll,
andSubreddit.submit_videohave been merged into :meth:.Subreddit.submit. The
kind of submission is selected with thegallery,image,poll,url, or
videokeyword argument. At least one of those, orselftext, must be provided,
and they are mutually exclusive, whileselftextmay accompany any of them as
optional Markdown-formatted body text.imagetakes a :class:.PostMediainstance;
gallerytakes a list of :class:.PostMediainstances ordict\ s with a
mediakey;videotakes a :class:.PostMediainstance or adictwith a
mediakey and optionalgifandthumbnailkeys; andpolltakes a
dictwithdurationandoptionskeys.selftextis no longer required
for poll submissions. -
Require
prawcore >=3.2, <4for its public :class:!Sessionand authorizer
accessors and the widened :meth:!Session.requestannotations, which let PRAW drop a
number of internalcast\ s and type-checker suppressions. -
Constrain the
websocket-clientdependency to<2to avoid silently adopting a
future, potentially breaking, major release. -
Require
update_checker >=1.0, <2.0and callupdate_checkwith keyword
arguments. The 1.0 release is dependency-free. -
:meth:
.Submission.add_fetch_paramnow raises :class:.ClientExceptionwhen called
on a submission that has already been fetched, rather than logging a warning, since
the added parameters would have no effect. -
The
comment_sortandcomment_limitattributes of a :class:.Submissionmust
now be set before the submission is fetched; setting either after the submission has
been fetched raises :class:.ClientExceptioninstead of logging a warning. -
Require
prawcore >=4, <5. -
Split
praw/models/reddit/subreddit.pyinto apraw.models.reddit.subreddit
package, with :class:.Subredditand each of its helper classes (:class:.Modmail,
:class:.SubredditFilters, :class:.SubredditFlair, :class:.SubredditModeration,
:class:.SubredditQuarantine, :class:.SubredditRelationship,
:class:.SubredditStream, :class:.SubredditStylesheet, :class:.SubredditWiki, and
their related classes) moved to dedicated modules. All classes remain importable from
praw.models.reddit.subredditandpraw.modelsfor backwards compatibility. See
the :ref:migration guide <praw8_migration>for the full mapping.
Fixed
- Fix API endpoint for :meth:
.Submission.hideand :meth:.Submission.unhide. - Fix
TypeErrorwhen objectifying a response whosejson.errorsfield isnull
rather than an empty list (e.g.api/hide).
Removed
- Remove
Reddit.random_subreddit,Subreddit.random, and
Subreddit.random_rising. - Remove
APIExceptionclass. - Remove
Comment.awardandSubmission.awardmethods. - Remove
Comment.gild,Redditor.gild, andSubmission.gildmethods. - Remove
Redditor.gildedandSubreddit.gildedmethods. - Remove
Redditor.gildingsmethod. - Remove
Subreddit.mod.inbox,Subreddit.mod.unread, and
Subreddit.mod.stream.unreadmethods. - Remove
Subreddits.search_by_topicmethod. - Remove
Subreddits.goldmethod. - Remove :class:
.Redditkeyword argumenttoken_managerand all associated token
managers. - Remove
Reddit.validate_on_submitconfiguration attribute. - Remove
WebSocketException.original_exceptionmethod. - Remove the
afterargument for :meth:.conversations. - Remove key
reset_timestampfrom :meth:.limits. - Remove
SubredditMessage.muteandSubredditMessage.unmutemethods. - Remove
InboxableMixin.unblock_subredditmethod. - The
warn_additional_fetch_paramsconfiguration option, which is obsolete now that
adding fetch parameters to an already-fetched submission raises
:class:.ClientException. - The
warn_comment_sortconfiguration option, which is obsolete now that setting
comment_sortorcomment_limitafter the comments have been fetched raises
:class:.ClientException.