[Pythonmac-SIG] One IDE can find sys._buf,
the other can't. What's going on?
Bob Ippolito
bob at redivi.com
Thu Mar 3 20:56:41 CET 2005
On Mar 3, 2005, at 14:04, Louis Pecora wrote:
> I ran some test code in the MacPython IDE and then from BBEdit (should
> be same as TextWrangle that some of you use). It runs in the Mac IDE,
> but I get this error in BBEdit:
>
> File "Drive:Users:louispecora:Code:python:general:general.py"; Line
> 132: AttributeError: 'file' object has no attribute '_buf'
>
> That line of code is this one
>
> import sys,Carbon
> sys.stdout._buf = say or '? ' # This line and the next print out
> the prompt 'say' <------ bad line
>
> I cannot figure this one out. I'm suspecting it's some sort of Python
> path or multiple Python version problem, but I have no clue.
>
> I am running OS X 10.3.8 on a 1.25 GHz PB.
>
> I was really enjoying the BBEdit approach since it is a great code
> editor and seemed to run generic stuff well until I hit this problem.
>
> Maybe I need to run that Panther stuff that fixes the Mac version.
> Any help greatly appreciated.
Uh.. I have no idea where you got the idea to do that, but that _buf
attribute is specific to the MacPython IDE. It works *nowhere else*.
If you could explain what it does, I'm sure there's an alternative that
works elsewhere.
Leading underscores in Python typically mean "don't touch this".
-bob
More information about the Pythonmac-SIG
mailing list