File: Remove_support_for_cgi.FieldStorage.patch

package info (click to toggle)
python-wsme 0.12.1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 616 kB
  • sloc: python: 6,064; makefile: 27; javascript: 8
file content (35 lines) | stat: -rw-r--r-- 1,083 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Author: Michael Johnson <johnsomor@gmail.com>
Date: Tue, 08 Oct 2024 20:02:08 +0000
Description: Remove support for cgi.FieldStorage
 The python cgi module is being removed in python 3.13[1].
 .
 This patch removes support for parsing cgi.FieldStorage from wsme File
 objects, removing the dependency on the cgi module from wsme.
 .
 Note: This does not remove the fieldstorage parameter from the File type
 to maintain backward compatibility.
 .
 [1] https://docs.python.org/3/library/cgi.html
Change-Id: Iff145680312c3aba18b5be078fbf1ea32b06080b
Bug-Debian: https://bugs.debian.org/1084594
Origin: upstream, https://review.opendev.org/c/x/wsme/+/931843
Last-Update: 2024-10-09

diff --git a/wsme/rest/args.py b/wsme/rest/args.py
index 855b51a..b34671d 100644
--- a/wsme/rest/args.py
+++ b/wsme/rest/args.py
@@ -1,4 +1,3 @@
-import cgi
 import datetime
 import re
 
@@ -36,8 +35,6 @@
 
 @from_param.when_object(File)
 def filetype_from_param(datatype, value):
-    if isinstance(value, cgi.FieldStorage):
-        return File(fieldstorage=value)
     return File(content=value)