bugGNU Health - Bugs: bug #64761, Locale [zh_cn] does not exist.

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #64761: Locale [zh_cn] does not exist.

Submitter:  Feng Shu <tumashu>
Submitted:  Sun 08 Oct 2023 12:38:51 AM UTC
   
 
Category:  Programming / Tracebacks Severity:  3 - Normal
Item Group:  None Status:  Ready For Test
Privacy:  Public Assigned to:  tumashu
Open/Closed:  Open Release:  4.3.0
Module:  health_orthanc Component:  Hospital Management

Sun 08 Oct 2023 09:16:05 AM UTC, comment #5: 


comment #4:

>
> comment #3:
> > Thanks, Feng
> >
> > Let me know it it catches the missing locale zh_cn
>
> can catch


Excellent!

Happy Sunday :)

Luis Falcon <meanmicio>
Group administrator
Sun 08 Oct 2023 07:24:45 AM UTC, comment #4: 


comment #3:

> Thanks, Feng
>
> Please check
>
> https://hg.savannah.gnu.org/hgweb/health/rev/f1447431a074
>
> I've added Exceptions to avoid bare excepts, and logging.
>
> Let me know it it catches the missing locale zh_cn


can catch

>
> Bests
>

Feng Shu <tumashu>
Sun 08 Oct 2023 06:58:20 AM UTC, comment #3: 

Thanks, Feng

Please check

https://hg.savannah.gnu.org/hgweb/health/rev/f1447431a074

I've added Exceptions to avoid bare excepts, and logging.

Let me know it it catches the missing locale zh_cn

Bests

Luis Falcon <meanmicio>
Group administrator
Sun 08 Oct 2023 01:40:27 AM UTC, comment #2: 
Feng Shu <tumashu>
Sun 08 Oct 2023 01:24:24 AM UTC, comment #1: 

Maybe we should add a new locale to pendulum package

Feng Shu <tumashu>
Sun 08 Oct 2023 12:38:51 AM UTC, original submission:  

  File "/home/feng/gnuhealth/tryton/server/trytond-6.0.34/trytond/protocols/dispatcher.py", line 180, in _dispatch
    result = rpc.result(meth(c_args, *c_kwargs))
                        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/feng/gnuhealth/tryton/server/trytond-6.0.34/trytond/model/modelsql.py", line 870, in read
    getter_results = field.get(
                     ^^^^^^^^^^
  File "/home/feng/gnuhealth/tryton/server/trytond-6.0.34/trytond/model/fields/function.py", line 105, in get
    return dict((name, call(name)) for name in names)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/feng/gnuhealth/tryton/server/trytond-6.0.34/trytond/model/fields/function.py", line 105, in <genexpr>
    return dict((name, call(name)) for name in names)
                       ^^^^^^^^^^
  File "/home/feng/gnuhealth/tryton/server/trytond-6.0.34/trytond/model/fields/function.py", line 100, in call
    return dict((r.id, method(r, name)) for r in records)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/feng/gnuhealth/tryton/server/trytond-6.0.34/trytond/model/fields/function.py", line 100, in <genexpr>
    return dict((r.id, method(r, name)) for r in records)
                       ^^^^^^^^^^^^^^^
  File "/home/feng/gnuhealth/tryton/server/trytond-6.0.34/trytond/modules/health_orthanc/health_orthanc.py", line 521, in get_since_sync_readable
    return d.in_words(Transaction().language)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/feng/.local/lib/python3.11/site-packages/pendulum/period.py", line 262, in in_words
    locale = pendulum.locale(locale)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/feng/.local/lib/python3.11/site-packages/pendulum/helpers.py", line 200, in locale
    return Locale.load(name)
           ^^^^^^^^^^^^^^^^^
  File "/home/feng/.local/lib/python3.11/site-packages/pendulum/locales/locale.py", line 42, in load
    raise ValueError("Locale [{}] does not exist.".format(locale))
ValueError: Locale [zh_cn] does not exist.
2704 140002948265664 [2023-10-08 00:35:58,699] INFO werkzeug 127.0.0.1 - - [08/Oct/2023 00:35:58] "POST /gnuhealth/ HTTP/1.1" 200 -
2704 140002948265664 [2023-10-08 00:35:58,723] ERROR trytond.protocols.dispatcher <class 'trytond.pool.gnuhealth.orthanc.config'>.read(([1, 8], ['domain', 'label', 'link', 'since_sync_readable', 'validated', 'rec_name', '_timestamp', '_write', '_delete'], {'client': '91c4e4f6-fecc-490f-805b-c1f06562df6a', 'company_filter': 'one', 'company': 1, 'company.rec_name': '灌云县卫生健康委员会', 'language': 'zh_CN', 'language_direction': 'ltr', 'groups': [7, 8, 1, 3, 5, 2, 6, 10, 19, 35, 20, 22, 27, 23, 25, 30, 26, 28, 29, 4, 9, 32, 33, 34, 15, 16, 17], 'locale': {'date': '%Y-%m-%d', 'grouping': [3, 0], 'decimal_point': '.', 'thousands_sep': ','}}), *{}) from admin@127.0.0.1/gnuhealth/
Traceback (most recent call last):
  File "/home/feng/gnuhealth/tryton/server/trytond-6.0.34/trytond/protocols/dispatcher.py", line 180, in _dispatch
    result = rpc.result(meth(c_args, *c_kwargs))
                        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/feng/gnuhealth/tryton/server/trytond-6.0.34/trytond/model/modelsql.py", line 870, in read
    getter_results = field.get(
                     ^^^^^^^^^^
  File "/home/feng/gnuhealth/tryton/server/trytond-6.0.34/trytond/model/fields/function.py", line 105, in get
    return dict((name, call(name)) for name in names)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/feng/gnuhealth/tryton/server/trytond-6.0.34/trytond/model/fields/function.py", line 105, in <genexpr>
    return dict((name, call(name)) for name in names)
                       ^^^^^^^^^^
  File "/home/feng/gnuhealth/tryton/server/trytond-6.0.34/trytond/model/fields/function.py", line 100, in call
    return dict((r.id, method(r, name)) for r in records)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/feng/gnuhealth/tryton/server/trytond-6.0.34/trytond/model/fields/function.py", line 100, in <genexpr>
    return dict((r.id, method(r, name)) for r in records)
                       ^^^^^^^^^^^^^^^
  File "/home/feng/gnuhealth/tryton/server/trytond-6.0.34/trytond/modules/health_orthanc/health_orthanc.py", line 521, in get_since_sync_readable
    return d.in_words(Transaction().language)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/feng/.local/lib/python3.11/site-packages/pendulum/period.py", line 262, in in_words
    locale = pendulum.locale(locale)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/feng/.local/lib/python3.11/site-packages/pendulum/helpers.py", line 200, in locale
    return Locale.load(name)
           ^^^^^^^^^^^^^^^^^
  File "/home/feng/.local/lib/python3.11/site-packages/pendulum/locales/locale.py", line 42, in load
    raise ValueError("Locale [{}] does not exist.".format(locale))
ValueError: Locale [zh_cn] does not exist.

Feng Shu <tumashu>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by meanmicio (Posted a comment)
  • -email is unavailable- added by tumashu (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-10-08 meanmicio CategoryNone Programming / Tracebacks
        Assigned toNone tumashu
        ReleaseNone 4.3.0
    2023-10-08 tumashu StatusNone Ready For Test
    2023-10-08 tumashu StatusInvalid None
    2023-10-08 tumashu StatusNone Invalid

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code