mythkiven / mkAppleOpenSourceDownload

Apple opensource source image,download source code from Apple's website.
MIT License
15 stars 3 forks source link

IOError: [Errno 21] Is a directory: '/Users/heping/Documents/objc4/./..' #2

Open MemoryReload opened 3 years ago

MemoryReload commented 3 years ago
[heping@Laputa:~/Documents]$aosdownload 'objc'
>> Search keyword: objc..
>> Match to resource:[objc4], will download
>> --> Download from  "https://opensource.apple.com/" <--
>>> Download : ./..
Traceback (most recent call last):
  File "/Users/heping/.pyenv/versions/2.7.14/bin/aosdownload", line 22, in <module>
    main()
  File "/Users/heping/.pyenv/versions/2.7.14/bin/aosdownload", line 18, in main
    mkADownload().download(word=args.text, path=args.save_path)
  File "/Users/heping/.pyenv/versions/2.7.14/lib/python2.7/site-packages/mkAppleOpenSourceDownload/download.py", line 91, in download
    self.downloadTarWithURL(href , os.path.join(path,title))
  File "/Users/heping/.pyenv/versions/2.7.14/lib/python2.7/site-packages/mkAppleOpenSourceDownload/download.py", line 95, in downloadTarWithURL
    f = open(path, 'wb')
IOError: [Errno 21] Is a directory: '/Users/heping/Documents/objc4/./..'
MemoryReload commented 3 years ago

we should change this line:

if(href == './../'):
                continue

to

if(string.find(href,'./..')==0):
                continue

or things will go wrong.