Ticket #799 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

repyhelper translate errors

Reported by: sjs25 Owned by: cemeyer
Priority: major Milestone:
Component: - Version: 0.1o
Severity: Medium Keywords: repyhelper, translate
Cc: justinc Blocking:
Blocked By:


I tried to use repyhelper's translate_and_import command to translate a repy file into python. It didn't matter which repy file I used, but I always got a TranslationError? saying:

"TranslationError?: Cannot open file for translation <insert path to repy file here>: [Errno 2] No such file or directory: \'c:\\\\users\\\\owner\\\\appdata\\\\local\\\\temp\\\\tmpxfzlau\\\\<insert original repy filename here>_repy.py"

After putting "set_importcachedir(sys.path.append('.'))" on the line before, it correctly translated the file. However, I think it should have been able to open my file in the first place (I've determined that it is not a permissions issue).

I am currently running Vista Home Premium.

Change History

Changed 10 years ago by cemeyer

My initial guess is that when the user doesn't specify the cachedir to use, we use a temporary directory created with Python's tempdir or tempfile facilities, and that in the case of Vista, this is broken. This *may* be a python bug. However, there is probably something we can do to fix it, and I'll look into this.

Changed 10 years ago by cemeyer

Would you update to r3329 and see if that fixes it? I've tried it on testbed-vista1 and linux and it seems to work.

The problem is that repyhelper creates the .py file in the first component of PYTHONPATH (or sys.path) if the path to the script is a relative one (which it will be, most of the time). Apparently you don't have that directory. Now, we try to create the directory first if it doesn't exist. An alternative fix would be to assume '.' instead of the first component of PYTHONPATH.

Changed 10 years ago by cemeyer

  • status changed from new to closed
  • resolution set to fixed

I'm going to close it now, reopen this if it's still broken (I have some degree of confidence that this should work).

Note: See TracTickets for help on using tickets.