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
fdf13318
Commit
fdf13318
authored
Jan 28, 2015
by
Joshua Roesslein
Browse files
Merge pull request #547 from skoczen/master
Fixes error message on file too big to reflect actual file size limit.
parents
c419c546
3b4bbabe
Changes
1
Show whitespace changes
Inline
Side-by-side
tweepy/api.py
View file @
fdf13318
...
...
@@ -1270,7 +1270,7 @@ class API(object):
if
f
is
None
:
try
:
if
os
.
path
.
getsize
(
filename
)
>
(
max_size
*
1024
):
raise
TweepError
(
'File is too big, must be less than
700
kb.'
)
raise
TweepError
(
'File is too big, must be less than
%s
kb.'
%
max_size
)
except
os
.
error
:
raise
TweepError
(
'Unable to access file'
)
...
...
@@ -1279,7 +1279,7 @@ class API(object):
else
:
f
.
seek
(
0
,
2
)
# Seek to end of file
if
f
.
tell
()
>
(
max_size
*
1024
):
raise
TweepError
(
'File is too big, must be less than
700
kb.'
)
raise
TweepError
(
'File is too big, must be less than
%s
kb.'
%
max_size
)
f
.
seek
(
0
)
# Reset to beginning of file
fp
=
f
...
...
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