Timeline for Problems with os.rename | OSError: [WinError 123]
Current License: CC BY-SA 4.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 5 at 16:06 | vote | accept | Idokoond K | ||
Jul 5 at 16:03 | answer | added | Barmar | timeline score: 0 | |
Jul 5 at 16:03 | comment | added | Idokoond K | Since it is copied directly from the files, it comes with quotes so I can't really do that in code, maybe I can copy paste it into notepad or something and remove the quotes that way or something but I can't do it directly from the code, at least not to the extent of my knowledge, which, to be fair, is limited | |
Jul 5 at 16:02 | comment | added | Barmar |
Looks like you didn't remove the quotes from m .
|
|
Jul 5 at 16:01 | comment | added | Idokoond K | So I removed the mxk function and the +cc but I'm still getting a print response of: "C:\lbnl_secj_app_b_m134.pdf" "C:\blank.pdf the second var still has an opening quote does that mean I have to do some weird text alter thing to the m variable first to remove the quotes before bring them to nm? | |
Jul 5 at 15:57 | comment | added | Barmar |
Yes, you need to remove the quotes. They're needed in cmd, but not in os.rename() (or any other functions in Python).
|
|
Jul 5 at 15:56 | comment | added | Idokoond K | So what it sounds like you're saying @Barmar is that I won't need the quote characters when using them to reference path in a cmd, the problem is the method that I'm using to copy the path is directly from the files and it comes with quotes around it, do I need to remove those quotes in the m variable? and if so, do I need to remove the quotes in the nd variable as well? | |
Jul 5 at 15:54 | comment | added | Barmar | Paths don't need quotes to be valid. You're confusing the path with the shell syntax. | |
Jul 5 at 15:53 | comment | added | Idokoond K | The reason I'm adding a double quote at the end is because if I don't the print response will be missing an end quote and not be a valid path | |
Jul 5 at 15:32 | comment | added | Barmar | Quotes are needed when you're typing some filenames into the command prompt. They're not used when calling an API. | |
Jul 5 at 15:32 | comment | added | Barmar | It also looks like you're copying the double-quote characters into the clipboard. Don't do that. | |
Jul 5 at 15:31 | history | edited | Barmar | CC BY-SA 4.0 |
added 16 characters in body
|
Jul 5 at 15:30 | comment | added | Barmar |
Why are you appending literal double-quote characters to the filename? Get rid of the mxk stuff.
|
|
S Jul 5 at 15:24 | review | First questions | |||
Jul 5 at 16:07 | |||||
S Jul 5 at 15:24 | history | asked | Idokoond K | CC BY-SA 4.0 | created from wizard |