[Python-checkins] cpython (merge 3.3 -> default): Complete 2 to 3 conversion

Terry Reedy tjreedy at udel.edu
Mon May 13 22:32:50 CEST 2013


On 5/13/2013 3:54 PM, terry.reedy wrote:
> http://hg.python.org/cpython/rev/eeb89ebfa9b6
> changeset:   83762:eeb89ebfa9b6
> parent:      83760:1fa1a021ed23
> parent:      83761:905e32ba16bf
> user:        Terry Jan Reedy <tjreedy at udel.edu>
> date:        Mon May 13 15:44:30 2013 -0400
> summary:
>    Complete 2 to 3 conversion
>
> files:
>    Lib/idlelib/textView.py |  2 +-
>    1 files changed, 1 insertions(+), 1 deletions(-)
>
>
> diff --git a/Lib/idlelib/textView.py b/Lib/idlelib/textView.py
> --- a/Lib/idlelib/textView.py
> +++ b/Lib/idlelib/textView.py
> @@ -80,7 +80,7 @@
>       root=Tk()
>       root.title('textView test')
>       filename = './textView.py'
> -    text = file(filename, 'r').read()
> +    text = open(filename, 'r').read()
>       btn1 = Button(root, text='view_text',
>                     command=lambda:view_text(root, 'view_text', text))
>       btn1.pack(side=LEFT)

Something does not seem quite right. When I did the merge, it made the 
change in the file but claimed there was a merge conflict when there 
obviously was not one -- or should not have been one. I right-clicked on 
filename (in HgWorkbench) and selected 'mark as resolved' (or somesuch) 
and it seemed to work, but I should not have to do that. The same thing 
happened with the merge of the next change (Silence unclosed... 
Warning). That time I selected hg resolve and that re-marked the file.

The diff above is what I see in HgWorkbench if i select "Show changes 
from first parent". If I select "Show changes from second parent" I see

      try:
          with open(filename, 'r', encoding=encoding) as file:
              contents = file.read()
-    except IOError:
+    except OSError:
          import tkinter.messagebox as tkMessageBox
          tkMessageBox.showerror(title='File Load Error',
                                 message='Unable to load file %r .' % 
filename,

This is a difference between 3.3 and 3.4 versions of file (I don't know 
why change was not also made in 3.3 -- another issue), but has nothing 
to do with anything I have done.

Puzzledly yours,
Terry



More information about the Python-checkins mailing list