Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] syncplay: backport fix for Python 3.12 support
@ 2023-11-16 21:42 z411
  2023-11-16 21:44 ` [PR PATCH] [Merged]: " classabbyamp
  0 siblings, 1 reply; 2+ messages in thread
From: z411 @ 2023-11-16 21:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1304 bytes --]

There is a new pull request by z411 against master on the void-packages repository

https://github.com/z411/void-packages syncplay-fix
https://github.com/void-linux/void-packages/pull/47273

syncplay: backport fix for Python 3.12 support
<!-- Uncomment relevant sections and delete options which are not applicable -->

Since Void Linux now uses Python 3.12 as default, Syncplay broke. This backports the fix to make it work under Python 3.12.

Source: https://github.com/Syncplay/syncplay/pull/636

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, x86_64
-->


A patch file from https://github.com/void-linux/void-packages/pull/47273.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-syncplay-fix-47273.patch --]
[-- Type: text/x-diff, Size: 4749 bytes --]

From e3d2b08a45051d9a9305615206b615827498f318 Mon Sep 17 00:00:00 2001
From: z411 <z411@omaera.org>
Date: Thu, 16 Nov 2023 18:37:03 -0300
Subject: [PATCH] syncplay: backport fix for Python 3.12 support

---
 .../patches/python3-12-compatibility.patch    | 86 +++++++++++++++++++
 srcpkgs/syncplay/template                     |  2 +-
 2 files changed, 87 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/syncplay/patches/python3-12-compatibility.patch

diff --git a/srcpkgs/syncplay/patches/python3-12-compatibility.patch b/srcpkgs/syncplay/patches/python3-12-compatibility.patch
new file mode 100644
index 00000000000000..b407c11135877f
--- /dev/null
+++ b/srcpkgs/syncplay/patches/python3-12-compatibility.patch
@@ -0,0 +1,86 @@
+From a637befbdebd7f8e834ccd782f09823bf04146a8 Mon Sep 17 00:00:00 2001
+From: Floris Vastenhout <kilmanio@mailfence.com>
+Date: Tue, 10 Oct 2023 19:20:26 +0200
+Subject: Update to python 3.12
+
+Backport of fix to make Syncplay work on Python 3.12.
+
+Source: https://github.com/Syncplay/syncplay/pull/636
+
+---
+ syncplay/ui/ConfigurationGetter.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/syncplay/ui/ConfigurationGetter.py b/syncplay/ui/ConfigurationGetter.py
+index 22525922..4b36ca4f 100755
+--- a/syncplay/ui/ConfigurationGetter.py
++++ b/syncplay/ui/ConfigurationGetter.py
+@@ -5,7 +5,7 @@
+ import re
+ import os
+ import sys
+-from configparser import SafeConfigParser, DEFAULTSECT
++from configparser import ConfigParser, DEFAULTSECT
+ 
+ from syncplay import constants, utils, version, milestone
+ from syncplay.messages import getMessage, setLanguage, isValidLanguage
+@@ -389,7 +389,7 @@ def _parseConfigFile(self, iniPath, createConfig=True):
+                 open(iniPath, 'w').close()
+             else:
+                 return
+-        parser.readfp(codecs.open(iniPath, "r", "utf_8_sig"))
++        parser.read(codecs.open(iniPath, "r", "utf_8_sig"))
+         for section, options in list(self._iniStructure.items()):
+             if parser.has_section(section):
+                 for option in options:
+@@ -432,7 +432,7 @@ def _saveConfig(self, iniPath):
+         if self._config['noStore']:
+             return
+         parser = SafeConfigParserUnicode(strict=False)
+-        parser.readfp(codecs.open(iniPath, "r", "utf_8_sig"))
++        parser.read(codecs.open(iniPath, "r", "utf_8_sig"))
+         for section, options in list(self._iniStructure.items()):
+             if not parser.has_section(section):
+                 parser.add_section(section)
+@@ -593,7 +593,7 @@ def setConfigOption(self, option, value):
+         self._config = backup
+ 
+ 
+-class SafeConfigParserUnicode(SafeConfigParser):
++class SafeConfigParserUnicode(ConfigParser):
+     def write(self, fp):
+         """Write an .ini-format representation of the configuration state."""
+         if self._defaults:
+
+From cc5a389faeb0a7edb9e6358400d6a37507e26dd4 Mon Sep 17 00:00:00 2001
+From: Floris Vastenhout <kilmanio@mailfence.com>
+Date: Tue, 10 Oct 2023 19:43:36 +0200
+Subject: [PATCH 2/2] Use read_file instead of read
+
+---
+ syncplay/ui/ConfigurationGetter.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/syncplay/ui/ConfigurationGetter.py b/syncplay/ui/ConfigurationGetter.py
+index 4b36ca4f..f0a7f32a 100755
+--- a/syncplay/ui/ConfigurationGetter.py
++++ b/syncplay/ui/ConfigurationGetter.py
+@@ -389,7 +389,7 @@ def _parseConfigFile(self, iniPath, createConfig=True):
+                 open(iniPath, 'w').close()
+             else:
+                 return
+-        parser.read(codecs.open(iniPath, "r", "utf_8_sig"))
++        parser.read_file(codecs.open(iniPath, "r", "utf_8_sig"))
+         for section, options in list(self._iniStructure.items()):
+             if parser.has_section(section):
+                 for option in options:
+@@ -432,7 +432,7 @@ def _saveConfig(self, iniPath):
+         if self._config['noStore']:
+             return
+         parser = SafeConfigParserUnicode(strict=False)
+-        parser.read(codecs.open(iniPath, "r", "utf_8_sig"))
++        parser.read_file(codecs.open(iniPath, "r", "utf_8_sig"))
+         for section, options in list(self._iniStructure.items()):
+             if not parser.has_section(section):
+                 parser.add_section(section)
+
diff --git a/srcpkgs/syncplay/template b/srcpkgs/syncplay/template
index 57cfae78901579..31579881411673 100644
--- a/srcpkgs/syncplay/template
+++ b/srcpkgs/syncplay/template
@@ -1,7 +1,7 @@
 # Template file for 'syncplay'
 pkgname=syncplay
 version=1.7.0
-revision=2
+revision=3
 build_style=gnu-makefile
 pycompile_dirs="usr/lib/syncplay/syncplay"
 depends="desktop-file-utils python3-pyside2 python3-Twisted

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PR PATCH] [Merged]: syncplay: backport fix for Python 3.12 support
  2023-11-16 21:42 [PR PATCH] syncplay: backport fix for Python 3.12 support z411
@ 2023-11-16 21:44 ` classabbyamp
  0 siblings, 0 replies; 2+ messages in thread
From: classabbyamp @ 2023-11-16 21:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]

There's a merged pull request on the void-packages repository

syncplay: backport fix for Python 3.12 support
https://github.com/void-linux/void-packages/pull/47273

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

Since Void Linux now uses Python 3.12 as default, Syncplay broke. This backports the fix to make it work under Python 3.12.

Source: https://github.com/Syncplay/syncplay/pull/636

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, x86_64
-->


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-16 21:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-16 21:42 [PR PATCH] syncplay: backport fix for Python 3.12 support z411
2023-11-16 21:44 ` [PR PATCH] [Merged]: " classabbyamp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).