Re: Seeking Assistance with Python's IDLE for Blind Users

2024-11-12 Thread Jacob Kruger via Python-list
Jeff, there are a few specific programmer's resources for blind/VI programmers that might help more - I am myself a 100% blind programmer, and, would not necessarily recommend idol from our perspective, since most people use VS code, or things like edSharp or even pycharm, but, I am a user of N

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Rob Cliffe via Python-list
On 12/11/2024 08:52, Loris Bennett via Python-list wrote: Cameron Simpson writes: Generally you should put a try/except around the smallest possible piece of code. That is excellent advice. Best wishes Rob Cliffe So: config = configparser.ConfigParser() try: config.r

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Loris Bennett via Python-list
Chris Angelico writes: > On Tue, 12 Nov 2024 at 01:59, Loris Bennett via Python-list > wrote: >> 2. In terms of generating a helpful error message, how should one >>distinguish between the config file not existing and the log file not >>existing? > > By looking at the exception's attribu

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Karsten Hilbert via Python-list
Am Tue, Nov 12, 2024 at 09:52:31AM +0100 schrieb Loris Bennett via Python-list: > Regarding your example above, if 'missingfile.py' contains the following > > import configparser > > config = configparser.ConfigParser() > > try: > config.read('/foo/bar') > except FileNotFoundError as

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Chris Angelico via Python-list
On Wed, 13 Nov 2024 at 07:29, Mats Wichmann via Python-list wrote: > > On 11/12/24 12:10, Left Right via Python-list wrote: > > > Finally, if you want your logs to go to a file, and currently, your > > only option is stderr, your shell gives you a really, really simple > > way of redirecting stder

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Greg Ewing via Python-list
On 13/11/24 8:10 am, Left Right wrote: since logs are designed to grow indefinitely, the natural response to this design property is log rotation. I don't see how writing logs to stderr solves that problem in any way. Whatever stderr is sent to still has a potentially unlimited amount of data t

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Mats Wichmann via Python-list
On 11/12/24 12:10, Left Right via Python-list wrote: Finally, if you want your logs to go to a file, and currently, your only option is stderr, your shell gives you a really, really simple way of redirecting stderr to a file. So, really, there aren't any excuses to do that. an awful lot of th

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Loris Bennett via Python-list
Cameron Simpson writes: > On 11Nov2024 18:24, dieter.mau...@online.de wrote: >>Loris Bennett wrote at 2024-11-11 15:05 +0100: >>>I have the following in my program: >>>try: >>>logging.config.fileConfig(args.config_file) >>>config = configparser.ConfigParser() >>>confi

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Loris Bennett via Python-list
Chris Angelico writes: > On Tue, 12 Nov 2024 at 01:59, Loris Bennett via Python-list > wrote: >> 2. In terms of generating a helpful error message, how should one >>distinguish between the config file not existing and the log file not >>existing? > > By looking at the exception's attribu

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Loris Bennett via Python-list
Left Right writes: > Poor error reporting is a very common problem in programming. Python > is not anything special in this case. Of course, it would've been > better if the error reported what file wasn't found. But, usually > these problems are stacking, like in your code. Unfortunately, it

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Left Right via Python-list
> I am not entirely convinced by NB2. I am, in fact, a sort of sysadmin > person and most of my programs write to a log file. The programs are > also moderately complex, so a single program might access a database, > query an LDAP server, send email etc., so potentially quite a lot can go > wrong

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Dieter Maurer via Python-list
Cameron Simpson wrote at 2024-11-12 08:17 +1100: >On 11Nov2024 18:24, dieter.mau...@online.de wrote: >>Loris Bennett wrote at 2024-11-11 15:05 +0100: >>>I have the following in my program: >>>try: >>>logging.config.fileConfig(args.config_file) >>>config = configparser.ConfigPar