Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/icoz/habraparse.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoricoz <icoz.vt@gmail.com>2015-02-02 22:10:06 +0300
committericoz <icoz.vt@gmail.com>2015-02-02 22:10:06 +0300
commit1f30583f3e4e14c84487aecfc3817de32ab42827 (patch)
treebf3271d207c215d761cfd3bdd7bef51457343045 /habraparse.py
parenteb12979b1fc5f6041db3310a6cdda0d57c9d9c04 (diff)
Bugfix: error when saving files with VERY long names (thanx to 4mz)
Diffstat (limited to 'habraparse.py')
-rwxr-xr-xhabraparse.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/habraparse.py b/habraparse.py
index 2261e5b..97efcf4 100755
--- a/habraparse.py
+++ b/habraparse.py
@@ -138,6 +138,8 @@ def save_all_favs_for_user(username, out_dir, save_in_html=True, with_comments=F
# topic = HabraTopic(topic_id)
if save_by_name:
t_name = topic_name.replace('/', '_').replace('\\', '_').replace('!', '.')
+ if len(t_name) > 250:
+ t_name = t_name[:250]
filename = '{dir}/{name}.{filetype}'.format(dir=out_dir, name=t_name, filetype=filetype)
else:
filename = '{dir}/{id}.{filetype}'.format(dir=out_dir, id=topic_id, filetype=filetype)