-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PrinterInterface.select_file() doesn't work with relative paths #2601
Comments
Hi @michaelnew, It looks like there is some information missing from your bug report that will be needed in order to solve the problem. Read the Contribution Guidelines which will provide you with a template to fill out here so that your bug report is ready to be investigated (I promise I'll go away then too!). If you did not intend to report a bug but wanted to request a feature or brain storm about some kind of development, please take special note of the title format to use as described in the Contribution Guidelines. Please do not abuse the bug tracker as a support forum - that can be found at discourse.octoprint.org. Go there for any kind of issues with network connectivity, webcam functionality, printer detection or any other kind of such support requests or general questions. Also make sure you are at the right place - this is the bug tracker of the official version of OctoPrint, not the Raspberry Pi image OctoPi nor any unbundled third party OctoPrint plugins or unofficial versions. Make sure too that you have read through the Frequently Asked Questions and searched the existing tickets for your problem - try multiple search terms please. I'm marking this one now as needing some more information. Please understand that if you do not provide that information within the next two weeks (until 2018-05-04 21:10 UTC) I'll close this ticket so it doesn't clutter the bug tracker. This is nothing personal, so please just be considerate and help the maintainers solve this problem quickly by following the guidelines linked above. Remember, the less time the devs have to spend running after information on tickets, the more time they have to actually solve problems and add awesome new features. Thank you! Best regards, PS: I'm just an automated script, not a human being, so don't expect any replies from me :) Your ticket is read by humans too, I'm just not one of them. |
* properly handle relative paths for selection * properly handle absolute paths for recovery data comparison Fixes #2601
No, the system should detect stuff correctly without you having to do anything special. This is were the magic happens. What confuses me is that it does so just fine over here on
|
Well, I must be going crazy, because the error I'm getting is, in fact, an IOError.
I think I may have been getting I wasn't able to run the maintenance branch because this happened (I'm guessing it's related to different dependency versions), but I was able to cherry pick that commit onto the Also thanks for the help on |
What were you doing?
I'm writing a plugin that can select prints and start print jobs. I have a path to a local file, i.e.
test_scripts/test1.gcode
and I'm trying to select it and start it printing with
self._printer.select_file("test_scripts/test1.gcode", False, True)
but it fails to select it with
InvalidFileLocation
If I use the full path it selects the file and starts the print just fine:
self._printer.select_file("/home/pi/.octoprint/uploads/test_scripts/test1.gcode", False, True)
What did you expect to happen?
The docs show this:
path (str) – The path to select for printing. Either an absolute path or relative path to a local file in the uploads folder or a filename on the printer’s SD card.
so I expected the relative path to just work.
Am I supposed to specify that the path is relative somehow, or does the function just try to interpret a path with a leading
/
as absolute and a path without/
as relative? If relative paths aren't supposed to work they way I think they are, what's the recommended way of getting the path to the uploads folder? Hardcoding obviously isn't a good solution.What happened instead?
InvalidFileLocation
Did the same happen when running OctoPrint in safe mode?
I'm working inside a plugin, so safe mode is a no-go. I'm not sure of a good way to create a test case without a plugin.
Version of OctoPrint
OctoPrint 1.4.0.dev979+g58f73f3
Operating System running OctoPrint
OctoPi 0.14.0
Printer model & used firmware incl. version
Custom built RepRap monstrosity running Smoothieware.
Browser and version of browser, operating system running browser
Browser: Chromium 65.0.3325.181 (Official Build) Arch Linux (64-bit)
OS: Arch Linux x86_64
Kernel: 4.15.15-1-ARCH
Link to octoprint.log
https://gist.github.com/michaelnew/977bb253e7370ef44e879cc298f184c5
Link to contents of terminal tab or serial.log
Link to contents of Javascript console in the browser
Screenshot(s)/video(s) showing the problem:
I have read the FAQ.
The text was updated successfully, but these errors were encountered: