{"action":"closed","issue":{"url":"https://api.github.com/repos/kweis/acronym/issues/8","repository_url":"https://api.github.com/repos/kweis/acronym","labels_url":"https://api.github.com/repos/kweis/acronym/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/kweis/acronym/issues/8/comments","events_url":"https://api.github.com/repos/kweis/acronym/issues/8/events","html_url":"https://github.com/kweis/acronym/issues/8","id":186182077,"number":8,"title":"FileNotFoundError","user":{"login":"migueldvb","id":678759,"avatar_url":"https://avatars.githubusercontent.com/u/678759?v=3","gravatar_id":"","url":"https://api.github.com/users/migueldvb","html_url":"https://github.com/migueldvb","followers_url":"https://api.github.com/users/migueldvb/followers","following_url":"https://api.github.com/users/migueldvb/following{/other_user}","gists_url":"https://api.github.com/users/migueldvb/gists{/gist_id}","starred_url":"https://api.github.com/users/migueldvb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/migueldvb/subscriptions","organizations_url":"https://api.github.com/users/migueldvb/orgs","repos_url":"https://api.github.com/users/migueldvb/repos","events_url":"https://api.github.com/users/migueldvb/events{/privacy}","received_events_url":"https://api.github.com/users/migueldvb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-31T01:26:37Z","updated_at":"2016-11-01T17:24:51Z","closed_at":"2016-11-01T17:24:51Z","body":"When the input data directory is given with a trailing slash (as it happens with bash and zsh tab completion) the script fails with the following error:\r\n\r\n```\r\npython acronym.py example/rawdata/\r\n```\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"acronym.py\", line 210, in <module>\r\n    pyfits.writeto(name,dat,clobber=True,header=dat_head)\r\n  File \"/usr/lib/python3.5/site-packages/astropy/io/fits/convenience.py\", line 424, in writeto\r\n    checksum=checksum)\r\n  File \"/usr/lib/python3.5/site-packages/astropy/io/fits/hdu/base.py\", line 462, in writeto\r\n    checksum=checksum)\r\n  File \"/usr/lib/python3.5/site-packages/astropy/io/fits/hdu/hdulist.py\", line 686, in writeto\r\n    fileobj = _File(fileobj, mode='ostream', clobber=clobber)\r\n  File \"/usr/lib/python3.5/site-packages/astropy/io/fits/file.py\", line 150, in __init__\r\n    self._open_filename(fileobj, mode, clobber)\r\n  File \"/usr/lib/python3.5/site-packages/astropy/io/fits/file.py\", line 502, in _open_filename\r\n    self._file = fileobj_open(self.name, PYFITS_MODES[mode])\r\n  File \"/usr/lib/python3.5/site-packages/astropy/io/fits/util.py\", line 389, in fileobj_open\r\n    return open(filename, mode, buffering=0)\r\nFileNotFoundError: [Errno 2] No such file or directory: 'example/rawdata//reduced/data/red_example/rawdata/m33_V_120.0051.fits'\r\n```\r\n\r\nThis can be fixed by defining the output FITS file in line 210 using the os.path.basename function.\r\n\r\n```\r\n    name = direc+'/reduced/data/red_'+(df['fname'][n]).replace(direc+\"/\",\"\")\r\n```\r\n\r\nreplaced by:\r\n\r\n```\r\n    name = os.path.join(direc, 'reduced/data', 'red_'+os.path.basename(df['fname'][n]))\r\n```\r\n"}}
{"actor":{"display_login":"kweis"}}