caravelahc / paratex

Extrator de presença parlamentar.
11 stars 7 forks source link

O __main__.py ta quebrado #15

Closed GabrielSimonetto closed 4 years ago

GabrielSimonetto commented 4 years ago

Descrição

paratex git:(master) poetry run python paratex    
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "paratex/__main__.py", line 33, in <module>
    main()
  File "paratex/__main__.py", line 16, in main
    dataframe.to_csv(f"output/{dataframe.iloc[1,3]}.csv")
  File "/home/gabriel/.cache/pypoetry/virtualenvs/paratex-py3.7/lib/python3.7/site-packages/pandas/core/generic.py", line 3228, in to_csv
    formatter.save()
  File "/home/gabriel/.cache/pypoetry/virtualenvs/paratex-py3.7/lib/python3.7/site-packages/pandas/io/formats/csvs.py", line 183, in save
    compression=self.compression,
  File "/home/gabriel/.cache/pypoetry/virtualenvs/paratex-py3.7/lib/python3.7/site-packages/pandas/io/common.py", line 399, in _get_handle
    f = open(path_or_buf, mode, encoding=encoding, newline="")
FileNotFoundError: [Errno 2] No such file or directory: 'output/2011-10-31.csv'

Reprodução

Como reproduzir o bug:

  1. poetry run python __main__.py
caiopo commented 4 years ago

Aqui tá funcionando 🤔

caiopo commented 4 years ago

O problema é que o arquivo tá sendo aberto relativo ao working dir. Vou ver se conserto.

GabrielSimonetto commented 4 years ago

Oh, makes sense, só precisa garantir que o path existe antes né? Cara, se tu quiser eu posso fazer isso tambem