Hi Glyph - No joy. I checked out CalendarServer 2.5 to /Volumes/Users/cherf/tmp and tried again with the following results: [alphonse:~/tmp/CalendarServer-2.5] cherf% pwd /Users/cherf/tmp/CalendarServer-2.5 [alphonse:~/tmp/CalendarServer-2.5] cherf% python Python 2.6.6 (r266:84292, Jun 8 2011, 18:50:17) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import socket skt = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) skt.bind("some.socket") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<string>", line 1, in bind socket.error: [Errno 22] Invalid argument skt.bind ("/tmp/some.socket") skt.listen(5)
The previous pathname length was 87 characters (plus 12 for "/some.socket" = 99) which doesn't seem too long for a POSIX name. I noticed the python manual made a distinction between relative and absolute pathnames in bind statements, which was why I thought that was the difference. but I'm just guessing. I might get closer if it were possible to include something that would let me test the two statements: skt = self.createInternetSocket() skt.bind (self.port) in relative isolation but I couldn't find the createInternetSocket method (in fact I don't know enough about python to guess what sort of object "self" is :). It still looks like some sort of python problem to me though. I noticed that unix.py makes a reference to twisted.test.test_unix. Is that test case available somewhere? Perhaps running it on my system would give me a better idea of what's happening. Failing that I'll need to spend some time learning the Python debugger. Regards, Scott. On Jun 10, 2011, at 9:35 PM, Glyph Lefkowitz wrote:
Hi Scott,
Relative paths work fine, too. However, I think the length of the full absolute path may be an issue in some cases, even if you pass it as a short relative path. If you try creating a relative-path socket in a shorter path, like your home directory, it should work.
Try putting your CalendarServer checkout somewhere with a very short path, like /dccs/ instead of ~/Projects/Blah/Blah/Blah/. I'd be interested to know if that fixes it. I actually remember fixing a bug in this area a while ago: it's probably fixed on the 3.x line but not 2.x.
Thanks and good luck,
-glyph
On Jun 10, 2011, at 6:03 PM, Scott Cherf wrote:
Hello John -
Forgive my doubts, as you mention I had best read the manual.
You are correct, I was using python's bind incorrectly, the correct code fragment is shown below:
[alphonse:~] cherf% cd Projects/Source/MacOSForge/CalendarServer/tags/release/CalendarServer-2.5/ /Users/cherf/Projects/Source/MacOSForge/CalendarServer/tags/release/CalendarServer-2.5 [alphonse:tags/release/CalendarServer-2.5] cherf% python Python 2.6.6 (r266:84292, Jun 8 2011, 18:50:17) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import socket skt = socket.socket (socket.AF_UNIX, socket.SOCK_STREAM) skt.bind ("/tmp/some.socket") skt.listen(5)
In fact, this works just fine on both my development machine and the server I'm trying to install the iCal server on, the difficulty was in the use of a relative pathname rather than an absolute name. Using a relative path on macOS apparently does not work, however changing the fragment to an absolute name works fine.
Unfortunately this leaves me wrestling with the original problem, which is to understand why I'm seeing the error from Twisted.
Again, thanks for the suggestion,
Scott.
On Jun 8, 2011, at 10:35 PM, Holland, John wrote:
On 09.06.2011, at 07:25, "Scott Cherf" <cherf@ambient-light.com> wrote:
Using the fresh python 2.6 installed at /opt/local/bin/python I observed the following:
[alphonse:tags/release/Twisted] cherf% python Python 2.6.6 (r266:84292, Jun 8 2011, 18:50:17) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information.
> import socket > skt = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) > skt.bind("some.socket") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<string>", line 1, in bind socket.error: [Errno 22] Invalid argument >
I believe your using pythons bind incorrectly. Have a look at http://docs.python.org/release/2.6.6/library/socket.html ___________________________________
Cellent Finance Solutions AG
Firmensitz: Calwer Straße 33, 70173 Stuttgart Registergericht: Amtsgericht Stuttgart, HRB 720743 Vorstand: Thomas Wild Vorsitzender des Aufsichtsrats: Rudolf Zipf
_______________________________________________ calendarserver-users mailing list calendarserver-users@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/calendarserver-users