Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zahra Rajabi
tweepy
Commits
605da21f
Unverified
Commit
605da21f
authored
May 31, 2018
by
Joshua Roesslein
Committed by
GitHub
May 31, 2018
Browse files
Merge pull request #1027 from tweepy/fix-1026
Fix bug where streaming throws an exception after long use
parents
29e32cdf
32fa592d
Changes
1
Hide whitespace changes
Inline
Side-by-side
tweepy/streaming.py
View file @
605da21f
...
...
@@ -313,11 +313,12 @@ class Stream(object):
while
self
.
running
and
not
resp
.
raw
.
closed
:
length
=
0
while
not
resp
.
raw
.
closed
:
line
=
buf
.
read_line
().
strip
()
if
not
line
:
line
=
buf
.
read_line
()
stripped_line
=
line
.
strip
()
if
line
else
line
# line is sometimes None so we need to check here
if
not
stripped_line
:
self
.
listener
.
keep_alive
()
# keep-alive new lines are expected
elif
line
.
strip
()
.
isdigit
():
length
=
int
(
line
)
elif
stripped_line
.
isdigit
():
length
=
int
(
stripped_
line
)
break
else
:
raise
TweepError
(
'Expecting length, unexpected value found'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment