Ubuntu 19.10 beta: Python 3: os.path.exists and os.path.isfile aren't working properly

Asked by Hamish McIntyre-Bhatty

Would report a bug, but can't figure it out - button doesn't seem to work.

When one runs "os.path.isfile("/vmlinuz")" or the same for os.path.exists, False is returned. However, given the information at: https://docs.python.org/3.8/library/os.path.html#os.path.isfile and https://docs.python.org/3.7/library/os.path.html#os.path.isfile, True should be returned for links as well.

"os.path.islink("/vmlinuz")" works as expected, so I'm not sure what's going on here.

Any ideas? It could be my VM as it's been running 19.10 for a little while now.

Hamish

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Hamish McIntyre-Bhatty
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Please report a bug. Eoan is not ready and not even remotely stable.

If you want an OS that works then I suggest you remove the intall and use Ubuntu Bionic (version 18.04). This ius LTS and supported long after Eoan is end of life (EOL).

If you are happy to put up with bugs and feature holes and want to submit bugs to get Eoan ready for release in October then by all means use it but it will not be a smooth ride up to and even a few weeks after release.

Revision history for this message
Hamish McIntyre-Bhatty (hamishmb) said :
#2

Okay, shall try to convert to a bug. I'm not using this as my daily driver at all, I just want to do some pre-testing of software on it.

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

What is the output of

ls -l /vmlinuz

and (if it is a link) "ls -l" with the target?

Revision history for this message
Hamish McIntyre-Bhatty (hamishmb) said :
#4

Note that this happens with /initrd.img too. It also happens regardless of whether Python 3 is run as root or not.

ls -l /vmlinuz:

lrwxrwxrwx 1 root root 29 Apr 24 18:08 /vmlinuz -> boot/vmlinuz-5.0.0-13-generic

ls -l /initrd.img:
lrwxrwxrwx 1 root root 32 Apr 24 18:08 /initrd.img -> boot/initrd.img-5.0.0-13-generic

ls -l /boot:

total 381376
-rw-r--r-- 1 root root 512 Sep 18 11:40 boot.0800
-rw-r--r-- 1 root root 113162 Sep 18 11:45 coffee.bmp
-rw-r--r-- 1 root root 224306 Jun 4 16:22 config-5.0.0-17-generic
-rw-r--r-- 1 root root 224306 Jun 24 09:09 config-5.0.0-20-generic
-rw-r--r-- 1 root root 233572 Jul 30 17:13 config-5.2.0-10-generic
-rw-r--r-- 1 root root 233572 Aug 15 14:35 config-5.2.0-13-generic
-rw-r--r-- 1 root root 233593 Jul 8 13:13 config-5.2.0-8-generic
-rw-r--r-- 1 root root 236478 Sep 9 09:00 config-5.3.0-10-generic
-rw-r--r-- 1 root root 22466 Sep 18 11:45 debian.bmp
-rw-r--r-- 1 root root 22560 Sep 18 11:45 debian-de.bmp
-rw-r--r-- 1 root root 31628 Sep 18 11:45 debianlilo.bmp
drwx------ 3 root root 4096 Jan 1 1970 efi
drwxr-xr-x 6 root root 4096 Sep 17 16:26 grub
lrwxrwxrwx 1 root root 27 Sep 17 16:15 initrd.img -> initrd.img-5.3.0-10-generic
-rw-r--r-- 1 root root 50245101 Sep 17 16:13 initrd.img-5.0.0-17-generic
-rw-r--r-- 1 root root 50245005 Sep 17 16:12 initrd.img-5.0.0-20-generic
-rw-r--r-- 1 root root 51109853 Sep 17 16:12 initrd.img-5.2.0-10-generic
-rw-r--r-- 1 root root 51113873 Sep 17 16:12 initrd.img-5.2.0-13-generic
-rw-r--r-- 1 root root 51019135 Sep 17 16:12 initrd.img-5.2.0-8-generic
-rw-r--r-- 1 root root 51333925 Sep 17 16:17 initrd.img-5.3.0-10-generic
lrwxrwxrwx 1 root root 27 Sep 17 16:15 initrd.img.old -> initrd.img-5.2.0-13-generic
-rw-r--r-- 1 root root 22578 Sep 18 11:45 inside.bmp
-rw-r--r-- 1 root root 182704 Jan 28 2016 memtest86+.bin
-rw-r--r-- 1 root root 184380 Jan 28 2016 memtest86+.elf
-rw-r--r-- 1 root root 184840 Jan 28 2016 memtest86+_multiboot.bin
-rw-r--r-- 1 root root 6878 Sep 18 11:45 onlyblue.bmp
-rw------- 1 root root 4378278 Jun 4 16:22 System.map-5.0.0-17-generic
-rw------- 1 root root 4378356 Jun 24 09:09 System.map-5.0.0-20-generic
-rw------- 1 root root 4655360 Jul 30 17:13 System.map-5.2.0-10-generic
-rw------- 1 root root 4656289 Aug 15 14:35 System.map-5.2.0-13-generic
-rw------- 1 root root 4599539 Jul 8 13:13 System.map-5.2.0-8-generic
-rw------- 1 root root 4702387 Sep 9 09:00 System.map-5.3.0-10-generic
-rw-r--r-- 1 root root 33192 Sep 18 11:45 tuxlogo.bmp
lrwxrwxrwx 1 root root 24 Sep 17 16:15 vmlinuz -> vmlinuz-5.3.0-10-generic
-rw------- 1 root root 8703736 Jun 4 16:08 vmlinuz-5.0.0-17-generic
-rw------- 1 root root 8703736 Jun 24 09:59 vmlinuz-5.0.0-20-generic
-rw------- 1 root root 9016056 Jul 30 17:19 vmlinuz-5.2.0-10-generic
-rw------- 1 root root 9020152 Aug 15 16:15 vmlinuz-5.2.0-13-generic
-rw------- 1 root root 8987384 Jul 8 05:06 vmlinuz-5.2.0-8-generic
-rw------- 1 root root 11387640 Sep 9 15:19 vmlinuz-5.3.0-10-generic
lrwxrwxrwx 1 root root 24 Sep 17 16:15 vmlinuz.old -> vmlinuz-5.2.0-13-generic

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

The target where /vmlinuz is pointing to (/boot/vmlinuz-5.0.0-13-generic) does not exist!
Python is right.

Revision history for this message
Hamish McIntyre-Bhatty (hamishmb) said :
#6

Oh yeah, how did I miss that?

Still have to wonder why the shortcut wasn't updated though.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#7

Because it's pre-release and not ready.......