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

[16.0][FIX] fs_file: mimetype property computation on FSFileValue #284

Merged
merged 2 commits into from
Oct 5, 2023

Conversation

lmignon
Copy link
Contributor

@lmignon lmignon commented Oct 5, 2023

No description provided.

@lmignon lmignon force-pushed the 16.0-fix-fs_file-mimetype branch from 62e1e99 to dbf70d9 Compare October 5, 2023 09:29
@lmignon lmignon marked this pull request as ready for review October 5, 2023 09:30
@lmignon
Copy link
Contributor Author

lmignon commented Oct 5, 2023

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-284-by-lmignon-bump-patch, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Oct 5, 2023
Signed-off-by lmignon
@OCA-git-bot
Copy link
Contributor

@lmignon The merge process could not be finalized, because command oca-gen-addon-readme --if-source-changed --org-name OCA --repo-name storage --branch 16.0 --addons-dir /tmp/tmpci1ekf3_ --commit failed with output:

/tmp/tmpci1ekf3_/fs_file/README.rst:163: (ERROR/3) Unexpected indentation.
Traceback (most recent call last):
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2793, in text
    block = self.state_machine.get_text_block(flush_left=True)
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 403, in get_text_block
    block = self.input_lines.get_text_block(self.line_offset,
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 1352, in get_text_block
    raise UnexpectedIndentationError(self[start:end], source,
docutils.statemachine.UnexpectedIndentationError: (StringList(['The *mimetype* value is computed as follow:', '* If an attachment is set, the mimetype is taken from the attachment.', '* If no attachment is set, the mimetype is guessed from the name of the file.', '* If the mimetype cannot be guessed from the name, the mimetype is guessed from'], items=[('/tmp/tmpci1ekf3_/fs_file/README.rst', 158), ('/tmp/tmpci1ekf3_/fs_file/README.rst', 159), ('/tmp/tmpci1ekf3_/fs_file/README.rst', 160), ('/tmp/tmpci1ekf3_/fs_file/README.rst', 161)]), '/tmp/tmpci1ekf3_/fs_file/README.rst', 163)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/oca-gen-addon-readme", line 11, in <module>
    load_entry_point('oca-maintainers-tools', 'console_scripts', 'oca-gen-addon-readme')()
  File "/ocamt/lib/python3.8/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/ocamt/lib/python3.8/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/ocamt/lib/python3.8/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/ocamt/lib/python3.8/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/ocamt/src/oca-maintainers-tools/tools/gen_addon_readme.py", line 537, in gen_addon_readme
    check_rst(readme_filename)
  File "/ocamt/src/oca-maintainers-tools/tools/gen_addon_readme.py", line 388, in check_rst
    publish_file(
  File "/ocamt/lib/python3.8/site-packages/docutils/core.py", line 422, in publish_file
    output, publisher = publish_programmatically(
  File "/ocamt/lib/python3.8/site-packages/docutils/core.py", line 722, in publish_programmatically
    output = publisher.publish(enable_exit_status=enable_exit_status)
  File "/ocamt/lib/python3.8/site-packages/docutils/core.py", line 234, in publish
    self.document = self.reader.read(self.source, self.parser,
  File "/ocamt/lib/python3.8/site-packages/docutils/readers/__init__.py", line 70, in read
    self.parse()
  File "/ocamt/lib/python3.8/site-packages/docutils/readers/__init__.py", line 76, in parse
    self.parser.parse(self.input, document)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/__init__.py", line 184, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 169, in run
    results = StateMachineWS.run(self, input_lines, input_offset,
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 233, in run
    context, next_state, result = self.check_line(
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 445, in check_line
    return method(match, context, next_state)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 3024, in text
    self.section(title.lstrip(), source, style, lineno + 1, messages)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 325, in section
    self.new_subsection(title, lineno, messages)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 391, in new_subsection
    newabsoffset = self.nested_parse(
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 279, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 233, in run
    context, next_state, result = self.check_line(
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 445, in check_line
    return method(match, context, next_state)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2785, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 325, in section
    self.new_subsection(title, lineno, messages)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 391, in new_subsection
    newabsoffset = self.nested_parse(
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 279, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 233, in run
    context, next_state, result = self.check_line(
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 445, in check_line
    return method(match, context, next_state)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2785, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 325, in section
    self.new_subsection(title, lineno, messages)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 391, in new_subsection
    newabsoffset = self.nested_parse(
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 279, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 233, in run
    context, next_state, result = self.check_line(
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 445, in check_line
    return method(match, context, next_state)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 1273, in bullet
    i, blank_finish = self.list_item(match.end())
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 1295, in list_item
    self.nested_parse(indented, input_offset=line_offset,
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 279, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 233, in run
    context, next_state, result = self.check_line(
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 445, in check_line
    return method(match, context, next_state)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2796, in text
    msg = self.reporter.error('Unexpected indentation.',
  File "/ocamt/lib/python3.8/site-packages/docutils/utils/__init__.py", line 231, in error
    return self.system_message(self.ERROR_LEVEL, *args, **kwargs)
  File "/ocamt/lib/python3.8/site-packages/docutils/utils/__init__.py", line 197, in system_message
    raise SystemMessage(msg, level)
docutils.utils.SystemMessage: /tmp/tmpci1ekf3_/fs_file/README.rst:163: (ERROR/3) Unexpected indentation.

The mimetype property of FSFileValue is computed as follow:

* If an attachment is set, the mimetype is taken from the attachment.
* If no attachment is set, the mimetype is guessed from the name of the file.
* If the mimetype cannot be guessed from the name, the mimetype is guessed from the content of the file.
@lmignon lmignon force-pushed the 16.0-fix-fs_file-mimetype branch from dbf70d9 to 5148cf8 Compare October 5, 2023 09:46
@lmignon
Copy link
Contributor Author

lmignon commented Oct 5, 2023

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-284-by-lmignon-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit bcda2c9 into OCA:16.0 Oct 5, 2023
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at f1b25e7. Thanks a lot for contributing to OCA. ❤️

@lmignon lmignon deleted the 16.0-fix-fs_file-mimetype branch October 5, 2023 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants