Skip to content
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

mailbox.py tries to link even on filesystem wihch does not support symbolic links #61793

Closed
dominik-stadler mannequin opened this issue Mar 31, 2013 · 3 comments
Closed
Labels
stdlib Python modules in the Lib dir topic-email type-bug An unexpected behavior, bug, or error

Comments

@dominik-stadler
Copy link
Mannequin

dominik-stadler mannequin commented Mar 31, 2013

BPO 17593
Nosy @warsaw, @bitdancer

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2013-03-31.19:44:31.794>
labels = ['type-bug', 'library', 'expert-email']
title = 'mailbox.py tries to link even on filesystem wihch does not support symbolic links'
updated_at = <Date 2013-04-01.01:28:32.492>
user = 'https://bugs.python.org/dominik-stadler'

bugs.python.org fields:

activity = <Date 2013-04-01.01:28:32.492>
actor = 'r.david.murray'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)', 'email']
creation = <Date 2013-03-31.19:44:31.794>
creator = 'dominik-stadler'
dependencies = []
files = []
hgrepos = []
issue_num = 17593
keywords = []
message_count = 2.0
messages = ['185652', '185699']
nosy_count = 3.0
nosy_names = ['barry', 'r.david.murray', 'dominik-stadler']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue17593'
versions = ['Python 2.7', 'Python 3.3', 'Python 3.4']

@dominik-stadler
Copy link
Mannequin Author

dominik-stadler mannequin commented Mar 31, 2013

I tried to use NoPriv (https://github.com/RaymiiOrg/NoPriv/) to backup emails to an USB Disk which is formatted for Windows compatibility, i.e. FAT-type filesystem, but got the error below. Seems mailbox.py still tries to create a symbolic link, which is not possible on this filesystem.

Running on ext3 file system works fine. This is on Ubuntu Precise 12.04 with latest updates installed. Python is 2.7.3-0ubuntu3.1

Getting messages from server from folder: [Gmail]/Sent Mail.
Saving message 1.
Traceback (most recent call last):
  File "./nopriv.py", line 783, in <module>
    get_messages_to_local_maildir(folder, mail)    
  File "./nopriv.py", line 236, in get_messages_to_local_maildir
    saveToMaildir(raw_email, maildir_folder)
  File "./nopriv.py", line 155, in saveToMaildir
    message_key = folder.add(msg)
  File "/usr/lib/python2.7/mailbox.py", line 276, in add
    os.link(tmp_file.name, dest)
OSError: [Errno 1] Operation not permitted

@dominik-stadler dominik-stadler mannequin added the stdlib Python modules in the Lib dir label Mar 31, 2013
@bitdancer
Copy link
Member

The problem is that mailbox decides if links are possible based on the OS rather than on the file system. This is a general problem that Python has...when the Python file system APIs, and this code, were written, OSes could only read their own file systems, and there was only one file system type per OS.

Fixing this, then, pretty much requires solving the general problem of introspecting file system capabilities. I think there are open issues relating to that.

@bitdancer bitdancer added topic-email type-bug An unexpected behavior, bug, or error labels Apr 1, 2013
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@serhiy-storchaka
Copy link
Member

It is not a symbolic link, but a hard link.

It seems that it was fixed in bpo-28764/gh-72950 (452b3a6).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir topic-email type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants