Message44996
Logged In: YES
user_id=13298
Raymond Hettinger asked me if I could do a second review for
this patch, so I did. I found three errors. The first one is
in Lib/lib-old/codehack.py. It's a mistake that the change
is there at all. The second one in in
Lib/plat-mac/aetypes.py where a 'r' is missing. The third
and last one is in Tools/scripts/methfix.py. Here, a
variable is printed twice.
First one:
- key = `co` # arbitrary but uniquely identifying string
+ key = co` # arbitrary but uniquely identifying string
Second one:
- return "QDRectangle(%s, %s, %s, %s)" % (`self.v0`,
`self.h0`,
- `self.v1`, `self.h1`)
+ return "QDRectangle(%r, %r, %r, %)" % (self.v0,
self.h0, self.v1, self.h1)
Third one:
- err(tempname + ': warning: chmod failed (' + `msg`
+ ')\n')
+ err(tempname + '%s: warning: chmod failed (%r)\n' %
(tempname, msg))
# Then make a backup of the original file as filename~
try:
os.rename(filename, filename + '~')
except os.error, msg:
- err(filename + ': warning: backup failed (' + `msg`
+ ')\n')
+ err(filename + '%s: warning: backup failed (%r)\n'
% (filename, msg))
# Now move the temp file to the original file
try:
os.rename(tempname, filename)
except os.error, msg:
- err(filename + ': rename failed (' + `msg` + ')\n')
+ err(filename + '%s: rename failed (%r)\n' %
(filename, msg))
Attached is a meta-patch containing the differences between
the original backticks2repr.txt which contains some errors,
and the one with the errors removed.
Note that I did not run any test suite or something like
that, because I understand that had already been done.
Other things I noticed:
- sometimes this patch uses "foo %r bar" % baz, sometimes
"foo %r bar" % (baz,), and sometimes "foo " + repr(baz) + " bar"
- division needs a check as well, as '/' should be replaced
by '//' in a lot of places.
- there is one place where a (very) small behaviour change
occurs, namely in Demo/sockets/gopher.py, where "print '(Bad
line from server:', `line`, ')'" is replaced by "print '(Bad
line from server: %r)' % (line,)", which is a difference of
one whitespace character - I don't think it would cause a
lot of trouble ;-)
- it is possible that there are more errors in the patch
which I didn't see, but it's also possible that there aren't
any.
(Hmm, I don't see immediatly how to add a patch...) |
|
| Date |
User |
Action |
Args |
| 2007-08-23 15:30:14 | admin | link | issue852334 messages |
| 2007-08-23 15:30:14 | admin | create | |
|