Nate Lowrie wrote: > dabo Commit > Revision 3780 > Date: 2007-12-09 21:45:39 -0800 (Sun, 09 Dec 2007) > Author: Nate > Trac: http://svn.dabodev.com/trac/dabo/changeset/3780 > > Changed: > U trunk/dabo/ui/uiwx/dEditor.py > > Log: > I was using the dEditor widget in a program I was writing. I tested it on > Linux for the first time tonight and noticed two things: > - if I didn't have proper read permissions and called openFile, the > dEditor widget treated the file like it didn't exists and asked me to create > a new file. > - If I didn't have the proper write permissions and called saveFile, > the dEditor widget would just crash from an IO Error. > > I fixed both of them. I also have checkChangesAndContinue return False (same > as if the user cancelled) if the save failed due to write permissions.
+1, except you should really catch a specific class of exception, and not all of them (in case we introduce an AttributeError later on, for instance, we don't want to pull our hair out trying to find the problem). try: except IOError: -- Paul _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev Searchable Archives: http://leafe.com/archives/search/dabo-dev This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]
