<div dir="ltr"><div>Issue #173 with patch:</div><div><br></div><a href="https://github.com/IronLanguages/main/issues/173">https://github.com/IronLanguages/main/issues/173</a><br><div><br></div><div>That works for me! I just removed the removal of the slash. I don't know what that will do for Windows users that had a path that started with "/".</div>
<div><br></div><div>We distribute our own DLLs, so no rush for a new release.</div><div><br></div><div>Thanks!</div><div><br></div><div>-Doug</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 11, 2014 at 4:39 AM, Jeff Hardy <span dir="ltr"><<a href="mailto:jdhardy@gmail.com" target="_blank">jdhardy@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Mon, Feb 10, 2014 at 10:15 PM, Slide <<a href="mailto:slide.o.mix@gmail.com">slide.o.mix@gmail.com</a>> wrote:<br>
> That seems a little odd. Perhaps Jeff can shed some light on it, I think he<br>
> wrote the SQLite adaptation layer.<br>
<br>
</div>I did, but the funny code is part of the C#-sqlite library, which is a<br>
port of the C library to C#. (if you're feeling brave, dig through the<br>
code. It's ... interesting.) It looks like the author just assumed<br>
Windows-ish systems in all cases, and Doug has to go and break<br>
everything by trying to run it on Unix. :(<br>
<br>
I have no idea what that code is trying to do (context:<br>
<a href="https://github.com/IronLanguages/main/blob/master/Languages/IronPython/IronPython.SQLite/c%23sqlite/os_win_c.cs#L2646" target="_blank">https://github.com/IronLanguages/main/blob/master/Languages/IronPython/IronPython.SQLite/c%23sqlite/os_win_c.cs#L2646</a>);<br>
it might be some vestigial part of SQLite that's not needed. Since //<br>
seems OK I'm assuming that's the case.<br>
<br>
Doug, can you open an issue? And in the meantime, is using // an<br>
acceptable workaround?<br>
<span class="HOEnZb"><font color="#888888"><br>
- Jeff<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
><br>
> On Mon, Feb 10, 2014 at 3:14 PM, Doug Blank <<a href="mailto:doug.blank@gmail.com">doug.blank@gmail.com</a>> wrote:<br>
>><br>
>> That must be the issue, as "//home/dblank/name.db" works:<br>
>><br>
>> $ ipy.exe<br>
>> IronPython 2.9.9a0 DEBUG (2.9.0.0) on Mono 4.0.30319.1 (64-bit)<br>
>> Type "help", "copyright", "credits" or "license" for more information.<br>
>> >>> import sqlite3<br>
>> >>> sqlite3.connect("//home/dblank/test.db")<br>
>> <Connection object at 0x000000000000002B><br>
>> >>><br>
>><br>
>> -Doug<br>
>><br>
>><br>
>><br>
>> On Mon, Feb 10, 2014 at 5:12 PM, Doug Blank <<a href="mailto:doug.blank@gmail.com">doug.blank@gmail.com</a>> wrote:<br>
>>><br>
>>> After more testing, it appears that it only fails when the path begins<br>
>>> with a slash "/".<br>
>>><br>
>>> I see:<br>
>>><br>
>>> ./c#sqlite/os_win_c.cs: if ( zConverted.StartsWith( "/" ) &&<br>
>>> !zConverted.StartsWith( "//"<br>
>>><br>
>>> I'll try a couple of more things...<br>
>>><br>
>>> -Doug<br>
>>><br>
>>><br>
>>> On Mon, Feb 10, 2014 at 9:19 AM, Doug Blank <<a href="mailto:doug.blank@gmail.com">doug.blank@gmail.com</a>> wrote:<br>
>>>><br>
>>>><br>
>>>> On Mon, Feb 10, 2014 at 8:47 AM, Slide <<a href="mailto:slide.o.mix@gmail.com">slide.o.mix@gmail.com</a>> wrote:<br>
>>>>><br>
>>>>> All the connect call does is this:<br>
>>>>><br>
>>>>> int rc = Sqlite3.sqlite3_open(database, out this.db);<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> if(rc != Sqlite3.SQLITE_OK)<br>
>>>>> throw GetSqliteError(this.db, null);<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> Which makes me thing that sqlite3_open is returning an error code. What<br>
>>>>> happens if you do the same in CPython?<br>
>>>><br>
>>>><br>
>>>> No error, creates a file of length 0, and works:<br>
>>>><br>
>>>> $ python<br>
>>>> Python 2.7.5+ (default, Sep 19 2013, 13:48:49)<br>
>>>> [GCC 4.8.1] on linux2<br>
>>>> Type "help", "copyright", "credits" or "license" for more information.<br>
>>>> >>> import sqlite3<br>
>>>> >>> sqlite3.connect("/home/dblank/test.db")<br>
>>>> <sqlite3.Connection object at 0x7fc3c21b6118><br>
>>>> >>><br>
>>>><br>
>>>> $ ls -al /home/dblank/test.db<br>
>>>> -rw-r--r-- 1 dblank dblank 0 Feb 10 09:15 /home/dblank/test.db<br>
>>>><br>
>>>> -Doug<br>
>>>><br>
>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> On Fri, Feb 7, 2014 at 6:01 AM, Doug Blank <<a href="mailto:doug.blank@gmail.com">doug.blank@gmail.com</a>><br>
>>>>> wrote:<br>
>>>>>><br>
>>>>>><br>
>>>>>> On Fri, Feb 7, 2014 at 7:47 AM, Slide <<a href="mailto:slide.o.mix@gmail.com">slide.o.mix@gmail.com</a>> wrote:<br>
>>>>>>><br>
>>>>>>> Do you get a specific error message?<br>
>>>>>><br>
>>>>>><br>
>>>>>> Sorry, yes:<br>
>>>>>><br>
>>>>>> Traceback (most recent call last):<br>
>>>>>> File "<string>", line 1, in <module><br>
>>>>>> _sqlite3.OperationalError: unable to open database file<br>
>>>>>><br>
>>>>>> Does this work for you? I get this error running latest ipy.exe (Mono<br>
>>>>>> 2.10, Ubuntu 13.10) and IronPython in Calico.<br>
>>>>>><br>
>>>>>> -Doug<br>
>>>>>><br>
>>>>>><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> On Fri, Feb 7, 2014 at 5:37 AM, Doug Blank <<a href="mailto:doug.blank@gmail.com">doug.blank@gmail.com</a>><br>
>>>>>>> wrote:<br>
>>>>>>>><br>
>>>>>>>> Just recently discovered the sqlite3 port for IronPython, but having<br>
>>>>>>>> some basic trouble:<br>
>>>>>>>><br>
>>>>>>>> This works fine:<br>
>>>>>>>><br>
>>>>>>>> import sqlite3<br>
>>>>>>>> sqlite3.connect("test.db")<br>
>>>>>>>><br>
>>>>>>>> but this doesn't:<br>
>>>>>>>><br>
>>>>>>>> import sqlite3<br>
>>>>>>>> sqlite3.connect("/home/dblank/test.db")<br>
>>>>>>>><br>
>>>>>>>> Any ideas?<br>
>>>>>>>><br>
>>>>>>>> -Doug<br>
>>>>>>>><br>
>>>>>>>><br>
>>>>>>>> _______________________________________________<br>
>>>>>>>> Ironpython-users mailing list<br>
>>>>>>>> <a href="mailto:Ironpython-users@python.org">Ironpython-users@python.org</a><br>
>>>>>>>> <a href="https://mail.python.org/mailman/listinfo/ironpython-users" target="_blank">https://mail.python.org/mailman/listinfo/ironpython-users</a><br>
>>>>>>>><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> --<br>
>>>>>>> Website: <a href="http://earl-of-code.com" target="_blank">http://earl-of-code.com</a><br>
>>>>>><br>
>>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> --<br>
>>>>> Website: <a href="http://earl-of-code.com" target="_blank">http://earl-of-code.com</a><br>
>>>>><br>
>>>>> _______________________________________________<br>
>>>>> Ironpython-users mailing list<br>
>>>>> <a href="mailto:Ironpython-users@python.org">Ironpython-users@python.org</a><br>
>>>>> <a href="https://mail.python.org/mailman/listinfo/ironpython-users" target="_blank">https://mail.python.org/mailman/listinfo/ironpython-users</a><br>
>>>>><br>
>>>><br>
>>><br>
>><br>
><br>
><br>
><br>
> --<br>
> Website: <a href="http://earl-of-code.com" target="_blank">http://earl-of-code.com</a><br>
><br>
> _______________________________________________<br>
> Ironpython-users mailing list<br>
> <a href="mailto:Ironpython-users@python.org">Ironpython-users@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/ironpython-users" target="_blank">https://mail.python.org/mailman/listinfo/ironpython-users</a><br>
><br>
</div></div></blockquote></div><br></div>