Opened 16 years ago
Closed 12 years ago
#9026 closed Bug (wontfix)
Scripts receive invalid keyboard input under Windows with JVM
Reported by: | Erin Kelly | Owned by: | nobody |
---|---|---|---|
Component: | Core (Management commands) | Version: | 1.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Design decision needed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In trunk and 1.0 on Windows, the createsuperuser command fails to recognize input as valid, because every line of input is terminated with '\r', which the command is not expecting. syncdb causes a similar problem when it presents the createsuperuser question loop, where the only way out is Ctrl-C.
In a regular Python or IPython shell running on Windows, the result of raw_input() isn't terminated with whitespace at all. Are we doing something weird with stdin in the management commands?
Change History (13)
comment:1 by , 16 years ago
follow-up: 4 comment:2 by , 16 years ago
Yes, there are problems with script input running under Eclipse on Windows but the original report says nothing about Eclipse. Is Eclipse involved there or no? (I do not have any problems with these scripts running on Windows and using a plain Windows command prompt.)
comment:3 by , 16 years ago
I was using a regular Windows cmd shell, not Eclipse. I'll try the Ctrl-Enter solution from the other ticket in the morning, but I suspect that's just an Eclipse thing.
comment:4 by , 16 years ago
Replying to kmtracey:
Yes, there are problems with script input running under Eclipse on Windows but the original report says nothing about Eclipse. Is Eclipse involved there or no? (I do not have any problems with these scripts running on Windows and using a plain Windows command prompt.)
I was just mentioning about Eclipse to provide some extra information, as I suspect these issues may all be linked. I haven't been able to test Eclipse under Mac to narrow down and be sure it's a Windows-specific problem.
Input in Python scripts running in Eclipse, other than with Django, always work for me. So I assume there's something wrong in the way Django handles that. But I'm no expert to see how to fix or go around that.
comment:5 by , 16 years ago
Also, like Karen, I've never had trouble with scripts run with the plain Windows command shell.
comment:6 by , 16 years ago
Summary: | createsuperuser receives invalid input under Windows → createsuperuser receives invalid input under Windows with JVM |
---|
Further experimentation shows that the problem is actually caused by the arcane mixture of Django, Windows, and Java. I'm using JPype in my app to gain access to some Java libraries, and the problem only occurs when a JVM has been started. It also does not occur in Linux, and it does not occur outside of a Django environment. This is almost certainly the same issue as in #8284, and it's obscure enough that it should probably be wontfixed as well.
comment:7 by , 16 years ago
One additional prerequisite: the problem occurs with a Java 1.6 JVM, but it seems to be fine with a Java 1.5 JVM.
comment:8 by , 16 years ago
Actually just the fact that you've found another case where this happens (even if it is arcane) makes me think it might be more worth fixing than when it was isolated to running under Eclipse. Stripping carriage returns really shouldn't be necessary, but it doesn't seem like it would be harmful, and if there are multiple environments where users could encounter this I'd tend to think we should just go ahead and fix it within Django. For the poor novice user who does encounter it it can be quite befuddling.
comment:9 by , 16 years ago
Component: | Authentication → django-admin.py |
---|---|
Summary: | createsuperuser receives invalid input under Windows with JVM → Scripts receive invalid keyboard input under Windows with JVM |
Just changing the summary as the problem is for every script. I tested with createsuperuser
, syncdb
, shell
, flush
and reset
.
comment:10 by , 16 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:11 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
comment:12 by , 13 years ago
Easy pickings: | unset |
---|---|
UI/UX: | unset |
I'm not a big fan of introducing code in Django to work around bugs in third party software, especially software that isn't closely related to Django.
comment:13 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
This bug has been around forever and obviously no one knows what to do about it.
Please provide a patch and a rationale if you want to reopen it.
There are in fact many related issues. When run in Eclipse for Windows all Django scripts (syndb, shell, etc.) fail to validate input. A similar issue was raised in #8284 but was closed as wontfix. I think something should be done here. The problem seems to lie within Django, or at least within an incompatibility between Django and Windows.
See also: http://groups.google.com/group/django-users/browse_thread/thread/4df9082fb57e7782/2250f5c70c1c2acf?lnk=gst&q=eclipse+input#2250f5c70c1c2acf