Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FileNotFoundError: [Errno 2] ?
#1
Hi,

I have the following code in a class that works perfectly fine when inside it. Now when accessing through another class file presents me with error. Below I demonstrate the class that works:

import os 
class WspApplication:

ws_listdir = os.listdir('../application/controllers')
This class works when I print inside it.
It only presents the error below when I try to access it in another class:
ws_listdir = os.listdir('../application/controllers') FileNotFoundError: [Errno 2] No such file or directory: '../application/controllers'

Below is the other class:

from syscore.wsp_application import WspApplication
class WspProtected:

def wsm_dir(ws_path):
   ws_root = WspApplication.ws_listdir
   if ws_path == ws_root:
       return 'Info. . .'.encode('utf-8')
Can disregard the path parameter in the analysis it works!
Obs: These classes are in the same directories, without permissions and using python 3.7.3
Reply


Messages In This Thread
FileNotFoundError: [Errno 2] ? - by JohnnyCoffee - Sep-22-2019, 02:03 AM
RE: FileNotFoundError: [Errno 2] ? - by Gribouillis - Sep-22-2019, 08:27 AM
RE: FileNotFoundError: [Errno 2] ? - by Gribouillis - Sep-22-2019, 01:08 PM
RE: FileNotFoundError: [Errno 2] ? - by Gribouillis - Sep-23-2019, 04:48 AM
RE: FileNotFoundError: [Errno 2] ? - by Gribouillis - Sep-23-2019, 02:45 PM
RE: FileNotFoundError: [Errno 2] ? - by Gribouillis - Sep-23-2019, 03:57 PM
RE: FileNotFoundError: [Errno 2] ? - by Gribouillis - Sep-24-2019, 06:49 AM
RE: FileNotFoundError: [Errno 2] ? - by Gribouillis - Sep-24-2019, 05:59 PM

Forum Jump:

User Panel Messages

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