DOC: [Errno 2] No such file or directory
#### Location of the documentation
 
inline in the code

#### Documentation problem

the following is due to filename length, not _"No such file or directory"_

> FileNotFoundError: [Errno 2] No such file or directory: 'Queried Data - search_index__foo_sourcetype__foo_token_typetoken_typetoken_typetoken_typetotoken_typetoken_typetoken_token_typetytoken_typepetoken_typepetoken_SDSDDDypepeX_from_02-41-PM_July_17.csv'

#### Suggested fix for documentation

It appears to me there should be a `if len(myString) > 177, throw FileNameTooLong` 


here is a example 
```

file_description = "search index = foo sourcetype = foo token_typetoken_typetoken_typetoken_typetotoken_typetoken_typetoken_token_typetytoken_typepetoken_typepetoken_SDSDDDypepe"

file_description += " from " + datetime.datetime.now().strftime("%I-%M-%p %B %d")
file_description = str(file_description).strip().replace(' ', '_')
file_description = re.sub(r'(?u)[^-\w.]', '', file_description)
file_description

len(file_description)
X_train.to_csv("Queried Data - " + file_description + ".csv")
```
> search_index__foo_sourcetype__foo_token_typetoken_typetoken_typetoken_typetotoken_typetoken_typetoken_token_typetytoken_typepetoken_typepetoken_SDSDDDypepe_from_02-41-PM_July_17'

> 177
*Works as intended*  
---
if you add a letter to the end of `file_description`, length will be `178`. 

we get the following 
```text 

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-176-8fb818e0c708> in <module>
      7 
      8 len(file_description)
----> 9 X_train.to_csv("Queried Data - " + file_description + ".csv")

~\Anaconda3\lib\site-packages\pandas\core\generic.py in to_csv(self, path_or_buf, sep, na_rep, float_format, columns, header, index, index_label, mode, encoding, compression, quoting, quotechar, line_terminator, chunksize, date_format, doublequote, escapechar, decimal)
   3202             decimal=decimal,
   3203         )
-> 3204         formatter.save()
   3205 
   3206         if path_or_buf is None:

~\Anaconda3\lib\site-packages\pandas\io\formats\csvs.py in save(self)
    186                 self.mode,
    187                 encoding=self.encoding,
--> 188                 compression=dict(self.compression_args, method=self.compression),
    189             )
    190             close = True

~\Anaconda3\lib\site-packages\pandas\io\common.py in get_handle(path_or_buf, mode, encoding, compression, memory_map, is_text)
    426         if encoding:
    427             # Encoding
--> 428             f = open(path_or_buf, mode, encoding=encoding, newline="")
    429         elif is_text:
    430             # No explicit encoding

FileNotFoundError: [Errno 2] No such file or directory: 'Queried Data - search_index__foo_sourcetype__foo_token_typetoken_typetoken_typetoken_typetotoken_typetoken_typetoken_token_typetytoken_typepetoken_typepetoken_SDSDDDypepeX_from_02-41-PM_July_17.csv'
```


## outtake

I suggest a better error message to be used the file name is too long 

getting a `No such file or directory` caused me to waste time, as it was wrong. The file name was too long  