Every single time I see the error message `global name 'X' is not defined` I say to myself, "ah yeah, I mistyped a variable name."
But then it occurred to me, why should I have to do this mental translation from "global name not defined" to "I mistyped a variable name"?
Now, I'm not asking for the error message to say "You mistyped a variable name", because that goes too much into second-guessing the user. But can we at least drop the reference to a global name? I understand that Python first searches the local namespace, and only then in the global namespace, and if the name isn't found there then an error is raised. But that doesn't mean that the error message should just assume that the variable is supposed to be global. It's misleading to say that a variable is global when it's in fact local.
I think that the error message should just say `Variable 'X' not defined`. Maybe add a suggestion `(Typo?)` at the end.
Example:
>>> def f():
... meow = 0
... return meoow
...
>>> f()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 3, in f
NameError: global name 'meoow' is not defined
I'd make the error message:
NameError: Variable 'meoow' is not defined

GLOBAL_NAME_ERROR_MSG has been introduced in fd8c7203251f as part of PEP 227 by Jeremy Hylton, so I'm adding him to the nosy to see if he agrees with the change (also adding a couple more devs to see if they have any comments).
There's also a typo in the last chunk of the patch.

+ NAME_ERROR_MSGy, name);
will give a NameError ;-).
The patch undoes the change from 'name' to 'global name'. Skimming the PEP, I do not see this change mandated or justified by the PEP. So my current view: while it is true that it is the final, global name lookup that fails, I agree with Ram that it is not necessarily a global name that was mistyped or is missing. So in absence of better justification of the status quo, I would apply the patch. Backport to 3.3 would be ok but not necessary, as the message is not nearly as wrong as some have been.

I just opened #17339 about another situation where the error message references only the last of several checks that failed.
bytes(object()) # raises
TypeError: 'object' object is not iterable # or 4 other possibilities
I think any message like this should be fixed as noticed.