[New-bugs-announce] [issue12482] input() not working correctly on Mac OS X
report at bugs.python.org
Sun Jul 3 21:23:50 CEST 2011
New submission from Dmitriy Gorbachev <dgorbachev at yahoo.com>:
I am learning Python by running exercises from "Programming Python", Mark Lutz on both Windows and Mac. While exercises run flawlessly on Windows, sometimes they do not run on Mac.
In particular, in Chapter 1, Step 2: Storing Records Persistently there is a script called make_db_file.py. The following function loadDbase (called by dump_db_file_test.py-see attached) is not working at all on Mac, but working fine of Windows.
The code breaks on the line: key = input().
The Traceback message is as follows:
Traceback (most recent call last):
File "dump_db_file_test.py", line 2, in <module>
db = loadDbase()
File "/Users/DMITRY/PythonScripts/make_db_file_test.py", line 22, in loadDbase
key = input()
File "<string>", line 1, in <module>
NameError: name 'bob' is not defined
Where 'bob' is the first line of the text file "people-file" that make_db_file_test.py refers.
All related files attached in BugReport.zip
nosy: dgorbachev, ronaldoussoren
title: input() not working correctly on Mac OS X
versions: Python 2.7
Added file: http://bugs.python.org/file22554/BugReport.zip
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce