[office/skrooge] /: Wrong values downloaded for stock symbols

Stéphane MANKOWSKI <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 0eb245b3f52fa30151ddb7e96307a9b062eba87e by Stéphane MANKOWSKI.
Committed on 17/08/2026 at 09:28.
Pushed by smankowski into branch 'master'.

Wrong values downloaded for stock symbols
BUG:524292

M  +5    -0    CHANGELOG
M  +3    -3    skgbankmodeler/skrooge-boursorama.py
M  +6    -0    tests/scripts/skgtestunit.sh

https://invent.kde.org/office/skrooge/-/commit/0eb245b3f52fa30151ddb7e96307a9b062eba87e

diff --git a/CHANGELOG b/CHANGELOG
index b550713dc..4c9e4b7d5 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,8 @@
+skrooge (26.X.X)
+ *Correction bug 524292: Wrong values downloaded for stock symbols
+
+ -- Stephane MANKOWSKI <[email protected]>  XX
+
 skrooge (26.8.0)
  *Correction bug 518796: skrooge-boursorama.py stop to work for some values
  *Correction bug 520749: Skrooge can't load skg file after org.kde.Platform update
diff --git a/skgbankmodeler/skrooge-boursorama.py b/skgbankmodeler/skrooge-boursorama.py
index bf55876bc..190f3f1e1 100755
--- a/skgbankmodeler/skrooge-boursorama.py
+++ b/skgbankmodeler/skrooge-boursorama.py
@@ -22,7 +22,7 @@ LOOKUP_URL = "https://www.boursorama.com/recherche/"
 SYMBOL_RE = re.compile(
     r"/cours/(?:[^/]+/)*?(?P<code>(?:[0-9][a-zA-Z][a-zA-Z0-9]+|[A-Z]{2}[A-Z0-9]{10}))(?:[/?#]|$)"
 )
-BROKER_SYMBOL_RE = re.compile(r"[0-9][a-zA-Z][a-zA-Z0-9]+")
+BROKER_SYMBOL_RE = re.compile(r"(?:[0-9][a-zA-Z][a-zA-Z0-9]+|[A-Z]{1,5})")
 ISIN_RE = re.compile(r"[A-Z]{2}[A-Z0-9]{10}")
 NAVIGATION_RE = re.compile(r"Page \d+")
 
@@ -58,8 +58,8 @@ def decode_response_payload(response) -> str:
 
 
 def ticker_is_direct_symbol(ticker: str) -> bool:
-    # Only Boursorama market codes (like 1rPCAC) can be used directly.
-    # ISINs still need lookup to resolve to the provider-specific code.
+    # Boursorama market codes (like 1rPCAC) and standard stock ticker symbols (like AAPL)
+    # can be used directly. ISINs still need lookup to resolve to the provider-specific code.
     return BROKER_SYMBOL_RE.fullmatch(ticker) is not None
 
 
diff --git a/tests/scripts/skgtestunit.sh b/tests/scripts/skgtestunit.sh
index f3482cb0e..988f88a50 100755
--- a/tests/scripts/skgtestunit.sh
+++ b/tests/scripts/skgtestunit.sh
@@ -12,6 +12,12 @@ if [ $rc != 0 ] ; then
 	exit $rc
 fi
 
+skrooge-boursorama.py AAPL 2026-08-13 1d | head -2 | tail -1 | grep -q "^2026-08-14,306\."
+rc=$?
+if [ $rc != 0 ] ; then
+	exit $rc
+fi
+
 "${EXE}"
 rc=$?
 if [ $rc != 0 ] ; then
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.