Git Product home page Git Product logo

Comments (17)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
I think AttributeError needs to be caught as well

Original comment by [email protected] on 3 Jan 2010 at 7:33

from python-twitter.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
I have this issue too

Original comment by [email protected] on 21 Dec 2010 at 5:22

from python-twitter.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
Same problem in Google App Engine.

Original comment by [email protected] on 23 Feb 2011 at 4:45

from python-twitter.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
__version__ = '0.8.1'

Original comment by [email protected] on 23 Feb 2011 at 4:50

from python-twitter.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
haha, no problem, thanks! :D

Original comment by [email protected] on 23 Feb 2011 at 4:57

from python-twitter.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.