[wp-trac] [WordPress Trac] #54504: Update Requests library to version 2.0.0

WordPress Trac noreply at wordpress.org
Wed Nov 30 14:51:27 UTC 2022


#54504: Update Requests library to version 2.0.0
-------------------------------------------------+-------------------------
 Reporter:  jrf                                  |       Owner:
                                                 |  hellofromTonya
     Type:  task (blessed)                       |      Status:  assigned
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  External Libraries                   |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  php80 php81 has-patch has-unit-      |     Focuses:
  tests early early-like-actually-early          |
-------------------------------------------------+-------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:85 hellofromTonya]:
 > #54582: Juliette and I discussed a workaround by:
 >    * Retaining the original files with redirect code (i.e. the strategy
 @SergeyBiryukov did with other files, such as renaming `wp-db.php` to
 `class-wpdb.php` #56268 / [53749], [53750], [53755], [53756]).
 >    * Using Requests 2.x folder structure by loading the new library into
 `src/wp-includes/Requests/src/`.
 >
 > #54562 Fatal errors from old code not loaded into memory before
 upgrading. This is solvable by preloading the old files into memory.

 Thinking about this some more:
 * Using the `wp-includes/Requests/src/` directory for Requests 2.x should
 indeed work around #54562, as the `$_old_files` array would no longer have
 conflicting file names on case-insensitive filesystems.
 * Preloading Requests 1.x files into memory should resolve #54546. In that
 ticket, a [comment:40:ticket:54546 fatal error happened] when cURL timed
 out and attempted to throw an exception when its file had not yet been
 loaded into memory. The exception class was changed, which would be
 handled by the "to" version autoloader but was not recognized by the
 "from" version autoloader in memory.

 With the proposed plan, unless I'm missing something, the "from" and "to"
 Requests versions should no longer conflict, and the old version can be
 safely deleted as part of the general `$_old_files` cleanup after the
 update.

 So I was wondering, do we still need to keep the old files in that case?
 Is it for plugins that may have included them directly? Or is there a
 scenario where preloading Requests 1.x files into memory before the update
 is not enough, and they are still needed after the update?

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


More information about the wp-trac mailing list