Ticket #172 (new task)

Opened 8 months ago

Last modified 6 months ago

remove os.access usage

Reported by: Ramereth Owned by:
Priority: normal Milestone: 0.5
Component: pkgcore Version: 0.4.4
Keywords: Cc:

Description

As requested by ferringb in #pkgcore, Please remove os.access usage in pkgcore as there are some issues with it on SunOS. Specifically, os.access(filename, os.X_OK) does not return the proper test case on solaris. If you need more information, please let me know!

Change History

comment:1 Changed 8 months ago by Ramereth

For documentation sake, here's the output of the test case:

======================================================================

FAIL: test_find_binary (pkgcore.test.test_spawn.SpawnTest)

----------------------------------------------------------------------

Traceback (most recent call last):

  File "/usr/lib/python2.4/site-packages/snakeoil/test/__init__.py", line 171, in run

    self.forced_extra_frame(testMethod)

  File "/usr/lib/python2.4/site-packages/snakeoil/test/__init__.py", line 140, in forced_extra_frame

    test()

  File "/tmp/pkgcore-0.4.5/pkgcore/test/test_spawn.py", line 43, in test_find_binary

    self.assertRaises(spawn.CommandNotFound, spawn.find_binary, script_name)

AssertionError: CommandNotFound not raised



----------------------------------------------------------------------

And as a simple test:

root@poplar / # touch foon; chmod 0640 foon; python -c 'import os;print os.access("foon", os.X_OK)'
True
root@poplar / # ls -l foon
-rw-r-----   1 root     101            0 Apr 21 17:06 foon

So something is lying :-)

comment:2 Changed 7 months ago by ferringb

  • milestone changed from 0.4.5 to 0.4.7

Bleh. this will be 0.4.7, sorry.

Got a set of fixups/features want to release, and frankly I don't want to replace access quite yet (mainly since I'm dreading the logic ;). Will attach a patch w/in a few days.

comment:3 Changed 6 months ago by masterdriverz

  • type changed from defect to task
Note: See TracTickets for help on using tickets.