Show More
@@ -12,6 +12,7 b' import sys' | |||||
12 | import requests |
|
12 | import requests | |
13 | import getpass |
|
13 | import getpass | |
14 | import json |
|
14 | import json | |
|
15 | from pathlib import Path | |||
15 |
|
16 | |||
16 | try: |
|
17 | try: | |
17 | import requests_cache |
|
18 | import requests_cache | |
@@ -274,7 +275,7 b' def encode_multipart_formdata(fields, boundary=None):' | |||||
274 | def post_download(project, filename, name=None, description=""): |
|
275 | def post_download(project, filename, name=None, description=""): | |
275 | """Upload a file to the GitHub downloads area""" |
|
276 | """Upload a file to the GitHub downloads area""" | |
276 | if name is None: |
|
277 | if name is None: | |
277 |
name = |
|
278 | name = Path(filename).name | |
278 | with open(filename, 'rb') as f: |
|
279 | with open(filename, 'rb') as f: | |
279 | filedata = f.read() |
|
280 | filedata = f.read() | |
280 |
|
281 |
General Comments 0
You need to be logged in to leave comments.
Login now