Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44915 > unrolled thread

Re: Making safe file names

Started byAndrew Berg <bahamutzero8825@gmail.com>
First post2013-05-07 18:10 -0500
Last post2013-05-07 18:10 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Making safe file names Andrew Berg <bahamutzero8825@gmail.com> - 2013-05-07 18:10 -0500

#44915 — Re: Making safe file names

FromAndrew Berg <bahamutzero8825@gmail.com>
Date2013-05-07 18:10 -0500
SubjectRe: Making safe file names
Message-ID<mailman.1426.1367968585.3114.python-list@python.org>
On 2013.05.07 17:18, Fábio Santos wrote:
> I suggest Base64. b64encode
> (http://docs.python.org/2/library/base64.html#base64.b64encode) and
> b64decode take an argument which allows you to eliminate the pesky "/"
> character. It's reversible and simple.
> 
> More suggestions: how about a hash? Or just use IDs from the database?
None of these would work because I would have no idea which file stores data for which artist without writing code to figure it out. If I
were to end up writing a bug that messed up a few of my cache files and noticed it with a specific artist (e.g., doing a "now playing" and
seeing the wrong tags), I would either have to manually match up the hash or base64 encoding in order to delete just that file so that it
gets regenerated or nuke and regenerate my entire cache.

-- 
CPython 3.3.1 | Windows NT 6.2.9200 / FreeBSD 9.1

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web