Skip to content

Commit 0b01c21

Browse files
Add corpus for configparser fuzzer
1 parent bd7761b commit 0b01c21

10 files changed

Lines changed: 405 additions & 0 deletions

File tree

corp-configparser/basic

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
[Foo Bar]
2+
foo{0[0]}bar1
3+
[Spacey Bar]
4+
foo {0[0]} bar2
5+
[Spacey Bar From The Beginning]
6+
foo {0[0]} bar3
7+
baz {0[0]} qwe
8+
[Commented Bar]
9+
foo{0[1]} bar4 {1[1]} comment
10+
baz{0[0]}qwe {1[0]}another one
11+
[Long Line]
12+
foo{0[1]} this line is much, much longer than my editor
13+
likes it.
14+
[Section\\with$weird%characters[\t]
15+
[Internationalized Stuff]
16+
foo[bg]{0[1]} Bulgarian
17+
foo{0[0]}Default
18+
foo[en]{0[0]}English
19+
foo[de]{0[0]}Deutsch
20+
[Spaces]
21+
key with spaces {0[1]} value
22+
another with spaces {0[0]} splat!
23+
[Types]
24+
int {0[1]} 42
25+
float {0[0]} 0.44
26+
boolean {0[0]} NO
27+
123 {0[1]} strange but acceptable
28+
[This One Has A ] In It]
29+
forks {0[0]} spoons
30+
repeated = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
31+
long_multiline =
32+
line 01 of a very long multiline value
33+
line 02 of a very long multiline value
34+
line 03 of a very long multiline value
35+
line 04 of a very long multiline value
36+
line 05 of a very long multiline value
37+
line 06 of a very long multiline value
38+
line 07 of a very long multiline value
39+
line 08 of a very long multiline value
40+
line 09 of a very long multiline value
41+
line 10 of a very long multiline value
42+
[unicode]
43+
japanese = 日本語テスト
44+
korean = 한국어
45+
arabic = مرحبا
46+
emoji = 🎉🐍🔧
47+
math = ∑∫∂√∞
48+
accented = café résumé naïve
49+
zero_width = foo​bar
50+
rtl = שלום
51+
[special chars]
52+
key with spaces = value
53+
key.with.dots = dotted
54+
key-with-dashes = dashed
55+
key_with_underscores = underscored
56+
key/with/slashes = slashed
57+
key+with+plus = plussed
58+
key@with@at = atted
59+
MiXeD_CaSe_KeY = case insensitive lookup
60+
url = https://example.com/path?query=1&other=2
61+
backslash = C:\Users\test\file.txt
62+
quotes = "double quoted value"
63+
single_quotes = 'single quoted value'
64+
empty_quotes = ""
65+
braces = {not interpolation here}
66+
parens = (just parentheses)
67+
brackets = [not a section]
68+
angle = <html>value</html>
69+
pipe = one|two|three
70+
tilde = ~/home/dir
71+
glob = *.txt
72+
dollar_literal = $100
73+
percent_literal = 100%%
74+
equals_in_value = x=1, y=2, z=3
75+
colon_in_value = 12:34:56

corp-configparser/case-sensitivity

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[common]
2+
optionlower = value
3+
OptionUpper = Value
4+
5+
[Common]
6+
optionlower = a better ${common:optionlower}
7+
OptionUpper = A Better ${common:OptionUpper}
8+
9+
[random]
10+
foolower = ${common:optionlower} redefined
11+
FooUpper = ${Common:OptionUpper} Redefined

corp-configparser/comments

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[Commented Bar]
2+
baz=qwe ; a comment
3+
foo: bar # not a comment!
4+
# but this is a comment
5+
; another comment
6+
quirk: this;is not a comment
7+
; a space must precede an inline comment

corp-configparser/converters

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[s]
2+
str = string
3+
int = 1
4+
float = 0.5
5+
list = a b c d e f g
6+
bool = yes
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[common]
2+
favourite Beatle = Paul
3+
favourite color = green
4+
5+
[tom]
6+
favourite band = ${favourite color} day
7+
favourite pope = John ${favourite Beatle} II
8+
sequel = ${favourite pope}I
9+
10+
[ambv]
11+
favourite Beatle = George
12+
son of Edward VII = ${favourite Beatle} V
13+
son of George V = ${son of Edward VII}I
14+
15+
[stanley]
16+
favourite Beatle = ${ambv:favourite Beatle}
17+
favourite pope = ${tom:favourite pope}
18+
favourite color = black
19+
favourite state of mind = paranoid
20+
favourite movie = soylent ${common:favourite color}
21+
favourite song = ${favourite color} sabbath - ${favourite state of mind}

corp-configparser/extensions_win32

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
; This is a list of modules generally build as .pyd files.
2+
;
3+
; Each section contains enough information about a module for
4+
; freeze to include the module as a static, built-in module
5+
; in a frozen .EXE/.DLL.
6+
7+
; This is all setup for all the win32 extension modules
8+
; released by Mark Hammond.
9+
; You must ensure that the environment variable PYTHONEX is set
10+
; to point to the root win32 extensions directory
11+
12+
; PYTHONPREFIX must point to the Python build root directory
13+
; (the *parent* of PCbuild); normally the freeze script takes
14+
; care of this.
15+
16+
17+
18+
19+
20+
;--------------------------------------------------------------
21+
;
22+
; Standard Python extension modules
23+
;
24+
25+
; Here are some of the standard Python extensions modules.
26+
; If you need others, add them here
27+
28+
[_socket]
29+
dsp=%PYTHONPREFIX%\PCbuild\_socket.dsp
30+
31+
[_sre]
32+
dsp=%PYTHONPREFIX%\PCbuild\_sre.dsp
33+
34+
[unicodedata]
35+
dsp=%PYTHONPREFIX%\PCbuild\unicodedata.dsp
36+
37+
[mmap]
38+
dsp=%PYTHONPREFIX%\PCbuild\mmap.dsp
39+
40+
[winsound]
41+
dsp=%PYTHONPREFIX%\PCbuild\winsound.dsp
42+
libs=winmm.lib
43+
44+
[parser]
45+
dsp=%PYTHONPREFIX%\PCbuild\parser.dsp
46+
47+
[select]
48+
dsp=%PYTHONPREFIX%\PCbuild\select.dsp
49+
50+
[zlib]
51+
dsp=%PYTHONPREFIX%\PCbuild\zlib.dsp
52+
cl=/I %PYTHONPREFIX%\..\zlib-1.1.4 /D _WINDOWS /D WIN32
53+
libs=%PYTHONPREFIX%\..\zlib-1.1.4\zlib.lib /nodefaultlib:libc
54+
55+
[winreg]
56+
dsp=%PYTHONPREFIX%\PCbuild\winreg.dsp
57+
libs=advapi32.lib
58+
59+
60+
;--------------------------------------------------------------
61+
;
62+
; Win32 Projects.
63+
;
64+
[perfmon]
65+
dsp=%PYTHONEX%\win32\perfmon.dsp
66+
cl=/I %PYTHONEX%\win32\src
67+
Unicode=1
68+
69+
[pywintypes]
70+
dsp=%PYTHONEX%\win32\pywintypes.dsp
71+
cl=/I %PYTHONEX%\win32\src
72+
libs=ole32.lib oleaut32.lib
73+
74+
[win32api]
75+
dsp=%PYTHONEX%\win32\win32api.dsp
76+
cl=/I %PYTHONEX%\win32\src
77+
libs=kernel32.lib user32.lib shell32.lib advapi32.lib
78+
79+
[win32service]
80+
dsp=%PYTHONEX%\win32\win32service.dsp
81+
cl=/I %PYTHONEX%\win32\src
82+
Unicode=1
83+
libs=advapi32.lib
84+
85+
[win32evtlog]
86+
dsp=%PYTHONEX%\win32\win32evtlog.dsp
87+
cl=/I %PYTHONEX%\win32\src
88+
89+
[win32process]
90+
dsp=%PYTHONEX%\win32\win32process.dsp
91+
cl=/I %PYTHONEX%\win32\src
92+
93+
[win32event]
94+
dsp=%PYTHONEX%\win32\win32event.dsp
95+
cl=/I %PYTHONEX%\win32\src
96+
97+
[win32file]
98+
dsp=%PYTHONEX%\win32\win32file.dsp
99+
cl=/I %PYTHONEX%\win32\src
100+
101+
[win32net]
102+
dsp=%PYTHONEX%\win32\win32net.dsp
103+
cl=/I %PYTHONEX%\win32\src
104+
libs=netapi32.lib
105+
106+
[win32pdh]
107+
dsp=%PYTHONEX%\win32\win32pdh.dsp
108+
cl=/I %PYTHONEX%\win32\src
109+
110+
[win32pipe]
111+
dsp=%PYTHONEX%\win32\win32pipe.dsp
112+
cl=/I %PYTHONEX%\win32\src
113+
114+
[win32security]
115+
dsp=%PYTHONEX%\win32\win32security.dsp
116+
cl=/I %PYTHONEX%\win32\src
117+
118+
[win32service]
119+
dsp=%PYTHONEX%\win32\win32service.dsp
120+
cl=/I %PYTHONEX%\win32\src
121+
122+
[win32trace]
123+
dsp=%PYTHONEX%\win32\win32trace.dsp
124+
cl=/I %PYTHONEX%\win32\src
125+
126+
;--------------------------------------------------------------
127+
;
128+
; COM Projects.
129+
;
130+
131+
[pythoncom]
132+
dsp=%PYTHONEX%\com\win32com.dsp
133+
cl=/I %PYTHONEX%\com\win32com\src\include /I %PYTHONEX%\win32\src
134+
libs=uuid.lib
135+
136+
[win32com.axcontrol.axcontrol]
137+
dsp=%PYTHONEX%\com\axcontrol.dsp
138+
cl=/I %PYTHONEX%\win32\src /I %PYTHONEX%\com\win32com\src\include
139+
140+
[win32com.axscript.axscript]
141+
dsp=%PYTHONEX%\com\Active Scripting.dsp
142+
cl=/I %PYTHONEX%\win32\src /I %PYTHONEX%\com\win32com\src\include
143+
144+
[win32com.axdebug.axdebug]
145+
dsp=%PYTHONEX%\com\Active Debugging.dsp
146+
cl=/I %PYTHONEX%\win32\src /I %PYTHONEX%\com\win32com\src\include
147+
148+
[win32com.mapi.mapi]
149+
dsp=%PYTHONEX%\com\mapi.dsp
150+
cl=/I %PYTHONEX%\win32\src /I %PYTHONEX%\com\win32com\src\include
151+
libs=MBLOGON.lib ADDRLKUP.LIB mapi32.lib version.lib
152+
153+
[win32com.mapi.exchange]
154+
dsp=%PYTHONEX%\com\exchange.dsp
155+
cl=/I %PYTHONEX%\win32\src /I %PYTHONEX%\com\win32com\src\include
156+
libs=MBLOGON.lib ADDRLKUP.LIB exchinst.lib EDKCFG.LIB EDKUTILS.LIB EDKMAPI.LIB mapi32.lib version.lib
157+
158+
[win32com.mapi.exchdapi]
159+
dsp=%PYTHONEX%\com\exchdapi.dsp
160+
cl=/I %PYTHONEX%\win32\src /I %PYTHONEX%\com\win32com\src\include
161+
libs=DAPI.LIB
162+
163+
[servicemanager]
164+
dsp=%PYTHONEX%\win32\PythonService EXE.dsp
165+
Unicode = 1
166+
167+
; Pythonwin
168+
[win32ui]
169+
dsp=%PYTHONEX%\Pythonwin\win32ui.dsp
170+
cl=/D _AFXDLL /D FREEZE_WIN32UI /GX /I %PYTHONEX%\win32\src
171+
libs=mfc42.lib

corp-configparser/interpolation

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[numbers]
2+
one = 1
3+
two = %(one)s * 2
4+
three = ${common:one} * 3
5+
6+
[hexen]
7+
sixteen = ${numbers:two} * 8

corp-configparser/pyrepl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Config file for running mypy on _pyrepl.
2+
# Run mypy by invoking `mypy --config-file Lib/_pyrepl/mypy.ini`
3+
# on the command-line from the repo root
4+
5+
[mypy]
6+
files = Lib/_pyrepl
7+
mypy_path = $MYPY_CONFIG_FILE_DIR/../../Misc/mypy
8+
explicit_package_bases = True
9+
python_version = 3.13
10+
platform = linux
11+
pretty = True
12+
13+
# Enable most stricter settings
14+
enable_error_code = ignore-without-code,redundant-expr
15+
strict = True
16+
17+
# Various stricter settings that we can't yet enable
18+
# Try to enable these in the following order:
19+
disallow_untyped_calls = False
20+
disallow_untyped_defs = False
21+
check_untyped_defs = False
22+
23+
# Various internal modules that typeshed deliberately doesn't have stubs for:
24+
[mypy-_abc.*,_opcode.*,_overlapped.*,_testcapi.*,_testinternalcapi.*,test.*]
25+
ignore_missing_imports = True

corp-configparser/stripping

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[section]
2+
k1 = v1;still v1
3+
k2 = v2 ;a comment
4+
k3 = v3 ; also a comment
5+
k4 = v4;still v4 ;a comment
6+
k5 = v5;still v5 ; also a comment
7+
k6 = v6;still v6; and still v6 ;a comment
8+
k7 = v7;still v7; and still v7 ; also a comment
9+
10+
[multiprefix]
11+
k1 = v1;still v1 #a comment ; yeah, pretty much
12+
k2 = v2 // this already is a comment ; continued
13+
k3 = v3;#//still v3# and still v3 ; a comment

0 commit comments

Comments
 (0)