| 1 |
Change Log |
| 2 |
========== |
| 3 |
|
| 4 |
prawcore follows `semantic versioning <http://semver.org/>`_. |
| 5 |
|
| 6 |
2.3.0 (2021-07-26) |
| 7 |
------------------ |
| 8 |
|
| 9 |
**Added** |
| 10 |
|
| 11 |
- 301 redirects result in a ``Redirect`` exception. |
| 12 |
- ``Requestor`` is now initialized with a ``timeout`` parameter. |
| 13 |
- ``ScriptAuthorizer``, ``ReadOnlyAuthorizer``, and ``DeviceIDAuthorizer`` have a |
| 14 |
new parameter, ``scopes``, which determines the scope of access requests. |
| 15 |
- Retry 408 "Request Timeout" HTTP responses. |
| 16 |
|
| 17 |
2.2.0 (2021-06-10) |
| 18 |
------------------ |
| 19 |
|
| 20 |
**Added** |
| 21 |
|
| 22 |
- Support 202 "Accepted" HTTP responses. |
| 23 |
|
| 24 |
**Fixed** |
| 25 |
|
| 26 |
- The expected HTTP response status code for a request made with the proper credentials |
| 27 |
to api/v1/revoke_token has been changed from 204 to 200. |
| 28 |
|
| 29 |
2.1.0 (2021-06-07) |
| 30 |
------------------ |
| 31 |
|
| 32 |
**Added** |
| 33 |
|
| 34 |
- Add a ``URITooLarge`` exception. |
| 35 |
- :class:`.ScriptAuthorizer` has a new parameter ``two_factor_callback`` that supplies |
| 36 |
OTPs (One-Time Passcodes) when :meth:`.ScriptAuthorizer.refresh` is called. |
| 37 |
- Add a ``TooManyRequests`` exception. |
| 38 |
|
| 39 |
2.0.0 (2021-02-23) |
| 40 |
------------------ |
| 41 |
|
| 42 |
**Added** |
| 43 |
|
| 44 |
- ``Authorizer`` optionally takes a ``pre_refresh_callback`` keyword |
| 45 |
argument. If provided, the function will called with the instance of |
| 46 |
``Authorizer`` prior to refreshing the access and refresh tokens. |
| 47 |
- ``Authorizer`` optionally takes a ``post_refresh_callback`` keyword |
| 48 |
argument. If provided, the function will called with the instance of |
| 49 |
``Authorizer`` after refreshing the access and refresh tokens. |
| 50 |
|
| 51 |
**Changed** |
| 52 |
|
| 53 |
- The ``refresh_token`` argument to ``Authorizer`` must now be passed by |
| 54 |
keyword, and cannot be passed as a positional argument. |
| 55 |
|
| 56 |
1.5.0 (2020-08-04) |
| 57 |
------------------ |
| 58 |
|
| 59 |
**Changed** |
| 60 |
|
| 61 |
- Drop support for Python 3.5, which is end-of-life on 2020-09-13. |
| 62 |
|
| 63 |
1.4.0 (2020-05-28) |
| 64 |
------------------ |
| 65 |
|
| 66 |
**Added** |
| 67 |
|
| 68 |
- When calling :meth:`.Session.request`, we add the key-value pair ``"api_type": |
| 69 |
"json"`` to the ``json`` parameter, if it is a ``dict``. |
| 70 |
|
| 71 |
**Changed** |
| 72 |
|
| 73 |
- (Non-breaking) Requests to ``www.reddit.com`` use the ``Connection: close`` header to |
| 74 |
avoid warnings when tokens are refreshed after their one-hour expiration. |
| 75 |
|
| 76 |
1.3.0 (2020-04-23) |
| 77 |
------------------ |
| 78 |
|
| 79 |
**Added** |
| 80 |
|
| 81 |
- All other requestor methods, most notably :meth:`.Session.request`, now contain a |
| 82 |
``timeout`` parameter. |
| 83 |
|
| 84 |
1.2.0 (2020-04-23) |
| 85 |
------------------ |
| 86 |
|
| 87 |
**Added** |
| 88 |
|
| 89 |
- Method ``Requestor.request`` can be given a timeout parameter to control the amount of |
| 90 |
time to wait for a request to succeed. |
| 91 |
|
| 92 |
**Changed** |
| 93 |
|
| 94 |
- Updated rate limit algorithm to more intelligently rate limit when there are extra |
| 95 |
requests remaining. |
| 96 |
|
| 97 |
**Removed** |
| 98 |
|
| 99 |
- Drop python 2.7 support. |
| 100 |
|
| 101 |
1.0.1 (2019-02-05) |
| 102 |
------------------ |
| 103 |
|
| 104 |
**Fixed** |
| 105 |
|
| 106 |
- ``RateLimiter`` will not sleep longer than ``next_request_timestamp``. |
| 107 |
|
| 108 |
1.0.0 (2018-04-26) |
| 109 |
------------------ |
| 110 |
|
| 111 |
I am releasing 1.0.0 as prawcore is quite stable and it's unlikely that any breaking |
| 112 |
changes will need to be introduced in the near future. |
| 113 |
|
| 114 |
**Added** |
| 115 |
|
| 116 |
- Log debug messages for all sleep times. |
| 117 |
|
| 118 |
0.15.0 (2018-03-31) |
| 119 |
------------------- |
| 120 |
|
| 121 |
**Added** |
| 122 |
|
| 123 |
- ``SpecialError`` is raised on HTTP 415. |
| 124 |
|
| 125 |
0.14.0 (2018-02-10) |
| 126 |
------------------- |
| 127 |
|
| 128 |
**Added** |
| 129 |
|
| 130 |
- ``ReadTimeout`` is automatically retried like the server errors. |
| 131 |
|
| 132 |
**Removed** |
| 133 |
|
| 134 |
- Removed support for Python 3.3 as it is no longer supported by requests. |
| 135 |
|
| 136 |
0.13.0 (2017-12-16) |
| 137 |
------------------- |
| 138 |
|
| 139 |
**Added** |
| 140 |
|
| 141 |
- ``UnavailableForLegalReasons`` exception raised when HTTP Response 451 is encountered. |
| 142 |
|
| 143 |
0.12.0 (2017-08-30) |
| 144 |
------------------- |
| 145 |
|
| 146 |
**Added** |
| 147 |
|
| 148 |
- ``BadJSON`` exception for the rare cases that a response that should contain valid |
| 149 |
JSON has unparsable JSON. |
| 150 |
|
| 151 |
0.11.0 (2017-05-27) |
| 152 |
------------------- |
| 153 |
|
| 154 |
**Added** |
| 155 |
|
| 156 |
- ``Conflict`` exception is raised when response status 409 is returned. |
| 157 |
|
| 158 |
0.10.1 (2017-04-10) |
| 159 |
------------------- |
| 160 |
|
| 161 |
**Fixed** |
| 162 |
|
| 163 |
- ``InvalidToken`` is again raised on 401 when a non-refreshable application is in use. |
| 164 |
|
| 165 |
0.10.0 (2017-04-10) |
| 166 |
------------------- |
| 167 |
|
| 168 |
**Added** |
| 169 |
|
| 170 |
- ``ConnectionError`` exceptions are automatically retried. This handles ``Connection |
| 171 |
Reset by Peer`` issues that appear to occur somewhat frequently when running on Amazon |
| 172 |
EC2. |
| 173 |
|
| 174 |
**Changed** |
| 175 |
|
| 176 |
- Calling ``RateLimiter`` now requires a second positional argument, |
| 177 |
``set_header_callback``. |
| 178 |
- In the event a 401 unauthorized occurs, the access token is cleared and the request is |
| 179 |
retried. |
| 180 |
|
| 181 |
**Fixed** |
| 182 |
|
| 183 |
- Check if the access token is expired immediately before every authorized request, |
| 184 |
rather than just before the request flow. This new approach accounts for failure |
| 185 |
retries, and rate limiter delay. |
| 186 |
|
| 187 |
0.9.0 (2017-03-11) |
| 188 |
------------------ |
| 189 |
|
| 190 |
**Added** |
| 191 |
|
| 192 |
- Add ``session`` parameter to Requestor to ease support of custom sessions (e.g. |
| 193 |
caching or mock ones). |
| 194 |
|
| 195 |
0.8.0 (2017-01-29) |
| 196 |
------------------ |
| 197 |
|
| 198 |
**Added** |
| 199 |
|
| 200 |
- Handle 413 Request entity too large responses. |
| 201 |
- ``reset_timestamp`` to ``RateLimiter``. |
| 202 |
|
| 203 |
**Fixed** |
| 204 |
|
| 205 |
- Avoid modifying passed in ``data`` and ``params`` to ``Session.request``. |
| 206 |
|
| 207 |
0.7.0 (2017-01-16) |
| 208 |
------------------ |
| 209 |
|
| 210 |
**Added** |
| 211 |
|
| 212 |
``ChunkedEncodingError`` is automatically retried like the server errors. |
| 213 |
|
| 214 |
0.6.0 (2016-12-24) |
| 215 |
------------------ |
| 216 |
|
| 217 |
**Added** |
| 218 |
|
| 219 |
- Handle 500 responses. |
| 220 |
- Handle Cloudflare 520 responses. |
| 221 |
|
| 222 |
0.5.0 (2016-12-13) |
| 223 |
------------------ |
| 224 |
|
| 225 |
**Added** |
| 226 |
|
| 227 |
All network requests now have a 16 second timeout by default. The environment variable |
| 228 |
``prawcore_timeout`` can be used to adjust the value. |
| 229 |
|
| 230 |
0.4.0 (2016-12-09) |
| 231 |
------------------ |
| 232 |
|
| 233 |
**Changed** |
| 234 |
|
| 235 |
- Prevent '(None)' from appearing in OAuthException message. |
| 236 |
|
| 237 |
0.3.0 (2016-11-20) |
| 238 |
------------------ |
| 239 |
|
| 240 |
**Added** |
| 241 |
|
| 242 |
- Add ``files`` parameter to ``Session.request`` to support image upload operations. |
| 243 |
- Add ``duration`` and ``implicit`` parameters to |
| 244 |
``UntrustedAuthenticator.authorization_url`` so that the method also supports the code |
| 245 |
grant flow. |
| 246 |
|
| 247 |
**Fixed** |
| 248 |
|
| 249 |
- ``Authorizer`` class can be used with ``UntrustedAuthenticator``. |
| 250 |
|
| 251 |
0.2.1 (2016-08-07) |
| 252 |
------------------ |
| 253 |
|
| 254 |
**Fixed** |
| 255 |
|
| 256 |
- ``session`` works with ``DeviceIDAuthorizer`` and ``ImplicitAuthorizer``. |
| 257 |
|
| 258 |
0.2.0 (2016-08-07) |
| 259 |
------------------ |
| 260 |
|
| 261 |
**Added** |
| 262 |
|
| 263 |
- Add ``ImplicitAuthorizer``. |
| 264 |
|
| 265 |
**Changed** |
| 266 |
|
| 267 |
- Split ``Authenticator`` into ``TrustedAuthenticator`` and ``UntrustedAuthenticator``. |
| 268 |
|
| 269 |
0.1.1 (2016-08-06) |
| 270 |
------------------ |
| 271 |
|
| 272 |
**Added** |
| 273 |
|
| 274 |
- Add ``DeviceIDAuthorizer`` that permits installed application access to the API. |
| 275 |
|
| 276 |
0.1.0 (2016-08-05) |
| 277 |
------------------ |
| 278 |
|
| 279 |
**Added** |
| 280 |
|
| 281 |
- ``RequestException`` which wraps all exceptions that occur from ``requests.request`` |
| 282 |
in a ``prawcore.RequestException``. |
| 283 |
|
| 284 |
**Changed** |
| 285 |
|
| 286 |
- What was previously ``RequestException`` is now ``ResponseException``. |
| 287 |
|
| 288 |
0.0.15 (2016-08-02) |
| 289 |
------------------- |
| 290 |
|
| 291 |
**Added** |
| 292 |
|
| 293 |
- Handle Cloudflare 522 responses. |
| 294 |
|
| 295 |
0.0.14 (2016-07-25) |
| 296 |
------------------- |
| 297 |
|
| 298 |
**Added** |
| 299 |
|
| 300 |
- Add ``ServerError`` exception for 502, 503, and 504 HTTP status codes that is only |
| 301 |
raised after three failed attempts to make the request. |
| 302 |
- Add ``json`` parameter to ``Session.request``. |
| 303 |
|
| 304 |
0.0.13 (2016-07-24) |
| 305 |
------------------- |
| 306 |
|
| 307 |
**Added** |
| 308 |
|
| 309 |
- Automatically attempt to refresh access tokens when making a request if the access |
| 310 |
token is expired. |
| 311 |
|
| 312 |
**Fixed** |
| 313 |
|
| 314 |
- Consider access tokens expired slightly earlier than allowed for to prevent |
| 315 |
InvalidToken exceptions from occuring. |
| 316 |
|
| 317 |
0.0.12 (2016-07-17) |
| 318 |
------------------- |
| 319 |
|
| 320 |
**Added** |
| 321 |
|
| 322 |
- Handle 0-byte HTTP 200 responses. |
| 323 |
|
| 324 |
0.0.11 (2016-07-16) |
| 325 |
------------------- |
| 326 |
|
| 327 |
**Added** |
| 328 |
|
| 329 |
- Add a ``NotFound`` exception. |
| 330 |
- Support 404 "Not Found" HTTP responses. |
| 331 |
|
| 332 |
0.0.10 (2016-07-10) |
| 333 |
------------------- |
| 334 |
|
| 335 |
**Added** |
| 336 |
|
| 337 |
- Add a ``BadRequest`` exception. |
| 338 |
- Support 400 "Bad Request" HTTP responses. |
| 339 |
- Support 204 "No Content" HTTP responses. |
| 340 |
|
| 341 |
0.0.9 (2016-07-09) |
| 342 |
------------------ |
| 343 |
|
| 344 |
**Added** |
| 345 |
|
| 346 |
- Support 201 "Created" HTTP responses used in some v1 endpoints. |
| 347 |
|
| 348 |
0.0.8 (2016-03-21) |
| 349 |
------------------ |
| 350 |
|
| 351 |
**Added** |
| 352 |
|
| 353 |
- Sort ``Session.request`` ``data`` values. Sorting the values permits betamax body |
| 354 |
matcher to work as expected. |
| 355 |
|
| 356 |
0.0.7 (2016-03-18) |
| 357 |
------------------ |
| 358 |
|
| 359 |
**Added** |
| 360 |
|
| 361 |
- Added ``data`` parameter to ``Session.request``. |
| 362 |
|
| 363 |
0.0.6 (2016-03-14) |
| 364 |
------------------ |
| 365 |
|
| 366 |
**Fixed** |
| 367 |
|
| 368 |
- prawcore objects can be pickled. |
| 369 |
|
| 370 |
0.0.5 (2016-03-12) |
| 371 |
------------------ |
| 372 |
|
| 373 |
**Added** |
| 374 |
|
| 375 |
- 302 redirects result in a ``Redirect`` exception. |
| 376 |
|
| 377 |
0.0.4 (2016-03-12) |
| 378 |
------------------ |
| 379 |
|
| 380 |
**Added** |
| 381 |
|
| 382 |
- Add a generic ``Forbidden`` exception for 403 responses without the |
| 383 |
``www-authenticate`` header. |
| 384 |
|
| 385 |
0.0.3 (2016-02-29) |
| 386 |
------------------ |
| 387 |
|
| 388 |
**Added** |
| 389 |
|
| 390 |
- Added ``params`` parameter to ``Session.request``. |
| 391 |
- Log requests to the ``prawcore`` logger in debug mode. |
| 392 |
|
| 393 |
0.0.2 (2016-02-21) |
| 394 |
------------------ |
| 395 |
|
| 396 |
**Fixed** |
| 397 |
|
| 398 |
- README.rst for display purposes on pypi. |
| 399 |
|
| 400 |
0.0.1 (2016-02-17) [YANKED] |
| 401 |
--------------------------- |
| 402 |
|
| 403 |
**Added** |
| 404 |
|
| 405 |
- Dynamic rate limiting based on reddit's response headers. |
| 406 |
- Authorization URL generation. |
| 407 |
- Retrieval of access and refresh tokens from authorization grants. |
| 408 |
- Access and refresh token revocation. |
| 409 |
- Retrieval of read-only access tokens. |
| 410 |
- Retrieval of script-app tokens. |
| 411 |
- Three examples in the ``examples/`` directory. |