-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: module 'os' has no attribute 'link'. Did you mean: 'unlink'? #406
Comments
Android 13 is not officially supported by Are you sure you have a complete Python installation on your device? The failing code is in Lines 931 to 950 in 783610f
Here different options are set for different OS. |
According to this solution pyodide/pyodide#3880 (comment), I could resolve the issue by the following hack: # --- <hack>
import os
print(hasattr(os, 'link')) # --> False
os.link = os.symlink
print(hasattr(os, 'link')) # --> True
# --- </hack>
import ZODB # just import & run
# imported successfully |
I just hit another error: False
True
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/zc/lockfile/__init__.py", line 60, in _lock_file
fcntl.flock(file.fileno(), _flags)
OSError: [Errno 38] Function not implemented
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module>
start(fakepyfile,mainpyfile)
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
exec(open(mainpyfile).read(), __main__.__dict__)
File "<string>", line 25, in <module>
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/ZODB/FileStorage/FileStorage.py", line 251, in __init__
self._lock_file = LockFile(file_name + '.lock')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/zc/lockfile/__init__.py", line 120, in __init__
super().__init__(path)
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/zc/lockfile/__init__.py", line 93, in __init__
_lock_file(fp)
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/zc/lockfile/__init__.py", line 62, in _lock_file
raise LockError("Couldn't lock %r" % file.name)
zc.lockfile.LockError: Couldn't lock 'mydata.fs.lock'
[Program finished] The Codeimport persistent
class Account(persistent.Persistent):
def __init__(self):
self.balance = 0.0
def deposit(self, amount):
self.balance += amount
def cash(self, amount):
assert amount < self.balance
self.balance -= amount
# --- <hack>
import os
print(hasattr(os, 'link')) # --> False
os.link = os.symlink
print(hasattr(os, 'link')) # --> True
# --- </hack>
import ZODB # just import & run
# imported successfully
import ZODB.FileStorage
storage = ZODB.FileStorage.FileStorage('mydata.fs')
db = ZODB.DB(storage)
connection = db.open()
root = connection.root
import BTrees._OOBTree
root.accounts = BTrees.OOBTree.BTree()
root.accounts['account-1'] = Account()
root.accounts['account-1'].deposit(9630)
import transaction
transaction.commit() |
BUG
What I did:
What I expect to happen:
Run without errors
What actually happened:
What version of Python and Zope/Addons I am using:
Python: 3.11.4
Zope/Addons: None
Platform: Android 13 Arm64
Application: Pydroid 3
The text was updated successfully, but these errors were encountered: