[wp-trac] [WordPress Trac] #53334: Update Requests library to version 1.8.1

WordPress Trac noreply at wordpress.org
Sun Jun 6 16:16:00 UTC 2021


#53334: Update Requests library to version 1.8.1
--------------------------------+-----------------------------
 Reporter:  jrf                 |       Owner:  SergeyBiryukov
     Type:  task (blessed)      |      Status:  closed
 Priority:  normal              |   Milestone:  5.8
Component:  External Libraries  |     Version:  trunk
 Severity:  normal              |  Resolution:  fixed
 Keywords:  has-patch           |     Focuses:
--------------------------------+-----------------------------

Comment (by jrf):

 > So it looks like updating the VERSION constant would be the only change
 here, other fixes from 1.8.1 are all in the files not included in
 WordPress core.

 Sounds about right 😁


 > It also looks like this line should not be removed from
 Requests/Utility/FilteredIterator.php:
 > {{{
 > @phpcs:disable
 PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.MethodDoubleUnderscore
 > }}}
 > Removing that causes the PHP compatibility task to fail:
 > {{{
 > Run phpcs --standard=phpcompat.xml.dist -q --report=checkstyle | cs2pr
 > Warning: Method name "Requests_Utility_FilteredIterator::__unserialize"
 is discouraged; PHP has > reserved all method names with a double
 underscore prefix for future use.
 > Error: Process completed with exit code 1.
 > }}}
 > This should probably be reported upstream. cc @jrf


 @SergeyBiryukov I've looked into this. Both ignore annotations are correct
 based on the individual project environments.

 Requests is already using PHPCS 3.6.0, while WP is still on PHPCS 3.5.5.

 The `PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames`
 sniff uses a list maintained in PHPCS itself to determine which method
 names are "magic" and to exclude those from being reported by the sniff.

 The method name `__unserialize` became a magic method in PHP 7.4.

 The list with magic method names in PHPCS was updated for the PHP 7.4
 change in PHPCS 3.5.6.
 https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.5.6

 Conclusion: once WP updates the locked PHPCS version, that particular
 annotation can be removed from the file in WP as well.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53334#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list