On 02/ 1/11 04:23 PM, Danek Duvall wrote:
Shawn Walker wrote:
...
line 2873: s/, e:/:/
Should this actually just be "except:" rather than "except Exception:"?
If you want to catch KeyboardInterrupt too, yes.
lines 2893-2901: you shouldn't need this since you got the directory
from self.temporary_dir(); it already deals with it
What call to temporary_dir()? I could end up in a situation where I was
able to create a temporary directory for the temporary names but be unable
to move them into place because /var/pkg/cache was unwritable to me for
some reason.
Oh, right; nevermind.
lines 2913, 2935, 2947: s/file/open/; "preferred way to open a file"
according to pydoc; also, should probably use "rb"?
Heh. We use file a bit more than we do open. And why would "b" matter
here -- the file shouldn't ever be transferred between systems and we're
reading in pure text data.
It just seems preferable to use 'rb' and 'wb' when dealing with these
files so that Python never attempts any EOL transformation. Since 'b'
is a no-op on most platforms, it seems harmless to change.
-Shawn
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss