File: err_147.py

package info (click to toggle)
python-refurb 1.27.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,700 kB
  • sloc: python: 9,468; makefile: 40; sh: 6
file content (39 lines) | stat: -rw-r--r-- 825 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
36
37
38
39
import os
from os.path import join
from pathlib import Path

# these should match

os.path.join("a")
os.path.join("a", "b")
os.path.join("a", "b", "c")
os.path.join("a", "b", "c", "d")

os.path.join("some_path", "..")
os.path.join("some", "path", "..")
os.path.join("some", "other", "path", "..")
os.path.join("some", "path", "..", "..")
os.path.join("..", "some", "path")

os.path.join(b"a")
os.path.join(b"a", b"b")
os.path.join(b"a", b"b", b"c")
os.path.join(b"a", b"b", b"c", b"d")

os.path.join(b"some_path", b"..")
os.path.join(b"some", b"path", b"..")
os.path.join(b"some", b"other", b"path", b"..")
os.path.join(b"some", b"path", b"..", b"..")
os.path.join(b"..", b"some", b"path")

join("a")


# these should not

os.path.join()  # type: ignore

Path("a")
Path("a", "b")
Path("a", "b", "c")
Path("a", "b", "c", "d")