Skip to content

Commit

Permalink
fix: LegacyRegion.get_bucket_host not working in python2
Browse files Browse the repository at this point in the history
  • Loading branch information
lihsai0 committed Aug 8, 2024
1 parent b58675e commit 77282c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion qiniu/region.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ def get_bucket_hosts(self, ak, bucket, home_dir=None, force=False):
}

ttl = region.ttl if region.ttl > 0 else 24 * 3600 # 1 day
bucket_hosts['deadline'] = region.create_time.timestamp() + ttl
# use datetime.datetime.timestamp() when min version of python >= 3
create_time = int(float(region.create_time.strftime('%s.%f')) * 1000)
bucket_hosts['deadline'] = create_time + ttl

return bucket_hosts

Expand Down

0 comments on commit 77282c2

Please sign in to comment.