Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom filename format results in error #2

Open
lasar opened this issue Sep 19, 2011 · 0 comments
Open

Custom filename format results in error #2

lasar opened this issue Sep 19, 2011 · 0 comments

Comments

@lasar
Copy link

lasar commented Sep 19, 2011

When I try to use the script like this:

appdailysales.py -a USERNAME -p PASSWORD -d 7 -f "%Y-%m-%d.txt.gz" -u -n

It produces this bunch of error message:

Traceback (most recent call last):
  File "./kirbyt-appdailysales-eea5ce6/appdailysales.py", line 540, in <module>
    sys.exit(main())
  File "./kirbyt-appdailysales-eea5ce6/appdailysales.py", line 533, in main
    downloadFile(options)
  File "./kirbyt-appdailysales-eea5ce6/appdailysales.py", line 483, in downloadFile
    os.makedirs(fileDirectory)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 2] No such file or directory: ''

I don't speak Python much but as far as I can see the issue lies in the fact that in the following line (479 in the current version) fileDirectory becomes an empty string. This path does not exist, neither can it be created.

fileDirectory = os.path.dirname(filename)

I tried commenting out the directory check and it works fine. When I add -o "./" to the script call, it also works perfectly.

My guess is that it's just a missing "is empty" check on fileDirectory, but I may be wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant