Skip to content

Float conversion error in IDLE  #102220

@rhettinger

Description

@rhettinger

I observed the following console traceback while running IDLE from the command line:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tkinter/__init__.py", line 1948, in __call__
    return self.func(*args)
           ^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tkinter/__init__.py", line 861, in callit
    func(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/idlelib/codecontext.py", line 243, in timer_event
    self.update_code_context()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/idlelib/codecontext.py", line 187, in update_code_context
    new_topvisible = self.editwin.getlineno("@0,0")
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/idlelib/editor.py", line 1056, in getlineno
    return int(float(text.index(mark)))
               ^^^^^^^^^^^^^^^^^^^^^^^
ValueError: could not convert string to float: ''

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-tkintertype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions