Comments (17)
This also is a problem with the os.getlogin() call from _GetUsername. This fails
(throws an OSError) if there is no TTY attached.
VERSION:
The 0.5 download from the frontpage.
EXCEPTION:
twitter.py:1451 __init__
twitter.py:1508 _InitializeRootDirectory
twitter.py:1502 _GetTmpCachePath
twitter.py:1498 _GetUsername
<type 'exceptions.OSError'>: [Errno 2] No such file or directory
Original comment by [email protected]
on 10 Jun 2008 at 8:48
from python-twitter.
Confirming this issue. I get the same error when trying to use it in Google App
Engine environment. Here is the code:
{{{
import wsgiref.handlers
from google.appengine.ext import webapp
import simplejson
import twitter
class MainHandler(webapp.RequestHandler):
def get(self):
pass
api = twitter.Api()
statuses = api.GetPublicTimeline()
def main():
application = webapp.WSGIApplication([('/', MainHandler)], debug=True)
wsgiref.handlers.CGIHandler().run(application)
if __name__ == '__main__':
main()
}}}
This throws the following error:
{{{
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp
\__init__.py", line 499, in __call__
handler.get(*groups)
File "C:\Program Files\Google\google_appengine\is-twitter-happy\main.py", line 29,
in get
api = twitter.Api()
File "C:\Python25\lib\site-packages\python_twitter-0.5-py2.5.egg\twitter.py", line
900, in __init__
self._cache = _FileCache()
File "C:\Python25\lib\site-packages\python_twitter-0.5-py2.5.egg\twitter.py", line
1451, in __init__
self._InitializeRootDirectory(root_directory)
File "C:\Python25\lib\site-packages\python_twitter-0.5-py2.5.egg\twitter.py", line
1508, in _InitializeRootDirectory
root_directory = self._GetTmpCachePath()
File "C:\Python25\lib\site-packages\python_twitter-0.5-py2.5.egg\twitter.py", line
1502, in _GetTmpCachePath
username = self._GetUsername()
File "C:\Python25\lib\site-packages\python_twitter-0.5-py2.5.egg\twitter.py", line
1498, in _GetUsername
os.getlogin() or \
AttributeError: 'module' object has no attribute 'getlogin'
}}}
Original comment by [email protected]
on 22 Jun 2008 at 5:16
from python-twitter.
The noTTY.patch is now applied in trunk. Really sorry for the delay -- I
didn't see
this issue open. Thanks so much for the reports and the fix!
Original comment by dclinton
on 10 Jul 2008 at 9:45
- Changed state: Fixed
from python-twitter.
I've just downloaded the most recent version, but seem to have the same problem
when I
use it with google appengine? is the noTTY.patch something I have to apply
manually?
Original comment by [email protected]
on 16 May 2009 at 12:15
from python-twitter.
I think AttributeError needs to be caught as well
Original comment by [email protected]
on 3 Jan 2010 at 7:33
from python-twitter.
this isnt fixed. seeing this issue at my end also.
Original comment by [email protected]
on 25 Jun 2010 at 11:39
from python-twitter.
work for me !
Actually I didnt update the twitter.py .
But I manually added the pacth and its working
Obs: I'm using inside pinax version not updated + apache + wsgi.
Original comment by [email protected]
on 30 Aug 2010 at 6:47
from python-twitter.
I have this issue too
Original comment by [email protected]
on 21 Dec 2010 at 5:22
from python-twitter.
Same problem in Google App Engine.
Original comment by [email protected]
on 23 Feb 2011 at 4:45
from python-twitter.
what version are you using? 0.5 or 0.6 ?
Original comment by bear42
on 23 Feb 2011 at 4:48
- Changed state: Accepted
from python-twitter.
__version__ = '0.8.1'
Original comment by [email protected]
on 23 Feb 2011 at 4:50
from python-twitter.
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3245, in _HandleRequest
self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3186, in _Dispatch
base_env_dict=env_dict)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 531, in Dispatch
base_env_dict=base_env_dict)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2410, in Dispatch
self._module_dict)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2320, in ExecuteCGI
reset_modules = exec_script(handler_path, cgi_path, hook)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2216, in ExecuteOrImportScript
exec module_code in script_module.__dict__
File "C:\Users\ramayac\Desktop\TrendingSV\main.py", line 31, in <module>
api = twitter.Api()
File "C:\Users\ramayac\Desktop\TrendingSV\twitter.py", line 1970, in __init__
self.SetCache(cache)
File "C:\Users\ramayac\Desktop\TrendingSV\twitter.py", line 3274, in SetCache
self._cache = _FileCache()
File "C:\Users\ramayac\Desktop\TrendingSV\twitter.py", line 3607, in __init__
self._InitializeRootDirectory(root_directory)
File "C:\Users\ramayac\Desktop\TrendingSV\twitter.py", line 3667, in _InitializeRootDirectory
root_directory = self._GetTmpCachePath()
File "C:\Users\ramayac\Desktop\TrendingSV\twitter.py", line 3661, in _GetTmpCachePath
username = self._GetUsername()
File "C:\Users\ramayac\Desktop\TrendingSV\twitter.py", line 3655, in _GetUsername
os.getlogin() or \
AttributeError: 'module' object has no attribute 'getlogin'
Original comment by [email protected]
on 23 Feb 2011 at 4:54
from python-twitter.
ouch!
ok, i'll bump that up to the top for this weekend's work - thanks for the report
Original comment by bear42
on 23 Feb 2011 at 4:56
- Added labels: Priority-Critical
- Removed labels: Priority-Medium
from python-twitter.
haha, no problem, thanks! :D
Original comment by [email protected]
on 23 Feb 2011 at 4:57
from python-twitter.
Is there any known work-around for this on AppEngine or is it fixed in a recent
beta version?
Original comment by staringmonkey
on 6 Apr 2011 at 4:12
from python-twitter.
Disregard last, passing cache=None to Api() seems to have gotten around this.
Thanks!
Original comment by staringmonkey
on 6 Apr 2011 at 4:19
from python-twitter.
I still have this problem when running in AppEngine
__version__ = '0.8.2'
Original comment by [email protected]
on 3 Aug 2011 at 10:12
from python-twitter.
Related Issues (20)
- Character Limit does not accurately match URL t.co wrapper
- NewFromJsonDict AttributeError HOT 2
- "UnicodeEncodeError: 'ascii' codec can't encode characters" during GetSearch() for utf-8 encoded search terms
- Current head (dca91beb7418) has a failing unit test HOT 1
- 404 - Dependency issue? HOT 1
- README.md did not get up to speed HOT 1
- Pip Install from source fails (google code) HOT 3
- api.GetMentions errors HOT 1
- import twitter produces AttributeError: 'module' object has no attribute 'Http' HOT 1
- Getting {“errors”:[{“message”:“Bad Authentication data”,“code”:215}]} using python-twitter API v1.0 HOT 5
- Direct Messages failing HOT 3
- GetPublicTimeline() is referenced in docs but not implemented HOT 1
- python 3.x HOT 2
- GetUser gives a "page does not exist 34" HOT 2
- remove dependency to python-oauth2 switch to oauthlib HOT 2
- GetUserTimeLine does not work
- status of python-twitter-1.1
- api.CreateList returns UnboundLocalError
- Cannot be installed with Pip HOT 2
- User behind a proxy will face a problem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-twitter.