<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>5262</bug_id>
          
          <creation_ts>2004-09-30 13:14:32 +0400</creation_ts>
          <short_desc>модуль re: буква ё почему-то не входит в диапазон [а-я]</short_desc>
          <delta_ts>2019-07-22 09:25:38 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>python-base</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Renat Sabitov">r_sabitov</reporter>
          <assigned_to name="Andrey Orlov">cray</assigned_to>
          <cc>280rhgqv</cc>
    
    <cc>mike</cc>
    
    <cc>vseleznv</cc>
          
          <qa_contact name="Fr. Br. George">george</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>18972</commentid>
    <comment_count>0</comment_count>
    <who name="Renat Sabitov">r_sabitov</who>
    <bug_when>2004-09-30 13:14:32 +0400</bug_when>
    <thetext>if re.search(&apos;([^а-я])&apos;, &apos;ё&apos;).group(1) != None:
   print &quot;Error&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18973</commentid>
    <comment_count>1</comment_count>
    <who name="Renat Sabitov">r_sabitov</who>
    <bug_when>2004-09-30 13:16:50 +0400</bug_when>
    <thetext>Сорри не так

if re.search(&apos;([^а-я])&apos;, &apos;ё&apos;) != None:
   print &quot;Error&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18974</commentid>
    <comment_count>2</comment_count>
    <who name="Andrey Orlov">cray</who>
    <bug_when>2004-09-30 18:18:19 +0400</bug_when>
    <thetext>Если вы не включимли локаль, то она туда действительно не входит. 
А если вы включили локаль то все работает. Пример следует. 
 
 
18:18:58 (cray@fire)  /home/cray/.home&gt;  python 
Python 2.3.3 (#1, Jul  3 2004, 17:16:23) 
[GCC 3.3.3 20040412 (ALT Linux, build 3.3.3-alt5)] on linux2 
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information. 
&gt;&gt;&gt; import re 
&gt;&gt;&gt; import locale 
&gt;&gt;&gt; locale.setlocale(0,&quot;ru_RU.KOI8-R&quot;) 
&apos;ru_RU.KOI8-R&apos; 
&gt;&gt;&gt; re.search(&apos;([^а-я])&apos;, &apos;ё&apos;).group(1) 
&apos;\xa3&apos; 
&gt;&gt;&gt; print re.search(&apos;([^а-я])&apos;, &apos;ё&apos;).group(1) 
ё 
&gt;&gt;&gt; map(ord,&quot;аёя&quot;) 
[193, 163, 209] 
&gt;&gt;&gt; 
 
 
 
 
 </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18987</commentid>
    <comment_count>3</comment_count>
    <who name="Renat Sabitov">r_sabitov</who>
    <bug_when>2004-10-01 10:30:54 +0400</bug_when>
    <thetext>Не все так просто. Наверное я неправильно написал пример. В своей программе я
использовал unicode, думаю на строки в этой кодировке не должны распространяться
проблемы локали. Если же должны, то какую локаль мне поставить?

&gt;&gt;&gt; a = unicode (&quot;[а-я]&quot;, &quot;koi8-r&quot;);
&gt;&gt;&gt; b = unicode (&quot;ё&quot;, &quot;koi8-r&quot;);
&gt;&gt;&gt; re.compile (a, re.U ).match(b)
&gt;&gt;&gt; re.compile (a, re.U).match(unicode(&quot;е&quot;, &quot;koi8-r&quot;))
&lt;_sre.SRE_Match object at 0x403c68e0&gt;


&gt;&gt;&gt; locale.setlocale(0,&quot;ru_RU.KOI8-R&quot;)
&apos;ru_RU.KOI8-R&apos;
&gt;&gt;&gt; a = unicode (&quot;[а-я]&quot;, &quot;koi8-r&quot;);
&gt;&gt;&gt; b = unicode (&quot;ё&quot;, &quot;koi8-r&quot;);
&gt;&gt;&gt; re.compile (a, re.U).match(b)
&gt;&gt;&gt; re.compile (a, re.U).match(unicode(&quot;е&quot;, &quot;koi8-r&quot;))
&lt;_sre.SRE_Match object at 0x403c62f8&gt;
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19580</commentid>
    <comment_count>4</comment_count>
    <who name="Andrey Orlov">cray</who>
    <bug_when>2004-11-03 02:30:56 +0300</bug_when>
    <thetext>&gt; Не все так просто. Наверное я неправильно написал пример. В своей программе я 
 
Нет, это я неправильно ответил. Причем совсем неправильно - мой пример 
подтверждает вашу правоту, а не мою. Видимо, я перегрелся тогда, извините. 
 
Похоже на то, что модуль sre забивает на локализацию диапазонов. Баг это или 
фича - нужно разбираться. Локаль модуль учитывает только при расширении 
макросов: (\w и т.п.), я попробую провентилировать вопрос. 
 
 
 </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46606</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Shigorin">mike</who>
    <bug_when>2007-03-14 12:33:13 +0300</bug_when>
    <thetext>reassign</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46654</commentid>
    <comment_count>6</comment_count>
    <who name="Fr. Br. George">george</who>
    <bug_when>2007-03-14 20:50:50 +0300</bug_when>
    <thetext>В документации по re нигде не сказано, что LOCALE влияет на диапазоны вида [а-я].
Более того, опыт показывает, что дмапазон _всегда_ строится по _кодам_ символов,
а не по LOCALE, которое влияет только на \w и пободных ему.

Так что это, увы, фича. Видимо, предполагается, что конструкции вида [ж-х] в
real life бессмысленны, множества типа гласные/согласные лучше всё-таки задавать
перечислением, а иметь возможность работать с _кодом_ символа в различных
кодировках тоже хочется.

Предлагаю багу закрыть.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63652</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Shigorin">mike</who>
    <bug_when>2008-02-15 22:53:07 +0300</bug_when>
    <thetext>re</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63654</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Shigorin">mike</who>
    <bug_when>2008-02-15 22:53:36 +0300</bug_when>
    <thetext>worksforme</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>183188</commentid>
    <comment_count>9</comment_count>
    <who name="Andrew Goethe">280rhgqv</who>
    <bug_when>2019-07-22 09:25:38 +0300</bug_when>
    <thetext>Bug is an error and the issue which prevail in the system and the file due to viral and the viral component attack as well. The bug is creating the reason of making the https://www.australian-writings.net/ by writing the debut making situation.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>