File: 0040-path-special-characters.patch

package info (click to toggle)
pagure 5.14.1%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 31,008 kB
  • sloc: python: 125,295; javascript: 22,012; makefile: 208; sh: 191
file content (37 lines) | stat: -rw-r--r-- 1,596 bytes parent folder | download | duplicates (2)
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
36
37
Description: Allow building in paths with version-number characters

werkzeug.secure_filename (called from add_attachment) strips out most
special characters, including some allowed in Debian version numbers

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: no

--- a/tests/test_pagure_flask_ui_issues.py
+++ b/tests/test_pagure_flask_ui_issues.py
@@ -3539,7 +3539,7 @@ class PagureFlaskIssuestests(tests.Model
 
             folder = os.path.dirname(os.path.abspath(__file__))[1:].replace(
                 "/", "_"
-            )
+            ).replace("+", "").replace("~", "").replace(":", "").replace("%", "")
             exp = {
                 "filelocations": [
                     "/test/issue/raw/files/8a06845923010b27bfd8"
@@ -3666,7 +3666,7 @@ class PagureFlaskIssuestests(tests.Model
 
             folder = os.path.dirname(os.path.abspath(__file__))[1:].replace(
                 "/", "_"
-            )
+            ).replace("+", "").replace("~", "").replace(":", "").replace("%", "")
             exp = {
                 "output": "ok",
                 "filelocations": [
@@ -3741,7 +3741,7 @@ class PagureFlaskIssuestests(tests.Model
             "/issue/raw/8a06845923010b27bfd8"
             "e7e75acff7badc40d1021b4994e01f5e11ca40bc3a"
             "be-%s_placebo.png"
-            % os.path.dirname(os.path.abspath(__file__))[1:].replace("/", "_")
+            % os.path.dirname(os.path.abspath(__file__))[1:].replace("/", "_").replace("+", "").replace("~", "").replace(":", "").replace("%", "")
         )
 
         output = self.app.get("/foo" + url)