Opened 7 years ago

Closed 7 years ago

#8284 closed (wontfix)

raw_input broken in eclipse

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

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 Changed 7 years ago by adamlofts

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 Changed 7 years ago by russellm

  • Resolution set to wontfix
  • Status changed from new to closed

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