Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9bad3a99
Commit
9bad3a99
authored
Mar 27, 2011
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix short file name generation in bdist_msi.
Patch by Christoph Gohlke. Closes #7639.
parent
c01ffdf6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
Lib/msilib/__init__.py
Lib/msilib/__init__.py
+17
-8
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/msilib/__init__.py
View file @
9bad3a99
...
...
@@ -174,10 +174,10 @@ def add_tables(db, module):
def
make_id
(
str
):
#str = str.replace(".", "_") # colons are allowed
str
=
str
.
replace
(
" "
,
"_"
)
str
=
str
.
replace
(
"-"
,
"_"
)
if
str
[
0
]
in
string
.
digits
:
str
=
"_"
+
str
for
c
in
" -+~;"
:
str
=
str
.
replace
(
c
,
"_"
)
if
str
[
0
]
in
(
string
.
digits
+
"."
)
:
str
=
"_"
+
str
assert
re
.
match
(
"^[A-Za-z_][A-Za-z0-9_.]*$"
,
str
),
"FILE"
+
str
return
str
...
...
@@ -285,19 +285,28 @@ class Directory:
[(
feature
.
id
,
component
)])
def
make_short
(
self
,
file
):
oldfile
=
file
file
=
file
.
replace
(
'+'
,
'_'
)
file
=
''
.
join
(
c
for
c
in
file
if
not
c
in
' "/
\
[]:;=,
'
)
parts = file.split(".")
if
len
(
parts
)
>
1
:
if len(parts) > 1:
prefix = "".join(parts[:-1]).upper()
suffix = parts[-1].upper()
if not prefix:
prefix = suffix
suffix = None
else:
prefix = file.upper()
suffix = None
prefix
=
parts
[
0
].
upper
()
if
len
(
prefix
)
<=
8
and
(
not
suffix
or
len
(
suffix
)
<=
3
):
if len(parts) < 3 and len(prefix) <= 8 and file == oldfile and (
not suffix or len(suffix) <=
3):
if suffix:
file = prefix+"."+suffix
else:
file = prefix
assert
file
not
in
self
.
short_names
else:
file = None
if file is None or file in self.short_names:
prefix = prefix[:6]
if suffix:
suffix = suffix[:3]
...
...
Misc/NEWS
View file @
9bad3a99
...
...
@@ -48,6 +48,8 @@ Core and Builtins
Library
-------
- Issue #7639: Fix short file name generation in bdist_msi.
- Issue #11659: Fix ResourceWarning in test_subprocess introduced by #11459.
Patch by Ben Hayden.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment