Copying and Pasting from Word inserts invalid characters
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenLP |
Fix Committed
|
Medium
|
Phill |
Bug Description
We have reports from users coming in all the time for this.
When a user copies and pastes a song from Word into OpenLP, Word seems to stick various control characters into the edit box which are invisible (or at least, plebians don't see them). When the user clicks "Save", the following exception is thrown:
Traceback (most recent call last):
File "openlp\
File "openlp\
File "openlp\
File "openlp\
File "lxml.etree.pyx", line 2972, in lxml.etree.
File "apihelpers.pxi", line 1393, in lxml.etree._utf8 (src\lxml\
ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters
Can someone on Windows please try to reproduce this and figure out what those control characters are?
Related branches
- Raoul Snyman: Pending requested
- Tim Bentley: Pending requested
-
Diff: 1063 lines (+167/-143)47 files modifiedopenlp/core/common/__init__.py (+21/-3)
openlp/core/common/applocation.py (+1/-1)
openlp/core/common/httputils.py (+4/-4)
openlp/core/common/i18n.py (+1/-1)
openlp/core/common/mixins.py (+14/-0)
openlp/core/common/path.py (+1/-1)
openlp/core/common/settings.py (+4/-1)
openlp/core/lib/__init__.py (+1/-1)
openlp/core/lib/mediamanageritem.py (+4/-2)
openlp/core/ui/exceptionform.py (+1/-1)
openlp/core/ui/formattingtagcontroller.py (+1/-1)
openlp/core/ui/mainwindow.py (+2/-2)
openlp/core/ui/servicemanager.py (+28/-28)
openlp/core/ui/thememanager.py (+3/-3)
openlp/core/version.py (+2/-2)
openlp/core/widgets/edits.py (+13/-3)
openlp/core/widgets/views.py (+1/-1)
openlp/plugins/bibles/forms/booknameform.py (+1/-2)
openlp/plugins/bibles/lib/__init__.py (+3/-3)
openlp/plugins/bibles/lib/db.py (+1/-2)
openlp/plugins/images/lib/mediaitem.py (+2/-1)
openlp/plugins/presentations/lib/pptviewcontroller.py (+1/-1)
openlp/plugins/songs/forms/editsongform.py (+3/-3)
openlp/plugins/songs/lib/__init__.py (+2/-3)
openlp/plugins/songs/lib/importers/easyslides.py (+2/-1)
openlp/plugins/songs/lib/importers/mediashout.py (+1/-1)
openlp/plugins/songs/lib/importers/openoffice.py (+2/-2)
openlp/plugins/songs/lib/importers/opensong.py (+2/-1)
openlp/plugins/songs/lib/importers/songimport.py (+2/-21)
openlp/plugins/songs/lib/importers/songsoffellowship.py (+0/-1)
openlp/plugins/songs/lib/importers/zionworx.py (+5/-15)
openlp/plugins/songs/lib/openlyricsxml.py (+1/-1)
openlp/plugins/songusage/forms/songusagedetailform.py (+8/-2)
openlp/plugins/songusage/songusageplugin.py (+6/-9)
tests/functional/openlp_core/common/test_actions.py (+1/-0)
tests/functional/openlp_core/common/test_httputils.py (+1/-1)
tests/functional/openlp_core/common/test_i18n.py (+1/-1)
tests/functional/openlp_core/common/test_path.py (+4/-4)
tests/functional/openlp_core/lib/test_lib.py (+1/-1)
tests/functional/openlp_core/ui/test_first_time.py (+1/-1)
tests/functional/openlp_core/widgets/test_views.py (+0/-1)
tests/functional/openlp_plugins/presentations/test_presentationcontroller.py (+1/-1)
tests/interfaces/openlp_core/ui/test_projectormanager.py (+1/-1)
tests/interfaces/openlp_core/ui/test_projectorsourceform.py (+1/-1)
tests/interfaces/openlp_core/ui/test_thememanager.py (+1/-1)
tests/utils/__init__.py (+1/-1)
tests/utils/test_pylint.py (+9/-5)
Changed in openlp: | |
importance: | Undecided → Medium |
Changed in openlp: | |
status: | In Progress → Fix Committed |
Changed in openlp: | |
milestone: | none → 2.5.1 |
We could try to fix it by filtering out control chars as done here: https:/ /stackoverflow. com/questions/ 8733233/ filtering- out-certain- bytes-in- python
Note that there is a regex solution that is listed as the second answer that is much faster than the accepted answer...