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

Fix "unexpected keyword argument 'filename'" #5

Merged
merged 1 commit into from
Jan 28, 2016

Conversation

jrwesolo
Copy link
Contributor

Yum was calling the start function of pakrat/progress.py with incorrect parameters. #3

This is a fix for the error above when syncing a remote repository whose
packages have been updated compared to an already synced local copy.
self.callback('download_start', _file, url, basename, size, text)
if basename:
self.package = basename
self.callback('download_start', filename, url, basename, size, text)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the callback depend on the basename being set? I'm not sure what the cases are where it wouldn't be.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this was another fix that would happen after the parameter name fix. By setting the defaults to None, it allows both yum and urlgrabber to call this function. We have to set those defaults to None because the call from drpm.py does not pass basename. If drpm.py calls this and we don't check if basename exists, we would set self.package to None. It's possible that there would never be an issue, but I added this check just in case so we don't ever step on an existing download. If that happened, when end gets called it would not know what package it was referencing.

@ryanuber
Copy link
Owner

@jrwesolo wow it's been a while since I've seen this code - Thanks for doing this! Just left one question but otherwise LGTM.

@jrwesolo
Copy link
Contributor Author

Replied above to your question. Thanks for taking a look!

@ryanuber
Copy link
Owner

Thanks!

ryanuber added a commit that referenced this pull request Jan 28, 2016
Fix "unexpected keyword argument 'filename'"
@ryanuber ryanuber merged commit a58d060 into ryanuber:master Jan 28, 2016
@jrwesolo jrwesolo deleted the unexpected_keyword_fix branch January 28, 2016 21:19
@jmassara jmassara mentioned this pull request Apr 2, 2016
abtreece referenced this pull request in abtreece/pakrat Feb 1, 2017
fix for TypeError: start() got an unexpected keyword argument "filename"
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

Successfully merging this pull request may close these issues.

2 participants