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
3e4498d3
Commit
3e4498d3
authored
Aug 14, 2019
by
Greg Price
Committed by
Benjamin Peterson
Aug 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-37760: Avoid cluttering work tree with downloaded Unicode files. (GH-15128)
parent
68e495df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
.gitignore
.gitignore
+1
-0
Tools/unicode/makeunicodedata.py
Tools/unicode/makeunicodedata.py
+5
-2
No files found.
.gitignore
View file @
3e4498d3
...
...
@@ -74,6 +74,7 @@ PCbuild/arm32/
PCbuild/arm64/
PCbuild/obj/
PCbuild/win32/
Tools/unicode/data/
.purify
__pycache__
autom4te.cache
...
...
Tools/unicode/makeunicodedata.py
View file @
3e4498d3
...
...
@@ -887,15 +887,18 @@ def merge_old_version(version, new, old):
normalization_changes
))
DATA_DIR
=
os
.
path
.
join
(
'Tools'
,
'unicode'
,
'data'
)
def
open_data
(
template
,
version
):
local
=
template
%
(
'-'
+
version
,
)
local
=
os
.
path
.
join
(
DATA_DIR
,
template
%
(
'-'
+
version
,)
)
if
not
os
.
path
.
exists
(
local
):
import
urllib.request
if
version
==
'3.2.0'
:
# irregular url structure
url
=
'http://www.unicode.org/Public/3.2-Update/'
+
local
url
=
(
'http://www.unicode.org/Public/3.2-Update/'
+
template
)
%
(
'-'
+
version
,)
else
:
url
=
(
'http://www.unicode.org/Public/%s/ucd/'
+
template
)
%
(
version
,
''
)
os
.
makedirs
(
DATA_DIR
,
exist_ok
=
True
)
urllib
.
request
.
urlretrieve
(
url
,
filename
=
local
)
if
local
.
endswith
(
'.txt'
):
return
open
(
local
,
encoding
=
'utf-8'
)
...
...
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