[pywin32-checkins] /hgroot/pywin32/pywin32: 2 new changesets
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <pyw...@li...> - 2013-04-19 07:17:27
|
changeset d77ee537aaef in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=d77ee537aaef summary: Make sure file exists and is not a directory before opening changeset 083fadd62226 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=083fadd62226 summary: Fix error checking in DocumentProperties (bug #3611214) diffstat: Pythonwin/pywin/framework/sgrepmdi.py | 15 +++++++++------ win32/src/win32print/win32print.cpp | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diffs (37 lines): diff -r f7dd8d279929 -r 083fadd62226 Pythonwin/pywin/framework/sgrepmdi.py --- a/Pythonwin/pywin/framework/sgrepmdi.py Sun Apr 14 01:00:24 2013 -0400 +++ b/Pythonwin/pywin/framework/sgrepmdi.py Fri Apr 19 03:16:23 2013 -0400 @@ -257,12 +257,15 @@ f = self.flist[self.fndx] if self.verbose: self.GetFirstView().Append('# ..'+f+'\n') - win32ui.SetStatusText("Searching "+f, 0) - lines = open(f, 'r').readlines() - for i in range(len(lines)): - line = lines[i] - if self.pat.search(line) != None: - self.GetFirstView().Append(f+'('+repr(i+1) + ') '+line) + # Directories may match the file type pattern, and files may be removed + # while grep is running + if os.path.isfile(f): + win32ui.SetStatusText("Searching "+f, 0) + lines = open(f, 'r').readlines() + for i in range(len(lines)): + line = lines[i] + if self.pat.search(line) != None: + self.GetFirstView().Append(f+'('+repr(i+1) + ') '+line) else: self.fndx = -1 self.fpndx = self.fpndx + 1 diff -r f7dd8d279929 -r 083fadd62226 win32/src/win32print/win32print.cpp --- a/win32/src/win32print/win32print.cpp Sun Apr 14 01:00:24 2013 -0400 +++ b/win32/src/win32print/win32print.cpp Fri Apr 19 03:16:23 2013 -0400 @@ -1344,7 +1344,7 @@ &&PyWinObject_AsDEVMODE(obdmoutput, &dmoutput, TRUE) &&PyWinObject_AsDEVMODE(obdminput, &dminput, TRUE)){ rc=DocumentProperties(hwnd, hprinter, devicename, dmoutput, dminput, mode); - if (ret < 0) + if (rc < 0) PyWin_SetAPIError("DocumentProperties"); else{ if (obdmoutput!=Py_None) |