phette23 / epheme

making Twitter ever so slightly less ephemeral
1 stars 0 forks source link

breaks if passed string with spaces in it #1

Closed phette23 closed 10 years ago

phette23 commented 10 years ago

MongoDB doesn't allow spaces in DB names. Error:

Traceback (most recent call last):
  File "./epheme.py", line 136, in <module>
    archive = Epheme(args.text, args.images)
  File "./epheme.py", line 30, in __init__
    self.db = MongoClient()[text]
  File "/Users/phette23/code/epheme/lib/python2.7/site-packages/pymongo/mongo_client.py", line 1320, in __getitem__
    return self.__getattr__(name)
  File "/Users/phette23/code/epheme/lib/python2.7/site-packages/pymongo/mongo_client.py", line 1309, in __getattr__
    return database.Database(self, name)
  File "/Users/phette23/code/epheme/lib/python2.7/site-packages/pymongo/database.py", line 79, in __init__
    _check_name(name)
  File "/Users/phette23/code/epheme/lib/python2.7/site-packages/pymongo/database.py", line 43, in _check_name
    "character %r" % invalid_char)
pymongo.errors.InvalidName: database names cannot contain the character ' '