Produce a specific exception in python

I’d like to produce an exception specific to the error that I’m getting. On obtaining a session for AWS the user must input an MFA code: try: session = boto3.Session(profile_name=aws_account,region_name=’us-east-1′) except ValidationError as validation_error: print(f”A validation error has occurred: {vallidation_error}”) except Exception as e: print(f”An exception has occurred: {e}”) set_regions(aws_account) The exception looks like this:…

Details

I messed up the `/usr/bin/python3` in Ubuntu 18.04, how can I install it back

I was trying to linking different versions of python3 and now I messed up the /usr/bin/python3 and /usr/bin/python3.6. Now I have the /usr/bin/python2 and /usr/local/bin/python3.7 still working. If I type python3 or python3.6, I got bad interpreter: No such file or directory But when I run sudo apt-get install python3 It says python3 is already…

Details

Ubuntu 18.04 – bluetooth mouse random disconnection

I’m experienced with constant and random mouse disconnect, when connected the mouse and keyboard work perfectly fine, I tried all the solutions described in these article: Bluetooth mouse constantly disconnects and reconnects but nothing seems to work. dpkg –status bluez | grep ‘^Version:’ Version: 5.50-0ubuntu0ppa1 uname -a Linux XYZ 4.15.0-1066-oem #76-Ubuntu bluetoothctl devices Device 00:XX:XX:XX:XX:XX…

Details

Error while upgrading through sudo apt-get upgrade command

Setting up oracle-java11-installer-local (11.0.5-1~linuxuprising0) … Before installing this package, please download the Oracle JDK 11 .tar.gz file with the same version as this package (version 11.0.4), and place it in /var/cache/oracle-jdk11-installer-local, E.g.: sudo mkdir -p /var/cache/oracle-jdk11-installer-local sudo cp jdk-11.0.4_linux-x64_bin.tar.gz /var/cache/oracle-jdk11-installer-local/ sha256sum mismatch jdk-11.0.5_linux-x64_bin.tar.gz Oracle JDK 11 is NOT installed. dpkg: error processing package oracle-java11-installer-local (–configure):…

Details