Strange behavior in PythonWin IDE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anders Eriksson

    Strange behavior in PythonWin IDE

    Hello!

    I'm using ActivePython 2.3.2 build 232 on Windows 2000 and I have noticed a
    strange behavior in PythonWin IDE (win32all build 163)

    I'm from Sweden and we have a couple of letters in our alphabet that isn't
    part of ASCII and the strangeness is about one of them

    When I use the letter å (å) then the next character is eaten! Then
    when I enter the next character (the second after å) the last one appears.

    E.g.
    I want to write the word: "låna"
    I enter: "lå
    I enter: n ,but it won't show
    I enter: a , and the n appears
    I enter: " , and a s appears
    So in the editor I now have: "låns

    If I then enter a " PythonWin thinks that I'm beginning a new string and
    changes the color.

    If I then save the file and open it in another editor. Then I have the
    correct word: "låna"

    But if I run the program from the command prompt I get this error/warning

    "C:\Documen ts and Settings\ame\My Documents\My Scripts>python test.py
    sys:1: DeprecationWarn ing: Non-ASCII character '\xe5' in file test.py on
    line 1, but no encoding declared; see
    http://www.python.org/peps/pep-0263.html for details

    What is the error and what can I do to fix it?

    // Anders

    --
    Womba Womba
  • Gilles Lenfant

    #2
    Re: Strange behavior in PythonWin IDE

    Anders Eriksson wrote:
    [color=blue]
    > Hello!
    >
    > I'm using ActivePython 2.3.2 build 232 on Windows 2000 and I have noticed
    > a strange behavior in PythonWin IDE (win32all build 163)
    >
    > I'm from Sweden and we have a couple of letters in our alphabet that isn't
    > part of ASCII and the strangeness is about one of them
    >
    > When I use the letter å (å) then the next character is eaten! Then
    > when I enter the next character (the second after å) the last one appears.
    >
    > E.g.
    > I want to write the word: "låna"
    > I enter: "lå
    > I enter: n ,but it won't show
    > I enter: a , and the n appears
    > I enter: " , and a s appears
    > So in the editor I now have: "låns
    >
    > If I then enter a " PythonWin thinks that I'm beginning a new string and
    > changes the color.
    >
    > If I then save the file and open it in another editor. Then I have the
    > correct word: "låna"
    >
    > But if I run the program from the command prompt I get this error/warning
    >
    > "C:\Documen ts and Settings\ame\My Documents\My Scripts>python test.py
    > sys:1: DeprecationWarn ing: Non-ASCII character '\xe5' in file test.py on
    > line 1, but no encoding declared; see
    > http://www.python.org/peps/pep-0263.html for details
    >
    > What is the error and what can I do to fix it?
    >
    > // Anders
    >[/color]

    This bug (and others related to charsets) has been submitted some months
    ago...



    Perhaps you can help adding other bug scenarios.

    Cheers

    --
    Gilles

    Comment

    • John Roth

      #3
      Re: Strange behavior in PythonWin IDE


      "Anders Eriksson" <anders.eriksso n@morateknikutv eckling.se> wrote in message
      news:1fa1hqqgi2 xas.dlg@moratek nikutveckling.s e...[color=blue]
      > Hello!
      >
      > I'm using ActivePython 2.3.2 build 232 on Windows 2000 and I have noticed[/color]
      a[color=blue]
      > strange behavior in PythonWin IDE (win32all build 163)
      >
      > I'm from Sweden and we have a couple of letters in our alphabet that isn't
      > part of ASCII and the strangeness is about one of them
      >
      > When I use the letter å (&aring;) then the next character is eaten! Then
      > when I enter the next character (the second after å) the last one appears.
      >
      > E.g.
      > I want to write the word: "låna"
      > I enter: "lå
      > I enter: n ,but it won't show
      > I enter: a , and the n appears
      > I enter: " , and a s appears
      > So in the editor I now have: "låns
      >
      > If I then enter a " PythonWin thinks that I'm beginning a new string and
      > changes the color.
      >
      > If I then save the file and open it in another editor. Then I have the
      > correct word: "låna"
      >
      > But if I run the program from the command prompt I get this error/warning
      >
      > "C:\Documen ts and Settings\ame\My Documents\My Scripts>python test.py
      > sys:1: DeprecationWarn ing: Non-ASCII character '\xe5' in file test.py on
      > line 1, but no encoding declared; see
      > http://www.python.org/peps/pep-0263.html for details
      >
      > What is the error and what can I do to fix it?[/color]

      There are two separate issues here:

      1. To eliminate the depreciation warning, you do need to put in the
      correct pep-0263 character set declaration line. I believe this will
      become a fatal error in 2.4

      However, the other problem isn't a Python problem as far as I know:
      I believe the editor portion is written in C++. I could be wrong on
      that, but please try reproducing the problem under IDLE.

      John Roth[color=blue]
      >
      > // Anders
      >
      > --
      > Womba Womba[/color]


      Comment

      • Anders Eriksson

        #4
        Re: Strange behavior in PythonWin IDE

        On Fri, 28 Nov 2003 15:59:51 +0100, Gilles Lenfant wrote:
        [color=blue]
        > This bug (and others related to charsets) has been submitted some months
        > ago...[/color]
        OK, I didn't know that PythonWin was on SourceForge, but I will try there
        instead.

        Thank You !

        // Anders
        --
        At-home-but-still-working

        Comment

        • Anders Eriksson

          #5
          Re: Strange behavior in PythonWin IDE

          On Fri, 28 Nov 2003 11:02:42 -0500, John Roth wrote:
          [color=blue]
          > 1. To eliminate the depreciation warning, you do need to put in the
          > correct pep-0263 character set declaration line. I believe this will
          > become a fatal error in 2.4
          >[/color]
          Ok! I understand how to enter the encoding line, but I can't find any list
          of which encodings that are legal. Is there such a list?

          // Anders
          --
          At-home-but-still-working

          Comment

          • Christopher Koppler

            #6
            Re: Strange behavior in PythonWin IDE

            On Fri, 28 Nov 2003 17:16:52 GMT, Anders Eriksson <ameLista@telia .com>
            wrote:
            [color=blue]
            >On Fri, 28 Nov 2003 11:02:42 -0500, John Roth wrote:
            >[color=green]
            >> 1. To eliminate the depreciation warning, you do need to put in the
            >> correct pep-0263 character set declaration line. I believe this will
            >> become a fatal error in 2.4
            >>[/color]
            >Ok! I understand how to enter the encoding line, but I can't find any list
            >of which encodings that are legal. Is there such a list?[/color]

            The Python Library Reference, Section 4.9.2: Standard Encodings

            In Sweden, as in most of western Europe, you're probably looking for
            latin_1 or iso-8859-15 (the same with Euro currency symbol).

            --
            Christopher

            Comment

            • Christopher Koppler

              #7
              Re: Strange behavior in PythonWin IDE

              On Fri, 28 Nov 2003 17:57:29 GMT, Christopher Koppler
              <klapotec@chell o.at> wrote:
              [color=blue]
              >On Fri, 28 Nov 2003 17:16:52 GMT, Anders Eriksson <ameLista@telia .com>
              >wrote:
              >[color=green]
              >>On Fri, 28 Nov 2003 11:02:42 -0500, John Roth wrote:
              >>[color=darkred]
              >>> 1. To eliminate the depreciation warning, you do need to put in the
              >>> correct pep-0263 character set declaration line. I believe this will
              >>> become a fatal error in 2.4
              >>>[/color]
              >>Ok! I understand how to enter the encoding line, but I can't find any list
              >>of which encodings that are legal. Is there such a list?[/color]
              >
              >The Python Library Reference, Section 4.9.2: Standard Encodings
              >
              >In Sweden, as in most of western Europe, you're probably looking for
              >latin_1 or iso-8859-15 (the same with Euro currency symbol).[/color]

              Or, since you're on Windows, cp1252...


              --
              Christopher

              Comment

              Working...