ScottJDaley / ada

A Discord bot for the Satisfactory video game.
MIT License
29 stars 5 forks source link

optimizer ko on linux #82

Closed Sapph0 closed 2 years ago

Sapph0 commented 2 years ago
Traceback (most recent call last):
  File "tool.py", line 49, in <module>
    loop.run_until_complete(main())
  File "/usr/lib64/python3.7/asyncio/base_events.py", line 587, in run_until_complete
    return future.result()
  File "tool.py", line 43, in main
    await handle_query(raw_query)
  File "tool.py", line 30, in handle_query
    result = await ada.do(raw_query)
  File "/bot/ada/ada/ada.py", line 26, in do
    return await self.__opt.optimize(query)
  File "/bot/ada/ada/optimizer.py", line 366, in optimize
    os.makedirs(os.path.dirname(filename), exist_ok=True)
  File "/usr/lib64/python3.7/os.py", line 223, in makedirs
    mkdir(name, mode)
FileNotFoundError: [Errno 2] No such file or directory: ''

on an aws ec2 Amazon Linux.

can be corrected on this platform by replacing in the file ada/optimizer.py

# Write out complete problem to file
        filename = 'output\problem.txt'
        os.makedirs(os.path.dirname(filename), exist_ok=True)

the \ by a /

dopeghoti commented 2 years ago

Technically rather than hardcoding either a \ or a / it should be using os.path.sep to just use the correct slash for the environment.