Skip to content

scripts: Add upload_bugtool.py #715

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

dinhngtu
Copy link
Member

Add a hybrid py2/py3 script for uploading bugtool archives to Nextcloud via a drop link.

@stormi stormi requested review from glehmann and ydirson May 22, 2025 08:33

args = parser.parse_args()

if any("://" in file for file in args.files):
Copy link
Contributor

Choose a reason for hiding this comment

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

os.path.exists() could be a more useful check?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not consuming the file directly so I prefer to let curl do the check.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, I'm not convinced :) I don't see the value introducing a partial check where we could have a full one for less code volume.

@dinhngtu dinhngtu force-pushed the dnt/upload-bugtool branch from cf93034 to 631c30a Compare May 26, 2025 15:23
Comment on lines +33 to +39
def version_lt(a, b):
for ai, bi in zip_longest(a, b, fillvalue=0):
if ai < bi:
return True
elif ai > bi:
return False
return False
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this? Isn't this just a reimplementation of sequence comparison?

Comment on lines +93 to +97
try:
subprocess.check_call(curl_args, stdout=sys.stdout, stderr=sys.stderr)
except:
print("curl failed, see output above.", file=sys.stderr)
sys.exit(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

A failure to execute curl (missing, corrupted...) will show nothing in "output above". Silencing exceptions is considered harmful.


args = parser.parse_args()

if any("://" in file for file in args.files):
Copy link
Contributor

Choose a reason for hiding this comment

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

Well, I'm not convinced :) I don't see the value introducing a partial check where we could have a full one for less code volume.

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.

3 participants