AUR web interface

Tasklist

FS#45545 - TypeError: non-empty format string passed to object.__format__

Attached to Project: AUR web interface
Opened by Marty (vadmium) - Saturday, 04 July 2015, 07:19 GMT
Last edited by Lukas Fleischer (lfleischer) - Thursday, 09 July 2015, 12:15 GMT
Task Type Bug Report
Category PKGBUILD Parser
Status Closed
Assigned To Johannes Löthberg (demize)
Architecture All
Severity Medium
Priority Normal
Reported Version 4.0.0-rc6
Due in Version 4.0.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

When pushing changes to a package, it looks the code that reports errors is broken:

remote: error: The following errors occurred when parsing .SRCINFO in commit
remote: error: df032acd9810bd3573a9d3263f4d8de3d004ce36:
remote: Traceback (most recent call last):
remote: File "hooks/update", line 245, in <module>
remote: sys.stderr.write("error: line {:d}: {:s}\n".format(error))
remote: TypeError: non-empty format string passed to object.__format__
remote: error: hook declined to update refs/heads/master
Toaur@aur4.archlinux.org/iview.git"> ssh://aur@aur4.archlinux.org/iview.git
! [remote rejected] aur -> master (hook declined)

Looking at <https://projects.archlinux.org/aurweb.git/commit?id=ae2907a>, I suspect the code wasn’t changed properly:

-sys.stderr.write("error: line %d: %s\n" % error)
+sys.stderr.write("error: line {:d}: {:s}\n".format(error))

Depending on what “error” is, maybe it should be something like one of these:

"error: line {:d}: {:s}\n".format(*error) # Strict version
"error: line {}: {}\n".format(*error) # Allow types other than int, str
"error: line {}: {!s}\n".format(int(error[0]), error[1]) # Truer to original

There is a related error from <https://bbs.archlinux.org/viewtopic.php?id=199016> (actual error was apparently a missing install file):

remote: Traceback (most recent call last):
remote: File "hooks/update", line 274, in <module>
remote: commit.id)
remote: File "hooks/update", line 175, in die_commit
remote: sys.stderr.write("error: {:s}:\n".format(commit))
remote: TypeError: non-empty format string passed to object.__format__

But from where I am sitting I can’t see what the problem is in this case. The code in the traceback seems to be a mix of old and new code.
This task depends upon

Closed by  Lukas Fleischer (lfleischer)
Thursday, 09 July 2015, 12:15 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in 4.0.0.
Comment by Marty (vadmium) - Saturday, 04 July 2015, 08:06 GMT
FTR through trial and error I discovered that my line 245 error was caused by not having the package attributes intended by a tab. Previously, the AURINFO file worked without intentation:

pkgbase = iview
pkgdesc = Alternative frontend for ABC TV's Iview service
[. . .]

pkgname = iview

Now, the lines in each “pkgbase” or “pkgname” section in SRCINFO have to be prefixed with a tab code:

pkgbase = iview
<tab>pkgdesc = Alternative frontend for ABC TV's Iview service
<tab>[. . .]

pkgname = iview
Comment by Johannes Löthberg (demize) - Saturday, 04 July 2015, 11:39 GMT
Patch submitted.

(<https://lists.archlinux.org/pipermail/aur-dev/2015-July/003522.html>)

Loading...