File tree Expand file tree Collapse file tree
python/ql/test/library-tests/frameworks Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from pathlib import Path , PosixPath , WindowsPath
2+
3+ p = Path ("filepath" )
4+ posix = PosixPath ("posix/filepath" )
5+ windows = WindowsPath ("windows/filepath" )
6+
7+ p .chmod (0o777 ) # $getAPathArgument=p
8+ posix .chmod (0o777 ) # $getAPathArgument=posix
9+ windows .chmod (0o777 ) # $getAPathArgument=windows
10+
11+ with p .open () as f : # $getAPathArgument=p
12+ f .read ()
13+
14+ p .write_bytes (b"hello" ) # $getAPathArgument=p
15+
16+ name = windows .parent .name
17+ o = open
18+ o (name ) # $getAPathArgument=name
19+
20+ wb = p .write_bytes
21+ wb (b"hello" ) # $getAPathArgument=p
Original file line number Diff line number Diff line change 1616
1717io .open ("filepath" ) # $getAPathArgument="filepath"
1818io .open (file = "filepath" ) # $getAPathArgument="filepath"
19-
20- from pathlib import Path , PosixPath , WindowsPath
21-
22- p = Path ("filepath" )
23- posix = PosixPath ("posix/filepath" )
24- windows = WindowsPath ("windows/filepath" )
25-
26- p .chmod (0o777 ) # $getAPathArgument=p
27- posix .chmod (0o777 ) # $getAPathArgument=posix
28- windows .chmod (0o777 ) # $getAPathArgument=windows
29-
30- with p .open () as f : # $getAPathArgument=p
31- f .read ()
32-
33- p .write_bytes (b"hello" ) # $getAPathArgument=p
34-
35- name = windows .parent .name
36- o (name ) # $getAPathArgument=name
37-
38- wb = p .write_bytes
39- wb (b"hello" ) # $getAPathArgument=p
You can’t perform that action at this time.
0 commit comments