Skip to content

Commit 50af12e

Browse files
committed
Fixed #392 - Support "+" sign in filenmae/path
Signed-off-by: Chin Yeung Li <[email protected]>
1 parent a0edaab commit 50af12e

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

SPECIFICATION.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ A file name can contain only these US-ASCII characters:
7272

7373
- digits from 0 to 9
7474
- uppercase and lowercase letters from A to Z
75-
- the "_" underscore, "-" dash and "." period signs.
75+
- the "_" underscore, "-" dash, "+" plus and "." period signs.
7676

7777
- The case of a file name is not significant. On case-sensitive file systems
7878
(such as on Linux), a tool must report an error if two ABOUT files stored in

docs/CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* Support filenames/path with spaces #310
66
* Update ABOUT file format to match the specification
7+
* Support filename/path with a "+" plus sign #392
78

89
2018-11-15
910

src/attributecode/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def to_posix(path):
6767
UNC_PREFIX_POSIX = to_posix(UNC_PREFIX)
6868
UNC_PREFIXES = (UNC_PREFIX_POSIX, UNC_PREFIX,)
6969

70-
valid_file_chars = string.digits + string.ascii_letters + '_-.' + ' '
70+
valid_file_chars = string.digits + string.ascii_letters + '_-.+' + ' '
7171

7272

7373
def invalid_chars(path):

tests/test_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def test_to_native_from_mixed(self):
133133
assert expected == result
134134

135135
def test_invalid_chars_with_valid_chars(self):
136-
name = string.digits + string.ascii_letters + '_-.'
136+
name = string.digits + string.ascii_letters + '_-.+'
137137
result = util.invalid_chars(name)
138138
expected = []
139139
assert expected == result

0 commit comments

Comments
 (0)