Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OSERROR When mkdir
#1
Error:
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'D:\\1. Oshadha\\2. Code\\Python\\11. Discord Bot\\Logs\\1 Session 22/06/29 - 10:34:05.txt'
def time_now():
    t = datetime.datetime.now()
    frmt = t.strftime('%y/%m/%d - %H:%M:%S')
    return frmt

current_Dir = os.getcwd()
log_Dir = os.path.join(current_Dir + "\\Logs\\")

cSession = f'{log_Dir}{ID} Session {time_now()}.txt'
os.mkdir(cSession)
Whats wrong??


EDIT: I got it, Invalid File Name. Cant use special Characters.
Im Dumb..
Reply


Messages In This Thread
OSERROR When mkdir - by Oshadha - Jun-29-2022, 05:10 AM
RE: OSERROR When mkdir - by Axel_Erfurt - Jun-29-2022, 08:18 AM
RE: OSERROR When mkdir - by DeaD_EyE - Jun-29-2022, 08:36 AM
RE: OSERROR When mkdir - by Axel_Erfurt - Jun-29-2022, 08:45 AM
RE: OSERROR When mkdir - by DeaD_EyE - Jun-29-2022, 08:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  OSError occurs in Linux. anna17 2 447 Mar-23-2024, 10:00 PM
Last Post: snippsat
  directory not being created after os.mkdir() CAD79 3 485 Mar-16-2024, 04:00 PM
Last Post: deanhystad
  OSError with SMPT script Milan 0 862 Apr-28-2023, 01:34 PM
Last Post: Milan
  OSError: Unable to load libjvm when connecting to hdfs with pyarrow 3.0.0 aupres 0 3,247 Mar-22-2021, 10:25 AM
Last Post: aupres
  pyarrow throws oserror winerror 193 1 is not a valid win32 application aupres 2 3,893 Oct-21-2020, 01:04 AM
Last Post: aupres
  Python Paramiko mkdir command overwriting existing folder. How can i stop that? therenaydin 1 3,309 Aug-02-2020, 11:13 PM
Last Post: therenaydin
  OSError: [Errno 26] Text file busy: '/var/tmp/tmp5qbeydbp batchenr 1 4,306 Mar-20-2020, 01:58 PM
Last Post: ibreeden
  Multiprocessing OSError 'too many open files' DreamingInsanity 3 10,599 Dec-27-2019, 04:50 PM
Last Post: DreamingInsanity
  .py to exe error "oserror winerror 193" michael1789 3 4,968 Dec-03-2019, 05:49 AM
Last Post: michael1789
  OSError: [Errno 13] Permission denied Kolterdyx 3 18,038 Sep-07-2018, 11:01 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020