Opened 16 years ago

Closed 16 years ago

#8284 closed (wontfix)

raw_input broken in eclipse

Reported by: adamlofts Owned by: nobody
Component: Uncategorized Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

There are a few constructs in django like

response = raw_input()
if response == 'yes':
 do_stuff()

In eclipse on windows the '\r' is not stripped out of the string so the equality fails ('yes' != 'yes\r'). This means django refuses to delete my test database if i abort the tests in the middle. See: http://mail.python.org/pipermail/python-list/2008-March/482847.html

I suggest something like:

def _django_raw_input():
  return raw_input.replace('\r', '')
raw_input = _django_raw_input

I will write a patch if someone recommends the correct solution.

Change History (2)

comment:1 by adamlofts, 16 years ago

I was perhaps a little premature reporting this since it isn't really django's fault. If anyone is interested: finishing the line with ctrl-enter seems to fix the problem (i'm a bit new to windows!). Feel free to close if you don't think its a problem.

comment:2 by Russell Keith-Magee, 16 years ago

Resolution: wontfix
Status: newclosed

This sounds like its an issue with the way eclipse (or PyDev) is handling input; AFAIK, there shouldn't be any platform specific gotchas with raw_input() the way we are using it.

Note: See TracTickets for help on using tickets.
Back to Top