classification
Title: IDLE Text Output With ASCII Control Codes Not Working
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder: IDLE: Document how Shell displays user code output
View: 23220
Assigned To: Nosy List: Kevin Phillips (kmecpp), martin.panter, terry.reedy
Priority: normal Keywords:

Created on 2015-07-06 01:45 by Kevin Phillips (kmecpp), last changed 2015-07-11 06:12 by terry.reedy. This issue is now closed.

Files
File name Uploaded Description Edit
python_bug.png Kevin Phillips (kmecpp), 2015-07-06 01:45 This is what happens when the \r code is printed out to make an attemped progress stat. It appears as if each time the cursor is moved farther to the right (passed one of the Progress:'s) that the gray area between the text and the cursor gets larger
Messages (4)
msg246343 - (view) Author: Kevin Phillips (kmecpp) (Kevin Phillips (kmecpp)) Date: 2015-07-06 01:45
This appears to be a bug with IDLE that happens when printing out ASCII codes. I posted the issue to stackoverflow when I came accross it because I didn't know what the problem was, so there is a more detailed description of the there: http://stackoverflow.com/q/31235670/3476226
msg246346 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-07-06 03:04
See also Issue 23220, specifically about the backspace control code.

I understand the only control codes that Idle handles are newlines (line feed, \n) and tabs (\t).
msg246590 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-07-11 02:01
Idle expands tabs to spaces, if asked to do so.  It otherwise passes user code generated chars to tkinter, which passes them on to tk, which eventually passes them on to the OS gui widgets.  I will say more on the existing issue.
msg246595 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-07-11 06:12
To modify what I said, Idle only auto-expands literal tabs entered into an editor window with the Tab key.  When one is doing such entry, all key sequences are subject to interception, so this is nothing special.

Tabs chars put in a string with '\t' or '\x09' are not and should not be modified (except by explicit string methods.  The issue here and in #23220 is what happens when strings are written to a file object with print or file.write.
History
Date User Action Args
2015-07-11 06:12:29terry.reedysetmessages: + msg246595
2015-07-11 02:01:42terry.reedysetnosy: + terry.reedy
messages: + msg246590
2015-07-11 01:59:03terry.reedysetstatus: open -> closed
superseder: IDLE: Document how Shell displays user code output
resolution: duplicate
stage: resolved
2015-07-06 03:04:14martin.pantersetnosy: + martin.panter

messages: + msg246346
title: IDLE Text Output With ASCII Codes Not Working -> IDLE Text Output With ASCII Control Codes Not Working
2015-07-06 02:30:51Kevin Phillips (kmecpp)settitle: IDLE Text Output Bug with ASCII Codes -> IDLE Text Output With ASCII Codes Not Working
2015-07-06 01:45:34Kevin Phillips (kmecpp)settitle: IDLE Bug -> IDLE Text Output Bug with ASCII Codes
2015-07-06 01:45:10Kevin Phillips (kmecpp)create